Cognizant interview experience Real time questions & tips from candidates to crack your interview

Associate Software Engineer

Cognizant
upvote
share-icon
3 rounds | 15 Coding problems

Interview preparation journey

expand-icon
Journey
I started by focusing on strengthening my fundamentals and developing a consistent learning habit. Over time, I worked on problem-solving, communication skills, and learned a lot through practice and setbacks. This journey has been full of growth, and every step has helped me become more confident and prepared for future opportunities.
Application story
I applied through my college’s campus placement process when the company visited for recruitment. We were informed about the eligibility and application details by the placement cell, and I submitted my resume accordingly. After the initial shortlisting, I was invited to appear for the interview rounds. The overall process was smooth and well-coordinated by both the company and the placement team.
Why selected/rejected for the role?
I believe I was not selected because of a few gaps in my technical depth and the way I communicated my thought process during the interview. While I had a decent understanding of the basics, I realized I need to work more on problem-solving under time pressure and explaining my approach clearly. This experience gave me a clear picture of what top companies look for, and it has motivated me to focus more on structured practice and mock interviews.
Preparation
Duration: 4 months
Topics: DSA, OOPS, DBMS , Operating System, Software Engineering
Tip
Tip

Tip 1: Practice DSA problems regularly.
Tip 2: Strengthen your SQL query skills through hands-on exercises.
Tip 3: Build and refine full-stack projects to showcase your technical skills.

Application process
Where: Campus
Eligibility: 65%+ throughout academics, (Salary Package: 4 LPA)
Resume Tip
Resume tip

Tip 1: Have at least 2 full-stack major projects to demonstrate your development skills.
Tip 2: Include links to your coding platforms and GitHub profile to validate your work and showcase your contributions.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration60 minutes
Interview date19 Sep 2022
Coding problem10

It was mostly reasoning and puzzle based MCQ questions.

1. Reasoning

Find the next number in the series:
2, 6, 12, 20, 30, ?

2. Puzzle

Pointing to a man in a photo, Rina said, “He is the only son of my father’s wife.” How is Rina related to the man?

3. Puzzle

Statements: 
All cats are animals. 
Some animals are dogs. 

Conclusion: 
(I) Some cats are dogs. 
(II) All cats are dogs.

4. Puzzle

A person walks 5 km North, then turns right and walks 3 km, then turns right again and walks 5 km. Which direction is he facing now?

5. Puzzle

In a code language, if TREE is coded as USFF, how is PLAN coded?

6. Puzzle

Three people need to cross a bridge at night. They have one torch, and at most two people can cross at a time. They take 1, 2, and 5 minutes respectively. What's the minimum time to get all three across?

7. Puzzle

You’re outside a room with 3 switches. One of them controls a bulb inside the room. You can only enter the room once. How do you find out which switch controls the bulb?

8. Puzzle

You have 8 balls, one of which is slightly heavier. You can use a balance scale only twice. How do you find the heavier ball?

9. Puzzle

You have a 7-minute and 4-minute hourglass. How can you measure exactly 9 minutes?

10. Code Output

What will be the output of the following C code?

#include

int mystery(int arr[], int size) {
   int i, result = 0;
   for(i = 0; i < size; i++) {
       result ^= arr[i];
   }
   return result;
}

int main() {
   int data[] = {5, 3, 5, 4, 3};
   int size = sizeof(data) / sizeof(data[0]);
   printf("Result: %d\n", mystery(data, size));
   return 0;
}

Problem approach

This code uses the XOR (^) operation. In XOR, a number XORed with itself becomes 0, and XOR with 0 returns the number. Here’s how it works step-by-step:
5 ^ 3 = 6 
6 ^ 5 = 3 
3 ^ 4 = 7 
7 ^ 3 = 4

02
Round
Medium
Online Coding Test
Duration45 minutes
Interview date23 Sep 2022
Coding problem2

The interview was conducted online during the daytime and was well-scheduled without any delays. The environment was calm and professional, and the overall process was smooth.

