Placement & HR

Cognizant Interview Questions for Freshers

Cognizant, headquartered in New Jersey, hires a large number of freshers in India through its GenC programmes, such as GenC, GenC Next and GenC Pro, each with a different assessment level. The process usually includes an online assessment followed by technical and HR interviews. These Cognizant interview questions cover Java, SQL and web basics, situational questions and the HR round, with model answers.

20 questions · Updated

Reading answers is not the same as saying them.Practise Cognizant questions out loud and get a score, what you missed and a model answer for each one.
Practise free with AI
Cognizant interview process: 1. Online assessment (Aptitude, reasoning and coding), 2. Technical interview (Programming, SQL and your project), 3. HR interview (Fit, relocation and documents), 4. Offer (GenC, GenC Next or GenC Pro).
The Cognizant interview process, step by step.

How to prepare for the Cognizant interview

Technical round

Programming, OOP, DBMS, operating systems and your project, the core of most Cognizant fresher interviews.

1. What is the difference between ArrayList and LinkedList in Java?

Answer flow · 3 steps
  1. ArrayList is backed by a resizable array, so getting an element by index is O(1), but inserting or removing in the middle is O(n) because elements shift.

  2. LinkedList is a doubly linked list, so adding or removing at the ends or at a known node is O(1), but accessing by index is O(n).

  3. ArrayList is the better default because it uses less memory and is faster for most workloads.

2. How does a HashMap work internally in Java?

Answer flow · 4 steps
  1. A HashMap stores entries in an array of buckets.

  2. The key's hashCode() decides the bucket; entries in the same bucket are stored in a linked list, which Java 8 converts to a balanced tree when a bucket grows large, so a lookup is O(1) on average. equals() finds the exact key within a bucket.

  3. When the number of entries passes the load factor (0.75 by default), the array doubles and entries are rehashed.

  4. It allows one null key and is not thread-safe; ConcurrentHashMap is.

3. Why are strings immutable in Java?

Answer flow · 3 steps
  1. Once a String is created, its value cannot change; methods like concat() return a new string.

  2. This makes strings safe to share between threads and to use as HashMap keys (their hash code never changes), allows the JVM to reuse literals from the string pool to save memory, and improves security because values such as file paths cannot be changed after checks.

  3. Use StringBuilder when building strings in a loop.

4. What is the difference between JDK, JRE and JVM?

Answer flow · 3 steps
  1. The JVM (Java Virtual Machine) runs compiled bytecode and handles memory management and garbage collection; it is what makes Java platform-independent.

  2. The JRE (Java Runtime Environment) contains the JVM plus the core libraries needed to run Java programs.

  3. The JDK (Java Development Kit) contains the JRE plus development tools such as the compiler (javac) and debugger, needed to write Java programs.

5. What is the difference between UNION and UNION ALL?

Answer flow · 4 steps
  1. Both combine the results of two SELECT queries with the same number and types of columns.

  2. UNION removes duplicate rows, which requires extra sorting or hashing work.

  3. UNION ALL keeps all rows, including duplicates, so it is faster.

  4. Use UNION ALL when you know there are no duplicates or want to keep them.

6. What is the difference between a subquery and a join?

Answer flow · 3 steps
  1. A join combines columns from multiple tables into one result based on a related column.

  2. A subquery is a query nested inside another, used to filter or compute values, such as finding employees whose salary is above the average.

  3. Many subqueries can be rewritten as joins, which are often faster because the optimiser handles them better, but subqueries can be easier to read.

7. Write a program to check whether a number is an Armstrong number.

An Armstrong number equals the sum of its digits each raised to the power of the number of digits, such as 153 = 1³ + 5³ + 3³. Count the digits, then add each digit raised to that power and compare with the original.

def is_armstrong(n):
    digits = str(n)
    power = len(digits)
    return n == sum(int(d) ** power for d in digits)

# is_armstrong(153) -> True, is_armstrong(123) -> False

8. Write a program to check whether two strings are anagrams.

Answer flow · 3 steps
  1. Two strings are anagrams if they contain the same characters with the same counts.

  2. Compare character counts with a hash map or Counter, which is O(n), or compare the sorted strings, which is O(n log n).

  3. Clarify whether case and spaces should be ignored.

