i
Cognizant
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by
I appeared for an interview in Nov 2024.
A program to check if a given number is prime or not.
Create a function to check if a number is prime by iterating from 2 to the square root of the number.
If the number is divisible by any number other than 1 and itself, it is not prime.
Handle edge cases like 0, 1, and negative numbers separately.
To find the 3rd highest salary employee, we can use a SQL query with the 'LIMIT' and 'OFFSET' keywords.
Use a SQL query to select distinct salaries in descending order
Use 'LIMIT 1 OFFSET 2' to get the 3rd highest salary
Join this result with the employee table to get the employee details
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
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.
What people are saying about Cognizant
I applied via Naukri.com and was interviewed in Sep 2023. There were 2 interview rounds.
To make a class immutable in Java, you can follow certain guidelines to ensure that its state cannot be changed once it is created.
Make the class final so that it cannot be extended.
Make all fields private and final to prevent modification.
Do not provide setter methods for the fields.
If the fields are mutable objects, return copies of them instead of the original objects in getter methods.
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.
Cognizant interview questions for designations
I applied via Naukri.com
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
Get interview-ready with Top Cognizant Interview Questions
Java Developer interview questions covering array list, linkedlist, hashmap, synchronization, abstract vs interface, singleton class, Spring framework, database configuration, and Java 8 features.
ArrayList and LinkedList differ in terms of implementation, performance, and usage
HashMap uses hashing to store and retrieve key-value pairs
Synchronized is used to ensure thread safety and prevent race conditions
Abstract class...
This interview question covers various topics including programming, design patterns, data structures, and exception handling in Java.
Write a program to generate the Fibonacci series
Write a program using boolean variables
Explain the ClassCastException and how to handle it
Discuss the Singleton design pattern and its implementation with different JDK versions
Explain abstract classes and interfaces in your current project
...
I applied via Recruitment Consultant and was interviewed in Nov 2020. There were 3 interview rounds.
Some of the top questions asked at the Cognizant Java Developer interview for experienced candidates -
The duration of Cognizant Java Developer interview process can vary, but typically it takes about less than 2 weeks to complete.
based on 4 interviews
1 Interview rounds
based on 151 reviews
Rating in categories
Hyderabad / Secunderabad,
Bangalore Rural
+15-10 Yrs
Not Disclosed
Associate
72.4k
salaries
| ₹5.1 L/yr - ₹16 L/yr |
Programmer Analyst
55.6k
salaries
| ₹2.4 L/yr - ₹9.3 L/yr |
Senior Associate
50.3k
salaries
| ₹9 L/yr - ₹28.6 L/yr |
Senior Processing Executive
29.1k
salaries
| ₹1.8 L/yr - ₹9.2 L/yr |
Technical Lead
17.7k
salaries
| ₹6 L/yr - ₹25 L/yr |
TCS
Infosys
Wipro
Accenture