i
Capgemini
Filter interviews by
Comparable is for natural ordering; Comparator is for custom ordering of objects in Java.
Comparable is an interface that defines a natural ordering for objects.
Comparator is an interface that defines a custom ordering for objects.
Comparable requires the class to implement the compareTo() method.
Comparator can be implemented in a separate class or as a lambda expression.
Example of Comparable: String implements Comp...
To find the second largest element in a list, iterate through the numbers while tracking the largest and second largest values.
Initialize two variables: 'largest' and 'secondLargest' to negative infinity.
Iterate through the list of numbers.
For each number, update 'largest' and 'secondLargest' accordingly.
Example: For the list [3, 1, 4, 4, 5], the second largest is 4.
Ensure to handle cases with duplicates and lists...
Decorators in Angular are functions that allow you to modify or extend the behavior of classes or methods.
Decorators are used to add metadata to classes or methods in Angular applications.
They are prefixed with @ symbol and are followed by the decorator name.
Common decorators in Angular include @Component, @Directive, @Injectable, @Input, @Output, etc.
Decorators can be used for various purposes such as defining co...
Failsafe integrators prioritize system stability by handling errors gracefully, while fail fast integrators prioritize quick detection and resolution of errors.
Failsafe integrators focus on ensuring the system continues to function even in the presence of errors.
Fail fast integrators aim to quickly identify and address errors to prevent further issues.
Failsafe integrators often use techniques like retries, circuit...
What people are saying about Capgemini
Find the second largest element from array of strings
Sort the array in descending order
Access the element at index 1 to get the second largest element
A palindrome program in Java checks if a given string is the same when read forwards and backwards.
Convert the string to lowercase to ignore case sensitivity.
Use two pointers, one starting from the beginning and the other from the end of the string.
Compare the characters at the two pointers, moving them towards the center until they meet or cross each other.
If at any point the characters are not equal, the string ...
Creating a table named 'questions' in MySQL.
Use the CREATE TABLE statement to create the table.
Specify the table name, column names, and their data types.
Set primary key, foreign key, and other constraints if required.
Add any additional properties like auto-increment, default values, etc.
Execute the SQL statement to create the table.
OOPs concept in Java is a programming paradigm that focuses on objects and their interactions.
OOPs stands for Object-Oriented Programming.
It involves the use of classes, objects, inheritance, polymorphism, and encapsulation.
Classes are blueprints for creating objects, and objects are instances of classes.
Inheritance allows classes to inherit properties and behaviors from other classes.
Polymorphism allows objects o...
I applied via Recruitment Consulltant and was interviewed in Sep 2024. There were 2 interview rounds.
Find the second largest element from array of strings
Sort the array in descending order
Access the element at index 1 to get the second largest element
Failsafe integrators prioritize system stability by handling errors gracefully, while fail fast integrators prioritize quick detection and resolution of errors.
Failsafe integrators focus on ensuring the system continues to function even in the presence of errors.
Fail fast integrators aim to quickly identify and address errors to prevent further issues.
Failsafe integrators often use techniques like retries, circuit brea...
I appeared for an interview in Mar 2025, where I was asked the following questions.
Comparable is for natural ordering; Comparator is for custom ordering of objects in Java.
Comparable is an interface that defines a natural ordering for objects.
Comparator is an interface that defines a custom ordering for objects.
Comparable requires the class to implement the compareTo() method.
Comparator can be implemented in a separate class or as a lambda expression.
Example of Comparable: String implements Comparabl...
To find the second largest element in a list, iterate through the numbers while tracking the largest and second largest values.
Initialize two variables: 'largest' and 'secondLargest' to negative infinity.
Iterate through the list of numbers.
For each number, update 'largest' and 'secondLargest' accordingly.
Example: For the list [3, 1, 4, 4, 5], the second largest is 4.
Ensure to handle cases with duplicates and lists with...
Decorators in Angular are functions that allow you to modify or extend the behavior of classes or methods.
Decorators are used to add metadata to classes or methods in Angular applications.
They are prefixed with @ symbol and are followed by the decorator name.
Common decorators in Angular include @Component, @Directive, @Injectable, @Input, @Output, etc.
Decorators can be used for various purposes such as defining compone...
I applied via Company Website and was interviewed in Aug 2023. There was 1 interview round.
OOPs concept in Java is a programming paradigm that focuses on objects and their interactions.
OOPs stands for Object-Oriented Programming.
It involves the use of classes, objects, inheritance, polymorphism, and encapsulation.
Classes are blueprints for creating objects, and objects are instances of classes.
Inheritance allows classes to inherit properties and behaviors from other classes.
Polymorphism allows objects of dif...
A palindrome program in Java checks if a given string is the same when read forwards and backwards.
Convert the string to lowercase to ignore case sensitivity.
Use two pointers, one starting from the beginning and the other from the end of the string.
Compare the characters at the two pointers, moving them towards the center until they meet or cross each other.
If at any point the characters are not equal, the string is no...
Creating a table named 'questions' in MySQL.
Use the CREATE TABLE statement to create the table.
Specify the table name, column names, and their data types.
Set primary key, foreign key, and other constraints if required.
Add any additional properties like auto-increment, default values, etc.
Execute the SQL statement to create the table.
I applied via Approached by Company and was interviewed in Feb 2024. There was 1 interview round.
I applied via Approached by company and was interviewed in Dec 2021. There were 2 interview rounds.
I appeared for an interview in Feb 2022.
I applied via Company Website and was interviewed before May 2022. There were 3 interview rounds.
General aptitude, logical reasoning, english and Pseudocodes
posted on 15 Feb 2022
1)Driffience between Abstract class &
Interface.
-abstract class
represents property
&
behaviour of an object
whereas
interface
represents
behaviour
of an object.
2)Driffience between equal() vs ==operator.
equal() is
an object class method
whereas
equal() of string class
override
the object class equal().
3)can we use pointer's in Java.
Not explicitly but implicitly we can use pointer's in java.
Dynamic m/m refers with help of pointer's but java does not support the pointer's.
when we r creating an object in java refrence varaible of an object holds the identity that is nothing but an implicit pointer that holds an unique identity of an object.
4)How we can print object ID.
-Object ID printed with help of object class which is a service provider class having 9().
5)what is object class.
-it is a super class of all predefined & userdefined class.
6)Write a prog to get name of main thread in java.
-class A
{
psvm(String args [])
{
s.o.pln(Thread.currentThread().getName());
}
}
7)length vs length()
-length
is
data menmber
of proxy class
whereas
length() is a string class().
JVM is an abstract machine that executes Java bytecode.
JVM stands for Java Virtual Machine.
It is responsible for interpreting and executing Java bytecode.
JVM provides platform independence to Java programs.
It has its own memory management system and garbage collector.
JVM can be implemented on different operating systems.
Examples of JVM languages include Java, Kotlin, and Scala.
Multithreading is a programming technique that allows concurrent execution of two or more threads for improved performance.
Multithreading enables parallel execution, improving application responsiveness.
Each thread runs independently, sharing the same memory space, which can lead to resource contention.
Java provides built-in support for multithreading through the Thread class and Runnable interface.
Example: A web serve...
I applied via Approached by Company and was interviewed in Jan 2022. There were 2 interview rounds.
Online hackerrank test on Angular and Java
based on 6 interview experiences
Difficulty level
Duration
based on 6 reviews
Rating in categories
Consultant
58.6k
salaries
| ₹5.3 L/yr - ₹19 L/yr |
Associate Consultant
51.2k
salaries
| ₹4.5 L/yr - ₹10 L/yr |
Senior Consultant
50k
salaries
| ₹7.8 L/yr - ₹26 L/yr |
Senior Analyst
22.1k
salaries
| ₹1.6 L/yr - ₹9.1 L/yr |
Senior Software Engineer
21.5k
salaries
| ₹3.5 L/yr - ₹13.5 L/yr |
Wipro
Accenture
Cognizant
TCS