PayPal
10+ Geeco Enercon Interview Questions and Answers
Q1. Reverse the String Problem Statement
You are given a string STR
which contains alphabets, numbers, and special characters. Your task is to reverse the string.
Example:
Input:
STR = "abcde"
Output:
"edcba"
Input...read more
Reverse a given string containing alphabets, numbers, and special characters.
Iterate through the string from the end to the beginning and append each character to a new string.
Use built-in functions like reverse() or slicing to reverse the string.
Handle special characters and numbers while reversing the string.
Ensure to consider the constraints on the input string length and number of test cases.
Q2. One Away Transformation Problem
Given two strings, A
and B
, determine whether A
can be transformed into B
by performing at most one of the following operations (including zero operations):
1. Delete a character...read more
Determine if one string can be transformed into another by performing at most one operation (insert, delete, replace).
Iterate through both strings simultaneously and check for differences.
Handle cases where a character needs to be inserted, deleted, or replaced.
Keep track of the number of operations performed and ensure it does not exceed one.
Q3. Remove Duplicates from String Problem Statement
You are provided a string STR
of length N
, consisting solely of lowercase English letters.
Your task is to remove all duplicate occurrences of characters in the s...read more
Remove duplicate occurrences of characters in a given string.
Use a hash set to keep track of characters seen so far.
Iterate through the string and add non-duplicate characters to a new string.
Return the new string without duplicate characters.
Q4. Dijkstra's Shortest Path Problem
Given an undirected graph with ‘V’ vertices (labeled 0, 1, ... , V-1) and ‘E’ edges, where each edge has a weight representing the distance between two connected nodes (X, Y).
Y...read more
Dijkstra's algorithm is used to find the shortest path from a source node to all other nodes in a graph with weighted edges.
Implement Dijkstra's algorithm to find the shortest path distances from the source node to all other nodes.
Use a priority queue to efficiently select the next node with the shortest distance.
Update the distances of neighboring nodes based on the current node's distance and edge weights.
Handle disconnected vertices by assigning a large value (e.g., 214748...read more
Stack is used for static memory allocation and stores local variables, while Heap is used for dynamic memory allocation and stores objects.
Stack is faster than Heap as it has a fixed size and memory allocation is done at compile time.
Heap is slower than Stack as memory allocation is done at runtime and requires more complex management.
Stack memory is limited and typically smaller in size, while Heap memory is larger and can grow as needed.
Objects in OOP are typically stored i...read more
To measure exactly 15 minutes using two hourglasses of 7 and 11 minutes, start both hourglasses together and then flip the 7-minute hourglass when it runs out.
Start both hourglasses at the same time.
When the 7-minute hourglass runs out, flip it immediately.
When the 11-minute hourglass runs out, 4 minutes will have passed on the 7-minute hourglass. This gives a total of 15 minutes.
Query to find the nth highest salary from a database
Use the ORDER BY clause to sort salaries in descending order
Use the LIMIT clause to select the nth highest salary
Consider handling cases where there may be ties for the nth highest salary
malloc is a function in C for dynamic memory allocation, while new is an operator in C++ for dynamic memory allocation and object creation.
malloc is a function in C, while new is an operator in C++.
malloc returns a void pointer, while new returns a pointer to the type being allocated.
malloc does not call constructors, while new calls constructors for object initialization.
malloc requires manual memory deallocation with free, while new automatically calls the destructor and de...read more
C is a procedural programming language while C++ is an object-oriented programming language with features like classes and inheritance.
C is a procedural programming language, while C++ is a multi-paradigm language with support for object-oriented programming.
C does not support classes and objects, while C++ does.
C does not have features like inheritance and polymorphism, which are present in C++.
C is a subset of C++, meaning that C++ includes all of C's features and adds new ...read more
A virtual function is a function in a base class that is declared using the keyword 'virtual' and can be overridden by a function with the same signature in a derived class.
Virtual functions allow for dynamic polymorphism in C++
They are used in inheritance to achieve runtime polymorphism
Example: virtual void display() = 0; in a base class and void display() override in a derived class
Interview Process at Geeco Enercon
Top Software Developer Intern Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month