Unite Wings

Cognizant interview questions

21 questions candidates report from Cognizant interviews, plus the general HR questions every interviewer asks. Each has a model answer and the follow-ups to expect.

Typical selection process

GenC hiring: aptitude and coding assessment, then a technical interview and an HR interview. GenC Next and GenC Pro roles get deeper coding questions.

As reported by recent candidates. Always check the latest official notification.

38 questions

HRFlexibilityEasy

Are you willing to relocate to any location and work in night shifts if needed?

Reported at TCS, Infosys, Wipro, Accenture, Cognizant, Capgemini

What they are checking: Mass recruiters place freshers wherever projects need them. A hesitant answer can end the interview.

Model answer

Yes. I understand that projects are spread across cities and time zones, and as a fresher I want the widest set of opportunities.

I have already lived away from home for four years in a hostel, so moving cities is not a concern for me. If a client needs support in their time zone I'm comfortable with shifts. I'd only ask to know the schedule in advance so I can plan around it.

Tips

  • If you have a genuine constraint, mention it honestly but briefly; do not bargain in the first round.
HRAcademicsMedium

You had a backlog in your second year. What happened?

Reported at TCS, Infosys, Wipro, Cognizant, Accenture

What they are checking: Accountability. They are checking whether you blame others and whether the problem is behind you.

Model answer

Yes, I had a backlog in Engineering Mathematics III in my third semester. Honestly, I underestimated the subject and spent too much time on a hackathon that month.

I cleared it in the next attempt with [72] marks. After that I made a study timetable for every semester and I haven't had a backlog since; my last three semesters are all above [8 SGPA].

It taught me to plan time for the subjects I find hard instead of only the ones I enjoy.

Tips

  • Own it in one sentence, then move on to the fix and the evidence.
  • Check the company's eligibility rules on active backlogs before you apply.
HRCommitmentEasy

Are you comfortable signing a service agreement for the first year or two?

Reported at TCS, Infosys, Wipro, Cognizant, Capgemini, Accenture

What they are checking: The company spends months training freshers and wants confidence you will stay.

Model answer

Yes. The company invests a lot in training freshers, so it's fair to expect a commitment in return. I'm planning to build my career here for the long term anyway, so the agreement doesn't change my plans.

Could you share the details of the agreement, such as its duration, so I understand it fully before signing?

Tips

  • Read the agreement terms before accepting the offer, but do not argue about them in the interview.
HRMotivationMedium

You studied mechanical engineering. Why do you want to move into IT?

Reported at TCS, Infosys, Wipro, Cognizant, Accenture, Capgemini

What they are checking: Whether the switch is a real interest backed by effort, or just a fallback.

Model answer

I enjoyed mechanical engineering, but the part I liked most was writing MATLAB and Python scripts to analyse our lab data. In my third year I automated our thermodynamics lab calculations, which saved my batch hours every week, and I realised I wanted to build software full time.

Since then I've completed [the NPTEL Python and DBMS courses], solved around 150 coding problems, and built a small inventory app for a local hardware shop using Python and SQLite.

My mechanical background also helps: I'm used to working with real-world constraints and data, which is useful in manufacturing and automotive client projects.

Tips

  • Show what you have already done to make the switch.
  • Turn your core branch into an advantage.
HRSelf-assessmentMedium

Which programming language are you most comfortable with? Rate yourself out of 10.

Reported at TCS, Infosys, Wipro, Cognizant

What they are checking: A trap and a guide. Whatever language and number you give decides how hard the next questions are.

Model answer

I'm most comfortable with Java. I'd rate myself a 7 out of 10.

I'm confident with OOP, collections like ArrayList and HashMap, exception handling, and writing programs on arrays and strings. I've built two projects in Java, including a Spring Boot REST API.

I'm not giving myself higher because I haven't worked much with multithreading or the JVM's memory internals in a real project yet. Those are what I'm learning next.

Tips

  • Do not say 9 or 10; the interviewer will try to prove you wrong.
  • Say what you know and what you do not. That honesty is what they are testing.

Likely follow-ups

  • What is the difference between HashMap and Hashtable?
  • Write a program to reverse a string in Java.
  • What is the difference between == and equals()?
HRFlexibilityEasy

You may be placed in testing or support rather than development. Is that okay?

Reported at Accenture, Capgemini, Cognizant, TCS

What they are checking: Flexibility. Freshers are allocated based on project needs, not preference.

Model answer

Yes. Whatever I start with, I'll learn how real systems work in production, how clients use them, and how problems are found and fixed. Testing especially builds the habit of thinking about edge cases, which makes you a better developer later.

I'd do the work well and, over time, show through my performance and certifications that I'm ready for development work as well.

HRMotivationEasy

Why do you want to join Cognizant?

Reported at Cognizant

What they are checking: Company research and fit.

Model answer

Cognizant has a structured path for freshers through its GenC programme, with training before project allocation, which is what I need to start well.

It also has deep experience with clients in healthcare, banking and insurance. I find healthcare technology especially interesting because the software directly affects patients.