from collections import Counter

def is_anagram(a, b):
    return Counter(a.replace(" ", "").lower()) == Counter(b.replace(" ", "").lower())

# is_anagram("Listen", "Silent") -> True

9. What is the difference between var, let and const in JavaScript?

var is function-scoped, can be redeclared and is hoisted with the value undefined, which can cause bugs. let is block-scoped and can be reassigned but not redeclared in the same scope. const is block-scoped and cannot be reassigned, although the contents of a const object or array can still change. Modern code uses const by default and let when a value must change.

10. What is responsive web design?

Answer flow · 3 steps
  1. Responsive design makes a website adapt to any screen size.

  2. It uses a viewport meta tag, flexible layouts with CSS Flexbox and Grid, relative units such as percentages and rem, responsive images, and media queries to change styles at different screen widths.

  3. A mobile-first approach designs for small screens first, then adds styles for larger screens.

Managerial round

Situations at work, attitude and flexibility. Sometimes combined with the technical or HR round.

11. What will you do if you cannot solve a technical problem at work?

Answer flow · 3 steps
  1. I would first spend a reasonable amount of time on it myself: read the error and logs, search documentation and forums, and try to isolate the problem.

  2. If I am still stuck, I would ask a senior with a clear summary of what I tried, so their time is used well.

  3. Asking too late wastes time, and asking too early stops you from learning.

12. How would you handle being assigned to a project in another city at short notice?

I would accept it professionally, plan the move quickly and ask HR about any relocation support. I understand that business needs change and that working in a new place is a good learning experience.

13. Your teammate is taking credit for your work. What will you do?

Answer flow · 3 steps
  1. I would stay calm and avoid confronting them publicly.

  2. I would talk to them privately first, as it may be a misunderstanding, and in future make my contributions visible through regular updates to the lead and clear commit history.

  3. If it continued, I would raise it with my manager with facts.

14. How do you ensure the quality of your code?

I follow coding standards, write meaningful names and small functions, write unit tests for my code, test edge cases, and review my own changes before raising a pull request. I also welcome code review feedback and use tools such as linters and static analysis.

15. Tell me about a time you worked under pressure.

Answer flow · 3 steps
  1. Use the STAR method.

  2. For example: "Two days before our project submission, our database crashed and we lost a week of test data.

  3. I wrote a script to regenerate it from our logs, while my teammates continued the report, and we submitted on time."

HR round

Questions about Cognizant, its hiring programmes, relocation, shifts and your plans.

16. Why do you want to join Cognizant?

Be specific: "Cognizant works with clients in banking, healthcare, retail and technology, and its GenC programme gives freshers structured training and clear career paths. It is also investing in AI, cloud and digital engineering, which are areas I want to build skills in."

17. What do you know about Cognizant?

Answer flow · 3 steps
  1. Cognizant Technology Solutions is an American IT services and consulting company headquartered in Teaneck, New Jersey.

  2. It started in 1994 as a technology unit of Dun & Bradstreet with a large development centre in Chennai, became independent and grew into one of the largest IT services companies, with most of its workforce in India.

  3. It serves industries such as banking, insurance, healthcare and life sciences.

18. What are the GenC, GenC Next and GenC Pro profiles?

Answer flow · 4 steps
  1. They are Cognizant's fresher hiring profiles.

  2. GenC is the main entry-level profile.

  3. GenC Next and higher profiles such as GenC Pro or GenC Elevate are for candidates who perform strongly in harder coding assessments, with more advanced roles and higher packages.

  4. Profiles and names change between drives, so check the current details when you apply.

19. Are you comfortable with night shifts and relocation?

Cognizant supports clients in many time zones and has offices across India. Answer clearly and honestly: "Yes, I am comfortable with both."

20. Do you have any questions for us?

Ask about training or growth: "What does the training for GenC freshers cover, and how are projects allocated after it?" This shows interest in performing well.

Ready to test yourself?Pick your topics and level, answer by voice or text, and get instant feedback. Free.
Start a mock interview

Related skill interview questions

HR round, company and bank interview questions

Bank and government exams

Interview questions by field

Company names are trademarks of their respective owners. Interview Ready is an independent practice site and is not affiliated with or endorsed by any company listed here.