Airtel Africa
Capgemini Interview Questions and Answers
Q1. Find index of an element in a sorted, n-bit rotated array.
Finding index of an element in a sorted, n-bit rotated array.
Use binary search to find the pivot point where the array is rotated.
Determine which side of the pivot point the target element lies.
Perform binary search on the appropriate side of the pivot to find the target element.
Handle edge cases such as when the target element is the pivot point itself.
Q2. Build a single sorted linked list from two sorted linked list without using auxiliary space
Merge two sorted linked lists without using extra space
Traverse both lists simultaneously and compare nodes
Attach smaller node to result list and move pointer to next node
Repeat until both lists are exhausted
Return the head of the merged list
Q3. Find the first character with least occurrence in a string
Find the first character with least occurrence in a string
Iterate through the string and count the occurrence of each character
Find the character with the least occurrence
Return the first occurrence of that character
Q4. Meaning of dependency injection and inversion of control
Dependency injection is a design pattern that allows objects to receive dependencies from external sources, while inversion of control is a principle that states that the control of object creation and lifecycle should be handed over to a container or framework.
Dependency injection is a way to achieve loose coupling between objects
Inversion of control is a principle that promotes decoupling of components
Dependency injection is often used in conjunction with inversion of contr...read more
Q5. Difference between @Service, @Repository, @Component, @Controller
Annotations used in Spring Framework for different layers of application
All are used for dependency injection and component scanning
@Service is used for service layer
@Repository is used for data access layer
@Component is used for general purpose beans
@Controller is used for MVC controller layer
Q6. Difference between @Controller, @RestController
Difference between @Controller and @RestController
Both are used for handling HTTP requests in Spring framework
@Controller returns a view while @RestController returns data in JSON/XML format
@RestController is a combination of @Controller and @ResponseBody annotations
Use @Controller for traditional web applications and @RestController for RESTful web services
Q7. Difference between @Bean, @Component
Both @Bean and @Component are used for creating beans in Spring framework.
The @Bean annotation is used to explicitly declare a single bean.
The @Component annotation is used to declare a class as a Spring component.
The @Bean method is used in a configuration class to create and configure a bean.
The @Component annotation is used on a class to indicate that it is a Spring-managed component.
The @Bean method can be used to create a bean of any class, not just the one in which it i...read more
Q8. Clock angle problem, number to words
Clock angle problem and number to words are common coding problems.
Clock angle problem involves finding the angle between the hour and minute hand of a clock at a given time.
Number to words involves converting a given number into its word representation.
Both problems require logical thinking and can be solved using various approaches.
Clock angle problem can be solved using simple mathematical formulas while number to words can be solved using recursion or lookup tables.
Interview Process at Capgemini
Top Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month