And Cognizant has a large presence in Chennai and other Indian cities, with many freshers moving into digital areas like cloud and data over time, which matches where I want to grow.

BehaviouralLearning agilityEasy

Tell me about a time you had to learn something new quickly.

Reported at TCS, Infosys, Accenture, Cognizant, Capgemini, Wipro

What they are checking: Service companies assign freshers to any technology, so they need fast learners.

Model answer

For a college hackathon our team decided to build a chatbot, and I was the only one free to handle deployment, although I had never used AWS.

I gave myself one evening: I followed AWS's own getting-started guide for EC2, deployed a sample app, and wrote down every command in a doc. The next day I deployed our Flask bot and set up a domain. When something broke I read the error, searched it, and noted the fix.

We finished on time, and the doc I wrote became the deployment guide our club still shares with juniors. My approach to anything new is official docs first, a tiny working example, then the real task.

BehaviouralManagerial roundMedium

Two days before release, the client asks for a change. What would you do?

Reported at TCS, Infosys, Accenture, Cognizant

What they are checking: Managerial-round thinking: do you protect the client relationship and the team, rather than just saying yes or no?

Model answer

I wouldn't say yes or no immediately.

First I'd understand the change: what exactly they need and why it matters to them now. Then I'd estimate the effort with my lead and check the risk to the release, since a rushed change two days out could break something that already works.

Then I'd go back to the client with options. If the change is small and low risk, we can include it with extra testing. If it's bigger, we can release on time and deliver the change in a quick follow-up release, or move the date if the change is critical to them.

Whatever we decide, I'd confirm it in writing so everyone has the same expectation.

TechnicalOOPEasy

Explain the four pillars of object-oriented programming with examples.

Reported at TCS, Infosys, Wipro, Cognizant, Accenture, Capgemini

What they are checking: The single most common fresher technical question. They want clear definitions and an everyday example for each, not textbook lines.

Model answer

  • Encapsulation: keeping data and the methods that change it together, and hiding the data behind those methods. A BankAccount class keeps balance private and only allows changes through deposit() and withdraw(), which can check for a negative balance.
  • Abstraction: showing only what the user needs and hiding how it works. You call car.start() without knowing how the fuel injection works. In Java this is done with abstract classes and interfaces.
  • Inheritance: a class reusing and extending another class. SavingsAccount extends BankAccount and adds interest calculation without rewriting deposit and withdraw.
  • Polymorphism: one interface, many forms. A Shape reference can hold a Circle or a Square, and shape.area() runs the right version at run time (overriding). Method overloading, the same method name with different parameters, is compile-time polymorphism.

Encapsulation is about protecting data, while abstraction is about hiding complexity; interviewers often ask for that difference next.

Likely follow-ups

  • What is the difference between overloading and overriding?
  • Can you achieve multiple inheritance in Java?
  • Abstraction vs encapsulation?
TechnicalDatabasesMedium

What is normalisation? Explain 1NF, 2NF and 3NF.

Reported at TCS, Infosys, Wipro, Cognizant, Capgemini

What they are checking: DBMS fundamentals, very common in service-company interviews.

Model answer

Normalisation is organising tables to reduce duplicate data and avoid update problems.

  • 1NF: every column holds a single value, with no lists or repeating groups. A "phones" column holding "98xxx, 99xxx" breaks 1NF; move phones to separate rows or a separate table.
  • 2NF: 1NF, plus every non-key column depends on the whole primary key, not part of it. In a table keyed on (student_id, course_id), student_name depends only on student_id, so it belongs in a Students table.
  • 3NF: 2NF, plus non-key columns depend only on the key, not on other non-key columns. If a Students table has department_id and department_name, department_name depends on department_id, so move it to a Departments table.

Without normalisation, renaming a department means updating thousands of rows, and missing one leaves the data inconsistent. In analytics systems, we sometimes denormalise on purpose to make reads faster.

Likely follow-ups

  • What is BCNF?
  • When would you denormalise?
TechnicalDatabasesEasy

What is the difference between a primary key, a unique key and a foreign key?

Reported at TCS, Infosys, Wipro, Cognizant

What they are checking: DBMS basics.

Model answer

  • Primary key: uniquely identifies each row. It cannot be NULL and a table has only one, such as student_id.
  • Unique key: values must be unique but, in most databases, it can contain NULL, and a table can have several, such as email or phone.
  • Foreign key: a column that refers to the primary key of another table, enforcing the relationship. Enrollments.student_id refers to Students.student_id, so you cannot enrol a student who doesn't exist.

By default, a primary key also creates a clustered index in databases such as SQL Server and MySQL's InnoDB, which decides the physical order of rows.

TechnicalJavaMedium

What is the difference between an abstract class and an interface in Java?

Reported at TCS, Infosys, Cognizant, Wipro, Capgemini

What they are checking: Java OOP depth.

Model answer

  • Methods: an abstract class can have abstract and fully implemented methods. An interface has abstract methods, and since Java 8 can also have default and static methods.
  • State: an abstract class can have instance variables and constructors. Interface fields are always public static final constants.
  • Inheritance: a class can extend only one abstract class but implement many interfaces.
  • Access: abstract class members can be private or protected; interface methods are public.

