131 questions Β· from 12 interviews Β· 3 asked more than once

Cognizant interview questions

Every question candidates reported from their Cognizant interviews, most frequently asked first. Each links to the write-up it came from, so you can see the round and how it went.

Cognizant coding and DSA questions

  1. 01

    Reverse a String

    Implement a function to reverse a given string. I was initially asked to use StringBuilder and then to re-implement it using a loop to demonstrate logical clarity.

    Easy Β· Asked 2 times Β· From πŸ’» Cognizant GenC Next – 2nd Technical Interview Experience (5 Nov 2025) πŸš€

  2. 02

    Kth Largest Element

    Given an unsorted array, find the Kth largest element. The interview asked me to discuss possible approaches and to implement two of them. I mentioned four approaches: Brute Force, Sorting, Min Heap, and Quickselect, and I coded the Sorting and Min Heap…

    Medium Β· From Got placed in Cognizant as a Associate Software Engineer Trainee(campus-placement)

  3. 03

    Rotate Array by K Positions

    Rotate an Array by K Positions(Left and Right) πŸ‘‰ Input: [1,2,3,4,5], k = 2 πŸ‘‰ Output: [4,5,1,2,3]

    From Interview Experience with Cognizant

  4. 04

    Find Second Largest Element in Array

    Find the second largest element in a given array.

    From Interview Experience – Cognizant | On-Campus

  5. 05

    Palindrome Checker

    I was asked to write a simple palindrome checker function for a given string.

    Easy Β· From Cognizant GenC Interview Experience

  6. 06

    Prime Number Checker

    Next, they asked for code to check if a given integer is a prime number.

    Easy Β· From Cognizant GenC Interview Experience

  7. 07

    Find Second Largest Salary in SQL without LIMIT

    They asked for a SQL query to fetch the 2nd largest salary from an 'employees' table without using the LIMIT clause.

    Medium Β· From Cognizant GenC Interview Experience

  8. 08

    Water Jug Puzzle: Measure 4 Litres

    This was a classic puzzle: measure exactly 4 litres of water using only a 3-litre jug and a 5-litre jug.

    Medium Β· From Cognizant GenC Interview Experience

  9. 09

    Remove Special Characters from a String

    Write a program to remove special characters from a string, where the input string is taken from the user.

    Easy Β· From πŸ’» Cognizant GenC Next – 2nd Technical Interview Experience (5 Nov 2025) πŸš€

  10. 10

    Find Max Consecutive Ones

    I was asked to solve the problem to find the maximum number of consecutive 1s in a binary array.

    Easy Β· From πŸ§‘β€πŸ’» Cognizant GenC / GenC Pro/ GenC Next Interview Experience (Nov 2025)

  11. 11

    Find Sum of Same Consecutive Numbers that occur k times

    I was given a coding question to find the sum of numbers that appear consecutively 'k' times in a sequence.

    Medium Β· From πŸ§‘β€πŸ’» Cognizant GenC / GenC Pro/ GenC Next Interview Experience (Nov 2025)

  12. 12

    Longest Word in a String with Specific Characters

    During my technical interview, I received a coding question to find the length of the longest word in a given string. As a follow-up, I also had to print all words that had this maximum length. The interviewer also asked me to consider handling spaces and…

    Easy Β· From πŸ§‘β€πŸ’» Cognizant GenC / GenC Pro/ GenC Next Interview Experience (Nov 2025)

  13. 13

    SQL Query for 2nd Highest Salary

    I was asked to write an SQL query to find the 2nd highest salary from an employee table.

    Easy Β· From πŸ§‘β€πŸ’» Cognizant GenC / GenC Pro/ GenC Next Interview Experience (Nov 2025)

  14. 14

    HashMap Internal Implementation

    Explain what a HashMap is and describe its internal working and implementation details in Java.

    From Cognizant (CTS) Interview Experience – 2025 (IT Branch)

  15. 15

    Set vs. List Data Structures

    Define what a Set is and explain the key differences between List and Set data structures.

    From Cognizant (CTS) Interview Experience – 2025 (IT Branch)

  16. 16

    Merge Two Maps

    Given two maps, write code to merge them into a single map. Handle potential key conflicts.

    Easy Β· From Cognizant (CTS) Interview Experience – 2025 (IT Branch)

  17. 17

    Find Duplicate Numbers in Array

    From an array, print the numbers which have duplicate values.

    From Cognizant GenC Interview Experience 2025

  18. 18

    Create SQL Table

    Create a table with the attributes the interviewer gave.

    From Cognizant GenC Interview Experience 2025

  19. 19

    Write an SQL Update Query

    Write an SQL Update Query.

    From Cognizant GenC Interview Experience 2025

  20. 20

    Write an SQL Delete Query

    Write an SQL Delete Query.

    From Cognizant GenC Interview Experience 2025

  21. 21

    Explain SQL JOINs (Left, Right)

    Explain JOINS, Left Join, Right Join.

    From Cognizant GenC Interview Experience 2025

  22. 22

    Implement Array Sorting Algorithm

    Write a sorting algorithm (whichever method you want) on an array.

    From Cognizant GenC Interview Experience 2025

  23. 23

    Explain SQL DROP and TRUNCATE

    Explain the difference and use of DROP and TRUNCATE in SQL.

    From Cognizant GenC Interview Experience 2025

  24. 24

    Transpose Matrix

    Given a matrix, write a function to return its transpose. I was asked to solve this during the final interview and successfully did so in C++.

    From Cognizant GenC Interview Experience (On campus) 2025

  25. 25

    Compare Leaf Node Sequences of Two Trees (Reverse Second)

    There is teacher in a school who have it's 2 favourite childrens. Both her students made a binary tree from same numbers but in diffrent format. The task for teacher is to view 1st student's tree from behind moving from left - right and noted down the numbers…

    From Cognizant 2025 On Campus Hiring || Asked 2 Questions from Trees

