Capgemini
10+ Capgemini Interview Questions and Answers
Q1. why react is faster, default parameters, can you call async function in useEffect
React is faster due to virtual DOM, default parameters provide fallback values, async functions can be called in useEffect
React is faster than traditional DOM manipulation because it uses a virtual DOM to minimize actual DOM updates
Default parameters in JavaScript allow you to specify default values for function parameters if no value is provided
Async functions can be called in useEffect hook in React to perform asynchronous operations within a functional component
Q2. What is sub flow in mule?
Sub flow in Mule is a reusable flow that can be called from other flows.
Sub flow is a separate flow that can be called from other flows
It helps in reusing the same logic in multiple flows
Sub flow can have its own set of input and output parameters
It can be used to encapsulate complex logic and make the main flow more readable
Example: A sub flow for database connection that can be called from multiple flows
Q3. What are the Design patterns have you used?
I have used design patterns such as Singleton, Factory, and Observer in my projects.
Singleton pattern ensures a class has only one instance and provides a global point of access to it.
Factory pattern creates objects without specifying the exact class of object that will be created.
Observer pattern defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
Q4. How do you write custom exception?
Custom exceptions can be written by creating a new class that extends the Exception class.
Create a new class that extends the Exception class
Add a constructor to the custom exception class
Throw the custom exception using 'throw new CustomException(message)'
Q5. Difference between throw , throws and throwable ?
throw is a keyword used to throw an exception, throws is used in method signature to declare exceptions thrown, and Throwable is a superclass for all exceptions and errors.
throw is used to throw an exception in a try-catch block
throws is used in method signature to declare exceptions that the method can throw
Throwable is a superclass for all exceptions and errors in Java
Q6. what is loop? what is inheritance?
A loop is a programming construct that repeats a set of instructions until a specific condition is met. Inheritance is a mechanism in object-oriented programming where a new class inherits properties and behaviors from an existing class.
A loop allows a set of instructions to be executed repeatedly based on a condition. Examples include for loops, while loops, and do-while loops.
Inheritance allows a new class (subclass) to inherit properties and behaviors from an existing clas...read more
Q7. What is cursor and explain wd eg
A cursor is a database object used to retrieve data from a result set one row at a time.
Cursor is used in SQL to fetch and manipulate data row by row
Examples of cursor include FETCH, OPEN, CLOSE, and DECLARE
Cursor is often used in stored procedures and triggers
Q8. What is oracle database structure?
Oracle database structure refers to the organization of data in tables, indexes, views, and other database objects.
Consists of tables, which store data in rows and columns
Includes indexes for faster data retrieval
Views provide virtual representations of data from one or more tables
Constraints ensure data integrity and enforce rules
Stored procedures and functions for processing data
Q9. What is a choice router?
A choice router is a device or software that directs incoming data packets to the appropriate destination based on predefined rules or user preferences.
A choice router is used in computer networks to manage and control the flow of data.
It examines the header information of incoming packets to determine the best path for forwarding the data.
Choice routers can be hardware devices or software programs.
They can be configured to prioritize certain types of traffic or apply specifi...read more
Q10. Internal structure of collections
Internal structure of collections refers to the organization and arrangement of data within a collection.
Collections can be organized using various data structures such as arrays, linked lists, trees, and hash tables.
The choice of data structure depends on the type of data being stored and the operations that need to be performed on the collection.
For example, an array is a good choice for collections with fixed size and random access, while a linked list is better for collec...read more
Q11. What are materialised views
Materialized views are precomputed views stored on disk for faster query performance.
Materialized views store the results of a query on disk so that the query can be run faster in the future.
They are updated periodically to reflect changes in the underlying data.
Materialized views are commonly used in data warehousing and reporting applications.
Examples of materialized views include summary tables, aggregated data, and complex joins.
Q12. What is partition?
Partition is the division of a physical or logical structure into multiple parts.
Partitioning helps in organizing data, improving performance, and increasing efficiency.
Examples include disk partitioning in a computer system, partitioning of a database table for better management, and partitioning of a hard drive for separate storage areas.
Q13. Internal working of hashmap
HashMap is a data structure that stores key-value pairs and uses hashing to quickly retrieve values based on keys.
HashMap internally uses an array of linked lists to store key-value pairs.
When a key-value pair is added, the key is hashed to determine the index in the array where it will be stored.
If multiple keys hash to the same index, a linked list is used to handle collisions.
HashMap uses the hashCode() method of keys to calculate the hash value.
HashMap allows null keys an...read more
Q14. Feature of micro services
Microservices are a software development technique that structures an application as a collection of loosely coupled services.
Each service is self-contained and can be developed, deployed, and scaled independently
Promotes flexibility, scalability, and resilience in software development
Allows for different technologies to be used for different services
Enables teams to work on different services simultaneously
Facilitates easier maintenance and updates
Q15. Write a java program
Java program to print 'Hello, World!'
Create a class with a main method
Use System.out.println() to print the message
Compile and run the program
Q16. 1. Polymorphism in Java
Polymorphism in Java allows objects of different classes to be treated as objects of a common superclass.
Polymorphism allows methods to be called on objects of different classes that share a common superclass.
There are two types of polymorphism in Java: compile-time polymorphism (method overloading) and runtime polymorphism (method overriding).
Example of runtime polymorphism is when a subclass overrides a method of its superclass.
Polymorphism helps in achieving flexibility an...read more
More about working at Capgemini
Top HR Questions asked in Capgemini
Interview Process at Capgemini
Top Consultant Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month