Use an abstract class when related classes share code and state, such as a base Vehicle with a common fuel field. Use an interface to define a capability that unrelated classes can share, such as Comparable or Runnable.

interface Payable { double pay(); }

abstract class Employee implements Payable {
    protected String name;
    Employee(String name) { this.name = name; }
    abstract double monthlySalary();
    public double pay() { return monthlySalary(); }
}

class FullTime extends Employee {
    FullTime(String name) { super(name); }
    double monthlySalary() { return 50000; }
}
TechnicalWebMedium

What is a REST API? What do the HTTP methods mean?

Reported at Accenture, Cognizant, Flipkart

What they are checking: Web development fundamentals.

Model answer

REST is a style for building web APIs where everything is a resource with a URL, and you act on it with standard HTTP methods. Requests are stateless: each one carries everything the server needs, such as an auth token.

  • GET /students/12: read student 12. Safe, no changes.
  • POST /students: create a new student.
  • PUT /students/12: replace student 12 completely.
  • PATCH /students/12: update some fields of student 12.
  • DELETE /students/12: delete student 12.

Responses use status codes: 200 OK, 201 Created, 400 Bad Request, 401 Unauthorized, 404 Not Found, 500 Server Error.

GET, PUT and DELETE are idempotent, meaning repeating the same request has the same effect as doing it once. POST is not, which is why retrying a POST can create duplicates.

TechnicalData structuresEasy

What is the difference between a stack and a queue? Give real uses.

Reported at TCS, Infosys, Wipro, Cognizant, Capgemini

What they are checking: Data structure basics.

Model answer

A stack is Last In, First Out: you push and pop from the same end, like a pile of plates. A queue is First In, First Out: you add at the back and remove from the front, like a ticket line.

Stack uses: undo in an editor, the browser back button, function calls (the call stack), checking balanced brackets, depth-first search.

Queue uses: printer jobs, handling requests in order on a server, breadth-first search, message queues between services.

Both support their main operations in O(1) time.

Likely follow-ups

  • How would you implement a queue using two stacks?
TechnicalCodingEasy

Write a program to reverse a string without using built-in reverse functions.

Reported at TCS, Infosys, Wipro, Cognizant, Capgemini

What they are checking: Basic coding fluency. Talk through the approach before writing.

Model answer

Use two pointers, one at each end, and swap characters as they move towards the middle. O(n) time and O(n) space (Java strings are immutable, so we work on a char array).

static String reverse(String s) {
    char[] c = s.toCharArray();
    int i = 0, j = c.length - 1;
    while (i < j) {
        char t = c[i];
        c[i] = c[j];
        c[j] = t;
        i++;
        j--;
    }
    return new String(c);
}

Test cases to mention: an empty string, a single character, and an even and an odd length.

Likely follow-ups

  • Reverse the words in a sentence instead of the characters.
  • Check whether a string is a palindrome.
TechnicalCodingEasy

Check whether a number is a palindrome.

Reported at TCS, Wipro, Cognizant, Zoho

What they are checking: Loops and arithmetic without converting to a string.

Model answer

Reverse the number digit by digit using % 10 and // 10, then compare with the original. Negative numbers are not palindromes.

def is_palindrome(n):
    if n < 0:
        return False
    original, rev = n, 0
    while n > 0:
        rev = rev * 10 + n % 10
        n //= 10
    return original == rev

print(is_palindrome(121))   # True
print(is_palindrome(123))   # False

Time is O(d) where d is the number of digits.

TechnicalRequirementsMedium

How do you gather requirements from stakeholders?

Reported at Accenture, Deloitte, Cognizant, Capgemini

What they are checking: Whether you know the techniques and how to turn vague asks into clear requirements.

Model answer

  1. Identify stakeholders: who uses the system, who pays, who approves, who supports it.
  2. Understand the current process: interviews, watching users do their actual work, and reading existing documents and data.
  3. Run workshops to agree on problems and priorities with groups, especially when departments disagree.
  4. Use questionnaires when there are many users across locations.
  5. Build prototypes or wireframes, because people often only know what they want once they see something.

Then I document requirements as user stories or a BRD, with acceptance criteria, and confirm them with stakeholders. I ask "why" a lot: a request for "an Excel export" is often really a need for a specific weekly report.

TechnicalDocumentationEasy

What is the difference between a BRD and an FRD?

Reported at Accenture, Cognizant, Capgemini, Deloitte

What they are checking: BA vocabulary and documentation practice.

Model answer

  • BRD (Business Requirements Document): what the business needs and why. Written in business language for stakeholders. Example: "Customers must be able to track their order status without calling support, to cut support calls by 30%."
  • FRD (Functional Requirements Document): how the system will behave to meet those needs. Written for designers, developers and testers. Example: "The order page shows status as Placed, Packed, Shipped, Delivered, updated within 5 minutes of a warehouse scan."

The BRD comes first and is approved by the business; the FRD comes from it and is reviewed with the technical team. In agile teams both are often replaced by epics, user stories and acceptance criteria.

0students
taking off