7 more in the Cognizant write-ups.

Cognizant system design questions

  1. 01

    Project-Specific System Design Discussion

    They asked several system design questions related to my personal project, covering its architecture, API handling, database schema, scalability, error handling, logging, user capacity, and security measures.

    Hard Β· From Cognizant GenC Interview Experience

Cognizant behavioural and HR questions

  1. 01

    Background about Hometown

    Tell me about the city you belong to and provide details about it.

    From Cognizant (CTS) Interview Experience – 2025 (IT Branch)

  2. 02

    Willingness to Relocate

    Are you willing to relocate for this role?

    From Cognizant (CTS) Interview Experience – 2025 (IT Branch)

  3. 03

    Comfort with Shifts

    Are you comfortable working in different shifts?

    From Cognizant (CTS) Interview Experience – 2025 (IT Branch)

  4. 04

    Adaptability to New Technologies

    If new programming languages emerge in the future, will you be able to learn them and adapt?

    From Cognizant (CTS) Interview Experience – 2025 (IT Branch)

  5. 05

    SQL Self-Rating

    What would you rate yourself on a scale of 1-5 on your SQL skills?

    From Cognizant GenC Interview Experience 2025

  6. 06

    Relocation Willingness

    Would you be able to relocate?

    From Cognizant GenC Interview Experience 2025

  7. 07

    Language Flexibility

    If in future, you are given to work on any other lang except for Java, are you open to it?

    From Cognizant GenC Interview Experience 2025

  8. 08

    Shift Flexibility

    Can you work in shifts that are not basic?

    From Cognizant GenC Interview Experience 2025

  9. 09

    Candidate Questions for Interviewer

    Any questions for me?

    From Cognizant GenC Interview Experience 2025

  10. 10

    Behavioral: What did you hate most?

    The interviewer asked me: 'What did you hate most?' as a behavioral question.

    From Cognizant GenC Interview Experience (On campus) 2025

  11. 11

    Behavioral: Family Background

    The interviewer inquired about my family background.

    From Cognizant GenC Interview Experience (On campus) 2025

  12. 12

    Behavioral: Opinion on Class Toppers

    The interviewer asked: 'What do you think about toppers of your class?'

    From Cognizant GenC Interview Experience (On campus) 2025

  13. 13

    Behavioral: Relocation

    The interviewer asked some common questions regarding relocation.

    From Cognizant GenC Interview Experience (On campus) 2025

  14. 14

    Tell me about yourself.

    Introduce yourself and talk about your background and experiences.

    From My Cognizant GenC Interview Experience 2024-2025

  15. 15

    Why should we hire you?

    Explain why you are the best candidate for this role and company.

    From My Cognizant GenC Interview Experience 2024-2025

  16. 16

    Why do you want to join Cognizant?

    Articulate your reasons for wanting to work specifically at Cognizant.

    From My Cognizant GenC Interview Experience 2024-2025

  17. 17

    Where do you see yourself in the next 5 years?

    Describe your career aspirations and how they align with this role and company.

    From My Cognizant GenC Interview Experience 2024-2025

  18. 18

    Are you willing to relocate if required?

    Confirm your flexibility and willingness to relocate for the job.

    From My Cognizant GenC Interview Experience 2024-2025

  19. 19

    Are you a team player?

    Discuss your experience and approach to working effectively in a team.

    From My Cognizant GenC Interview Experience 2024-2025

  20. 20

    What are your strengths and weaknesses?

    Share your professional strengths and areas for improvement, along with how you address weaknesses.

    From My Cognizant GenC Interview Experience 2024-2025

  21. 21

    Handling Irrelevant Projects

    What if we assign you a project that is not relevant to your skills?

    From My Cognizant GenC Interview Experience 2024-2025

  22. 22

    Project Discussion

    Explain your projects in detail.

    From My Cognizant GenC Interview Experience 2024-2025

  23. 23

    Self-Introduction

    Introduce yourself, including your background, education, and interests relevant to the role.

    From Cognizant GenC Interview Experience (On-Campus 2023)

  24. 24

    Discuss Projects and Internships

    Detail your past projects and internship experiences, highlighting your contributions and the technologies used.

    From Cognizant GenC Interview Experience (On-Campus 2023)

  25. 25

    Willingness for Night Shifts

    Are you willing to work in night shifts if required?

    From Cognizant GenC Interview Experience (On-Campus 2023)

