Capgemini Engineering
50+ Interview Questions and Answers
You have been given an integer array/list(ARR) of size 'N'. It only contains 0s, 1s and 2s. Write a solution to sort this array/list.
Note :
Try to solve the problem in 'Single ...read more
You are given an array of integers. You need to sort the array in ascending order using quick sort.
Quick sort is a divide and conquer algorithm in which we choose a pivot point and partition the arra...read more
You have given a Singly Linked List of integers, determine if it forms a cycle or not.
A cycle occurs when a node's next points back to a previous node in the list. The linked list is ...read more
For a given a string(str) and a character X, write a function to remove all the occurrences of X from the given string.
The input string will remain unchanged if...read more
You have given a Singly Linked List of integers, determine if it forms a cycle or not.
A cycle occurs when a node's next points back to a previous node in the list. The linked list i...read more
You are given a Singly Linked List of integers. You need to reverse the Linked List by changing the links between nodes.
Input Format :
The first line of input contains a single integer T, ...read more
Given a sequence of numbers ‘ARR’. Your task is to return a sorted sequence of ‘ARR’ in non-descending order with help of the merge sort algorithm.
Example :
Merge Sort Algorithm - Merge sort is a Div...read more
You have been given a Binary Tree of integers. You are supposed to return the level order traversal of the given tree.
For example:
For the given binary tree
The level orde...read more
Given a string “STR”, you need to remove spaces from the string “STR” and rewrite in the Pascal case. Your task is to return the string “STR”.
In the Pascal case writing style w...read more
You have been given a singly Linked List of 'N' nodes with integer data and an integer 'K'. Your task is to remove the Kth node from the end of the given Lin...read more
Write a program to find the factorial of a number.
Factorial of n is:
n! = n * (n-1) * (n-2) * (n-3)....* 1
Output the factorial of 'n'. If it does not exist, output 'Error'.
Input format :...read more
What are the real life examples of non deterministic automata?
Q13. What have you done on real implementation on linux OS?
I have implemented various software applications on Linux OS.
Developed a web application using Python Flask framework on Linux server
Created a custom Linux kernel module for a hardware device driver
Implemented a distributed system using Apache Kafka on Linux machines
Optimized performance of a database server running on Linux by tuning kernel parameters
Q14. What is microprocessor and explain register names?
A microprocessor is a computer processor that incorporates the functions of a central processing unit on a single integrated circuit.
Microprocessors are used in various electronic devices such as computers, smartphones, and gaming consoles.
Register names include program counter (PC), accumulator (ACC), general-purpose registers (GPR), and memory address register (MAR).
Registers are used to store data and instructions temporarily for processing.
The number of registers and thei...read more
Q15. What is difference between C and C++?
C++ is an extension of C with object-oriented programming features.
C++ supports object-oriented programming while C does not.
C++ has classes and templates while C does not.
C++ has better support for exception handling than C.
C++ has a standard library while C does not.
C++ allows function overloading while C does not.
Q16. What is difference between array and linked list?
Arrays are contiguous blocks of memory while linked lists are made up of nodes that point to the next node.
Arrays have fixed size while linked lists can grow dynamically.
Insertion and deletion are faster in linked lists than in arrays.
Arrays have better cache locality while linked lists have better memory utilization.
Arrays are accessed using indices while linked lists are accessed using pointers.
Examples of arrays include int[] and char[] while examples of linked lists inclu...read more
Q17. Explain whole process for Example.c file to Example.exe conversion
The process of converting Example.c file to Example.exe involves several steps.
Preprocessing: includes header file inclusion, macro expansion, and conditional compilation
Compilation: converts source code to object code
Linking: combines object code with libraries to create executable file
Debugging: identifying and fixing errors in code
Optimization: improving performance of executable file
Q18. What is data abstraction and explain with code?
Data abstraction is the process of hiding implementation details and showing only necessary information.
Abstraction is achieved through abstract classes and interfaces.
It helps in reducing complexity and increasing efficiency.
Example: abstract class Shape with abstract method draw() implemented by its subclasses like Circle and Rectangle.
What are local, global and static variables?
Q20. I am working on multiple language so how you are comfortable to work on multiple language
I am comfortable working with multiple languages and have experience in doing so.
I have experience working with languages such as Java, Python, C++, and JavaScript.
I am able to quickly adapt to new languages and learn them efficiently.
I understand the importance of proper documentation and commenting in code to ensure readability for others.
I have worked on projects that required integration of multiple languages, such as a web application with a backend in Python and a front...read more
What is the difference between page and frame?
What are near, far and huge pointers?
What are the types of access modifiers in Java?
How are Java objects stored in memory?
What are the time complexities for each sorting algorithms?
What is serial port and parallel port?
What are the types of polymorphism?
What is mutual exclusion?
Q30. Write a SQL query to join two tables?
SQL query to join two tables
Use JOIN keyword to combine two tables based on a common column
Specify the columns to be selected using SELECT keyword
Use ON keyword to specify the common column between two tables
Q31. WAP for recursion and explain its working?
Recursion is a technique where a function calls itself to solve a problem. WAP for recursion is to write a program using recursion.
Recursion is used to solve problems that can be broken down into smaller sub-problems.
The base case is the condition where the function stops calling itself.
The recursive case is where the function calls itself with a smaller input.
Example: Factorial of a number can be calculated using recursion.
Example: Fibonacci series can be generated using rec...read more
What is data abstraction?
Difference between Definition and Declaration
Q35. What is TCP/IP,OSI model?
TCP/IP is a protocol used for communication between devices on the internet. OSI model is a conceptual framework for network communication.
TCP/IP is a suite of protocols that governs communication between devices on the internet.
OSI model is a conceptual framework that divides network communication into seven layers.
TCP/IP is based on a four-layer model, which includes the application, transport, internet, and network access layers.
The OSI model includes the physical, data li...read more
Q36. What is program counter?
Program counter is a register that stores the memory address of the next instruction to be executed by the processor.
Program counter is also known as instruction pointer.
It is a part of the processor's control unit.
The value of program counter is incremented after each instruction is executed.
If a program counter is corrupted, the processor may execute incorrect instructions.
Example: If the program counter is pointing to memory address 100, the next instruction to be executed...read more
Difference between Mutex and Semaphore
Explain the different OSI Layers.
Q39. How to get unique elements from list
To get unique elements from a list, use set() function.
Convert the list to a set using set() function
Convert the set back to list using list() function
Example: list(set(['apple', 'banana', 'apple', 'orange'])) will return ['apple', 'banana', 'orange']
Q41. Explain SQL commands?
SQL commands are used to interact with databases and manipulate data.
SELECT: retrieve data from a database
INSERT: add new data to a database
UPDATE: modify existing data in a database
DELETE: remove data from a database
CREATE: create a new database or table
ALTER: modify the structure of a database or table
DROP: delete a database or table
JOIN: combine data from multiple tables
GROUP BY: group data based on a specific column
ORDER BY: sort data based on a specific column
Q42. How memory allocated to object
Memory is allocated to objects dynamically during runtime based on their size and type.
Memory allocation is done using the 'new' keyword in languages like Java and C++.
In languages like Python, memory allocation is handled automatically by the interpreter.
Memory allocation can also be done using functions like malloc() and calloc() in C.
Memory is released using the 'delete' keyword in languages like Java and C++.
Memory management is important to prevent memory leaks and optim...read more
Q43. WAP to reverse string?
A program to reverse a given string.
Create an empty string to store the reversed string.
Iterate through the original string from end to start.
Append each character to the empty string.
Return the reversed string.
Q44. Explain pointers and heap ?
Pointers are variables that store memory addresses. Heap is a region of memory used for dynamic memory allocation.
Pointers are used to access memory directly
Heap is used for dynamic memory allocation
Pointers can be used to create data structures like linked lists
Heap memory must be manually managed to avoid memory leaks
Q45. What is join and how many types.
Join is a SQL operation that combines rows from two or more tables based on a related column between them.
Join is used to retrieve data from multiple tables in a single query.
There are four types of joins: Inner Join, Left Join, Right Join, and Full Outer Join.
Inner Join returns only the matching rows from both tables.
Left Join returns all the rows from the left table and matching rows from the right table.
Right Join returns all the rows from the right table and matching rows...read more
Q46. find non repeating character in an array
Find the first non-repeating character in an array.
Use a hash table to store the frequency of each character.
Iterate through the array and check the frequency of each character.
Return the first character with a frequency of 1.
Q47. Comparable vs comparator
Comparable is an interface used for natural ordering while Comparator is an interface used for custom ordering.
Comparable is implemented by the class whose objects need to be sorted
Comparator is implemented by a separate class to define custom sorting logic
Comparable uses compareTo() method to compare objects
Comparator uses compare() method to compare objects
Example: String class implements Comparable interface for natural ordering
Example: Employee class implements Comparator...read more
Q48. Hash table implementation
Hash table is a data structure that maps keys to values using a hash function.
Hash function maps keys to indices in an array
Collisions can occur, which can be resolved using techniques like chaining or open addressing
Lookup, insertion, and deletion operations have an average time complexity of O(1)
Q49. what is destructing in JS
Destructuring is a way to extract values from objects and arrays into distinct variables.
Destructuring can be used with arrays and objects
It allows you to extract values from nested objects and arrays
You can also set default values for variables that may not exist in the object or array
Example: const {name, age} = {name: 'John', age: 30};
Example: const [first, second] = ['one', 'two'];
Q50. Explain about oops
Object-oriented programming paradigm that focuses on objects and classes for code organization and reusability.
Encapsulation: Bundling data and methods that operate on the data into a single unit (object)
Inheritance: Ability for a class to inherit properties and behavior from another class
Polymorphism: Ability for objects of different classes to respond to the same method call in different ways
Q51. Realtime examples
Realtime examples of software engineering concepts
Implementing a chat application with real-time messaging using WebSockets
Developing a stock trading platform with live updates on stock prices
Creating a multiplayer online game with real-time player interactions
Top HR Questions asked in null
Interview Process at null
Top Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month