Indiamart Intermesh
10+ EGC Global Services Interview Questions and Answers
Q1. Prime Numbers within a Range
Given an integer N, determine and print all the prime numbers between 2 and N, inclusive.
Input:
Integer N
Output:
Prime numbers printed on separate lines
Example:
Input:
N = 10
Out...read more
Q2. Queue Using Stacks Implementation
Design a queue data structure following the FIFO (First In First Out) principle using only stack instances.
Explanation:
Your task is to complete predefined functions to suppor...read more
Q3. Swap Kth Elements in an Array
Given an array ARR
of size N
, perform the operation to swap the Kth element from the beginning with the Kth element from the end of the array.
Example:
Input:
N = 5, K = 2
ARR = [1,...read more
Q4. Find All Pairs Adding Up to Target
Given an array of integers ARR
of length N
and an integer Target
, your task is to return all pairs of elements such that they add up to the Target
.
Input:
The first line conta...read more
Q5. Print All Permutations of a String
Given an input string STR
, generate and print all possible permutations of the string.
Input:
str
Output:
All permutations of the input string, each on a new line.
Example:
In...read more
Q6. Find Duplicates in an Array Problem Statement
You are provided with an array/list ARR
of size 'N', containing integers ranging from 0 to N - 1. Some elements in this array might be repeating. Your task is to id...read more
Q7. Why java is known as platform independent language?
Java is platform independent because it uses the concept of bytecode and virtual machine.
Java code is compiled into bytecode, which is a platform-independent representation of the code.
The bytecode is then executed by the Java Virtual Machine (JVM), which is specific to each platform.
This allows Java programs to run on any platform that has a compatible JVM.
The JVM acts as an interpreter, translating the bytecode into machine code that can be executed by the underlying hardwa...read more
Q8. What are fundamental pillars of OOPS programming. Explain each of them in detail.
The fundamental pillars of OOPS programming are encapsulation, inheritance, and polymorphism.
Encapsulation: It is the process of hiding the internal details of an object and providing a public interface for interacting with it.
Inheritance: It allows creating new classes by inheriting properties and behaviors from existing classes, promoting code reuse.
Polymorphism: It enables objects of different classes to be treated as objects of a common superclass, providing flexibility a...read more
Q9. Given a list of custom class objects. Write a program to sort that list based on one of its properties.
Sort a list of custom class objects based on one of its properties.
Use a sorting algorithm like bubble sort, insertion sort, or merge sort.
Implement a comparison function to compare the desired property of the objects.
Apply the sorting algorithm to the list of objects using the comparison function.
Q11. Write a SQL query to print number of rows in a table.
A SQL query to count the number of rows in a table.
Use the COUNT() function in SQL to count the number of rows in a table.
Specify the table name in the FROM clause.
Use the result of the COUNT() function to print the number of rows.
Q12. What is exception handling. How to implement it?
Exception handling is a mechanism to handle runtime errors and prevent program crashes.
Exception handling is used to catch and handle errors that occur during program execution.
It involves the use of try-catch blocks to catch exceptions and handle them gracefully.
The try block contains the code that might throw an exception, and the catch block handles the exception.
Multiple catch blocks can be used to handle different types of exceptions.
Finally block can be used to execute ...read more
Q15. Difference between i++ and ++i through implementation.
i++ and ++i are both increment operators in C++ but have different behaviors.
i++ is a post-increment operator which increments the value of i after using it in an expression.
++i is a pre-increment operator which increments the value of i before using it in an expression.
Example: int i = 5; int a = i++; // a = 5, i = 6; int b = ++i; // b = 7, i = 7;
Q16. Application of stack in real life.
Stacks are used in real life for managing undo operations in text editors, backtracking in maze solving, and managing function calls in programming.
Undo operations in text editors - allows users to go back to previous states of a document
Backtracking in maze solving - helps in keeping track of visited paths and backtracking when necessary
Managing function calls in programming - helps in keeping track of function calls and returning to previous functions
Top HR Questions asked in EGC Global Services
Interview Process at EGC Global Services
Top Associate Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month