3 more in the Cognizant write-ups.

Cognizant other questions

  1. 01

    Types of SQL Joins

    The interviewer asked me to explain all types of Joins available in SQL.

    Asked 2 times Β· From πŸ§‘β€πŸ’» Cognizant GenC / GenC Pro/ GenC Next Interview Experience (Nov 2025)

  2. 02

    Method Overloading vs. Overriding

    Explain the differences between method overloading and method overriding in object-oriented programming.

    Asked 2 times Β· From Cognizant (CTS) Interview Experience – 2025 (IT Branch)

  3. 03

    Difference Between Abstract Class and Interface

    The interviewer began by testing my object-oriented concepts, asking for the differences between Abstract Classes and Interfaces.

    From Cognizant GenC Interview Experience

  4. 04

    JUnit Unit Testing Concepts

    They asked basic questions regarding JUnit, including 'What is JUnit?', 'Why do we use unit testing?', 'What is an annotation?', and 'Difference between @Before, @After, @Test'.

    From Cognizant GenC Interview Experience

  5. 05

    SQL DDL, DML, TCL Commands

    I was asked to list and explain examples of DDL (Data Definition Language), DML (Data Manipulation Language), and TCL (Transaction Control Language) commands in SQL.

    From Cognizant GenC Interview Experience

  6. 06

    Explain OOPs Concepts

    Explain the core concepts of Object-Oriented Programming (OOPs) with real-world examples.

    From πŸ’» Cognizant GenC Next – 2nd Technical Interview Experience (5 Nov 2025) πŸš€

  7. 07

    Constructors and Overloading

    Discuss constructors in Java and explain if they can be overloaded.

    From πŸ’» Cognizant GenC Next – 2nd Technical Interview Experience (5 Nov 2025) πŸš€

  8. 08

    Java Collections Framework Overview

    Provide an overview of the Java Collections Framework and discuss its common use cases.

    From πŸ’» Cognizant GenC Next – 2nd Technical Interview Experience (5 Nov 2025) πŸš€

  9. 09

    HashMap Working and Use Cases

    Explain the basic working mechanism of a HashMap and provide scenarios for when to use it.

    From πŸ’» Cognizant GenC Next – 2nd Technical Interview Experience (5 Nov 2025) πŸš€

  10. 10

    ArrayList vs LinkedList Performance

    Describe the performance differences between ArrayList and LinkedList in Java.

    From πŸ’» Cognizant GenC Next – 2nd Technical Interview Experience (5 Nov 2025) πŸš€

  11. 11

    Wrapper Classes in Java

    Define what Wrapper Classes are in Java and explain their usefulness.

    From πŸ’» Cognizant GenC Next – 2nd Technical Interview Experience (5 Nov 2025) πŸš€

  12. 12

    Java Exception Handling

    Explain Java's exception handling mechanisms, including try , catch , finally blocks, and the distinction between checked and unchecked exceptions.

    From πŸ’» Cognizant GenC Next – 2nd Technical Interview Experience (5 Nov 2025) πŸš€

  13. 13

    Difference between let and var in JavaScript

    Explain the key differences between let and var keywords in JavaScript.

    From πŸ’» Cognizant GenC Next – 2nd Technical Interview Experience (5 Nov 2025) πŸš€

  14. 14

    What is NaN and When it Occurs

    Define NaN (Not a Number) in JavaScript and describe common scenarios where it occurs.

    From πŸ’» Cognizant GenC Next – 2nd Technical Interview Experience (5 Nov 2025) πŸš€

  15. 15

    OOPs Pillars Explanation

    I was asked to explain all the pillars of Object-Oriented Programming (OOPs).

    From πŸ§‘β€πŸ’» Cognizant GenC / GenC Pro/ GenC Next Interview Experience (Nov 2025)

  16. 16

    Polymorphism Detailed Explanation

    The interviewer asked me to explain Polymorphism in detail, particularly in the context of Java.

    From πŸ§‘β€πŸ’» Cognizant GenC / GenC Pro/ GenC Next Interview Experience (Nov 2025)

  17. 17

    final, finally, finalize keywords in Java

    I was asked to explain the differences between final , finally , and finalize keywords in Java.

    From πŸ§‘β€πŸ’» Cognizant GenC / GenC Pro/ GenC Next Interview Experience (Nov 2025)

  18. 18

    Abstract Classes and Interfaces in Java

    I was questioned about Abstract Classes and Interfaces in Java, likely about their differences, use cases, or implementation.

    From πŸ§‘β€πŸ’» Cognizant GenC / GenC Pro/ GenC Next Interview Experience (Nov 2025)

  19. 19

    Exception Handling with Try-Catch in Java

    I was asked about try-catch blocks and general Exception Handling mechanisms in Java.

    From πŸ§‘β€πŸ’» Cognizant GenC / GenC Pro/ GenC Next Interview Experience (Nov 2025)

  20. 20

    Time Complexity of Sorting Algorithms

    I was asked about the time complexity of various standard sorting algorithms.

    From πŸ§‘β€πŸ’» Cognizant GenC / GenC Pro/ GenC Next Interview Experience (Nov 2025)

  21. 21

    SQL Database Normalization

    I was asked to explain database Normalization in SQL.

    From πŸ§‘β€πŸ’» Cognizant GenC / GenC Pro/ GenC Next Interview Experience (Nov 2025)

  22. 22

    Difference between Left and Left Outer Join

    I was asked to explain the difference between a LEFT JOIN and a LEFT OUTER JOIN in SQL.

    From πŸ§‘β€πŸ’» Cognizant GenC / GenC Pro/ GenC Next Interview Experience (Nov 2025)

  23. 23

    Exception Handling in Java

    Describe the principles and mechanisms of exception handling in Java.

    From Cognizant (CTS) Interview Experience – 2025 (IT Branch)

  24. 24

    Checked vs. Unchecked Exceptions

    Explain the difference between checked and unchecked exceptions in Java and provide examples.

    From Cognizant (CTS) Interview Experience – 2025 (IT Branch)

  25. 25

    Null Pointer Exception Handling

    What is a Null Pointer Exception (NPE) and what are common strategies to prevent and handle it in Java?

    From Cognizant (CTS) Interview Experience – 2025 (IT Branch)

45 more in the Cognizant write-ups.

Cognizant interview questions FAQ

What questions are asked in Cognizant interviews?

Candidates reported 131 distinct questions across 12 Cognizant interviews. 32 coding and DSA questions, 1 system design questions, 28 behavioural and HR questions, 70 other questions.

Which Cognizant interview questions are asked most often?

The most repeated are "Reverse a String" (2 times), "Types of SQL Joins" (2 times), "Method Overloading vs. Overriding" (2 times).

How difficult are Cognizant interview questions?

Of the questions candidates rated, 57% were easy, 36% medium and 7% hard.