1. Longest Common Prefix

Moderate
40m average time
60% success
0/80
Asked in companies
AdobeGrofersDunzo

Write a function that takes a list of strings and returns the longest common prefix shared among all strings.
If there is no common prefix, return an empty string.

Example:
Input: ["flower", "flow", "flight"]  
Output: "fl"

Input: ["dog", "racecar", "car"]  
Output: ""

Problem approach

Step 1: Identify that we need to find the common starting characters in all strings.
Step 2: Use the first string as a reference for comparison.
Step 3: Iterate character by character and compare with corresponding characters in other strings.
Step 4: Stop at the first mismatch and return the prefix built so far.
Step 5: Return an empty string if the input is empty or no common prefix is found.

Try solving now

2. Subarray With Given Sum

Moderate
15m average time
85% success
0/80
Asked in companies
SnapdealOlaAccenture

Given an array of positive integers and a target sum, find the starting and ending indices of the subarray that adds up to the given sum. Return -1 if no such subarray exists.

Example:
Input: arr[] = {1, 4, 20, 3, 10, 5}, sum = 33  
Output: Subarray found from index 2 to 4

Input: arr[] = {1, 4, 0, 0, 3, 10, 5}, sum = 7  
Output: Subarray found from index 1 to 4

Problem approach

Step 1: Initialize a sliding window with start = 0 and current_sum = arr[0].
Step 2: Expand the window by moving the end pointer and adding to the sum.
Step 3: If the sum exceeds the target, shrink the window by moving the start pointer.
Step 4: If the current sum matches the target, record the start and end indices.
Step 5: If no match is found till the end, return -1 as no such subarray exists.

Try solving now
03
Round
Easy
Face to Face
Duration45 minutes
Interview date29 Oct 2022
Coding problem3

The interviewer made me feel comfortable and it first started with basic intro then later moved to technical questions. So it was mix of both HR and technical interview.

1. SQL

What is the difference between DELETE, TRUNCATE, and DROP? (Learn)

2. DBMS

What is indexing? How does it improve query performance. (Learn)

3. Cycle Detection in a Singly Linked List

Moderate
15m average time
80% success
0/80
Asked in companies
InformaticaUrban Company (UrbanClap)PhonePe

You are given a Singly Linked List of integers. Return true if it has a cycle, else return false.


A cycle occurs when a node's next points back to a previous node in the list.


Example:
In the given linked list, there is a cycle, hence we return true.

Sample Example 1

Problem approach

Step 1: Understand that a cycle means a node points back to a previous node in the list.
Step 2: Use Floyd’s algorithm which is efficient and doesn’t require extra space.
Step 3: Initialize two pointers: slow (moves 1 step) and fast (moves 2 steps).
Step 4: Traverse the list while both pointers are not NULL.
Step 5: If slow and fast meet, a cycle is detected.
Step 6: If fast or fast->next becomes NULL, there’s no cycle.
Step 7: Return true if pointers meet, else return false.

Try solving now

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

To make an AI less repetitive in a long paragraph, you should increase:

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by Cognizant
1746 views
1 comments
0 upvotes
company logo
SDE - 2
3 rounds | 5 problems
Interviewed by Cognizant
1063 views
0 comments
0 upvotes
company logo
Program Analyst
2 rounds | 6 problems
Interviewed by Cognizant
605 views
0 comments
0 upvotes
company logo
Programmer Analyst Trainee
3 rounds | 8 problems
Interviewed by Cognizant
773 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Associate Software Engineer
2 rounds | 2 problems
Interviewed by Tata Consultancy Services (TCS)
5154 views
1 comments
0 upvotes
company logo
Associate Software Engineer
3 rounds | 5 problems
Interviewed by Tata Consultancy Services (TCS)
3313 views
2 comments
0 upvotes
company logo
Associate Software Engineer
4 rounds | 5 problems
Interviewed by Accenture
3924 views
0 comments
0 upvotes