i
Cognizant
Filter interviews by
JDK, JVM, and JRE are core components of Java, each serving distinct roles in the development and execution of Java applications.
JDK (Java Development Kit): A complete toolkit for Java development, including the compiler (javac), libraries, and tools for building Java applications.
JRE (Java Runtime Environment): Provides the libraries and components necessary to run Java applications, but does not include developm...
A palindrome is a word, phrase, or sequence that reads the same backward as forward, like 'madam' or 'racecar'.
Definition: A palindrome is a string that remains unchanged when reversed. Example: 'level', 'radar'.
Ignoring Spaces and Punctuation: When checking for palindromes, spaces and punctuation are often ignored. Example: 'A man, a plan, a canal, Panama!'
Case Sensitivity: Palindrome checks can be case insensiti...
Print each letter in a string along with the number of times it occurs
Iterate through the string and count the occurrences of each letter
Use a HashMap to store the letter as key and count as value
Print the letter and count for each unique letter
Data can be retrieved from a database in Spring Boot using JPA repositories or JDBC templates.
Use JPA repositories to create custom queries and retrieve data from the database.
Use JDBC templates to execute SQL queries and retrieve data from the database.
Configure the data source in the application.properties file.
Use annotations like @Repository, @Entity, @Table, etc. to map Java objects to database tables.
What people are saying about Cognizant
Static method is a method that belongs to the class itself, not to any specific instance of the class.
Static methods can be called without creating an instance of the class.
They are commonly used for utility methods that do not require access to instance variables.
Static methods are declared using the 'static' keyword.
Example: Math.max() is a static method in the Math class that returns the maximum of two numbers.
OOPs concepts are the fundamental principles of object-oriented programming.
Encapsulation: Hiding the implementation details of an object and exposing only the necessary information.
Inheritance: Creating new classes from existing ones, inheriting their properties and methods.
Polymorphism: The ability of objects to take on many forms, allowing them to behave differently in different situations.
Abstraction: Focusing...
To become a technical lead and contribute to the development of innovative solutions.
I aim to continuously improve my technical skills and knowledge.
I want to gain experience in leading a team and managing projects.
I aspire to work on challenging projects that require creative problem-solving.
I hope to make a positive impact on the company and its customers through my work.
Example: I want to lead a team in develop...
Immutable classes in Java cannot be modified after creation.
Use the final keyword to make class not extendable
Use private final fields to make class variables read-only
Do not provide setter methods
Use constructor to set initial values
If mutable objects are used, return copies instead of references
To sort an array list, use the Collections.sort() method.
Import the java.util.Collections class
Call the sort() method and pass the array list as parameter
Ensure the objects in the array list implement the Comparable interface or pass a Comparator object as second parameter
HashMap is a data structure that stores key-value pairs and uses hashing to retrieve values quickly.
HashMap uses hashing to store and retrieve values based on their keys.
It uses an array of buckets to store the key-value pairs.
The hash code of the key is used to determine the index of the bucket where the pair will be stored.
If two keys have the same hash code, they are stored in the same bucket as a linked list.
H...
I appeared for an interview in Nov 2024.
I appeared for an interview in Mar 2025, where I was asked the following questions.
I appeared for an interview in Feb 2025, where I was asked the following questions.
A palindrome is a word, phrase, or sequence that reads the same backward as forward, like 'madam' or 'racecar'.
Definition: A palindrome is a string that remains unchanged when reversed. Example: 'level', 'radar'.
Ignoring Spaces and Punctuation: When checking for palindromes, spaces and punctuation are often ignored. Example: 'A man, a plan, a canal, Panama!'
Case Sensitivity: Palindrome checks can be case insensitive. E...
The Fibonacci sequence is a series of numbers where each number is the sum of the two preceding ones, starting from 0 and 1.
Definition: The Fibonacci sequence starts with 0 and 1, and each subsequent number is the sum of the previous two (e.g., 0, 1, 1, 2, 3, 5, 8, ...).
Recursive Approach: A simple way to calculate Fibonacci numbers is using recursion, but it can be inefficient for large indices due to repeated calcula...
I appeared for an interview in Mar 2025, where I was asked the following questions.
I appeared for an interview in Jan 2025, where I was asked the following questions.
I appeared for an interview in Nov 2024, where I was asked the following questions.
Code optimization improves performance, reduces resource usage, and enhances maintainability in Java applications.
Use efficient algorithms: Choose algorithms with lower time complexity, e.g., use quicksort instead of bubble sort for large datasets.
Minimize object creation: Reuse objects when possible to reduce garbage collection overhead, e.g., use StringBuilder instead of concatenating strings.
Optimize loops: Avoid un...
I applied via Naukri.com and was interviewed in Dec 2023. There were 3 interview rounds.
1 round in fresher Java coding test
Second Java aptitude test
I applied via Naukri.com and was interviewed in Sep 2023. There were 2 interview rounds.
Idempotency is the property of an operation where multiple identical requests have the same effect as a single request.
Idempotency ensures that even if the same request is made multiple times, the result will be the same.
In RESTful APIs, using HTTP methods like GET and PUT can help achieve idempotency.
Design patterns like Command Pattern and State Pattern can be used to ensure idempotency in projects.
Some of the top questions asked at the Cognizant Java Developer interview -
The duration of Cognizant Java Developer interview process can vary, but typically it takes about less than 2 weeks to complete.
based on 32 interview experiences
Difficulty level
Duration
based on 161 reviews
Rating in categories
Hyderabad / Secunderabad,
Chennai
+15-10 Yrs
Not Disclosed
Associate
73k
salaries
| ₹5.3 L/yr - ₹12.5 L/yr |
Programmer Analyst
56.2k
salaries
| ₹3.5 L/yr - ₹7.3 L/yr |
Senior Associate
55.1k
salaries
| ₹9.7 L/yr - ₹23.4 L/yr |
Senior Processing Executive
29.8k
salaries
| ₹2.3 L/yr - ₹6.5 L/yr |
Technical Lead
19k
salaries
| ₹6 L/yr - ₹21 L/yr |
TCS
Infosys
Wipro
Accenture