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

GenC (Trainee Programmer Analyst)

Cognizant
upvote
share-icon
3 rounds | 10 Coding problems

Interview preparation journey

expand-icon
Journey
So, I was in my 7th semester when Cognizant's on-campus hiring started for PAN India. I was prepared with basic DSA and core subjects like OOPS, DBMS, and Networking. I also used to regularly take aptitude tests conducted by the college. Being good at aptitude and communication, I easily cleared the aptitude and communication rounds, followed by the technical coding rounds, and finally aced the interview.
Application story
I applied through the Superset portal for PAN India hiring. The college reminded us about the forms and links where we needed to apply, so we submitted our applications, filled in the details, and uploaded our resumes on the Superset portal.
Why selected/rejected for the role?
I was a good fit and cleared all the rounds easily. Whether it was aptitude, communication, technical coding, or the interview — I aced them all.
Preparation
Duration: 1 Month
Topics: DSA, Aptitude, Communication, OS, DBMS, OOP
Tip
Tip

Tip 1: Focus on the basics
Tip 2: Have decent aptitude
Tip 3: Maintain good communication skills

Application process
Where: Campus
Eligibility: Above 6 CGPA, (Salary Package: 4 LPA)
Resume Tip
Resume tip

Tip 1: Mention only relevant skills
Tip 2: Include good projects and internship experience for added advantage

Interview rounds

01
Round
Easy
Online Coding Interview
Duration60 minutes
Interview date15 Feb 2025
Coding problem3

This round consisted of aptitude questions, communication MCQs, and a speaking ability section.

1. Aptitude Question

Basic to medium-level questions on profit and loss, mensuration, blood relations, and crossword puzzles.

2. Verbal Skills

Find antonyms and synonyms, along with reading passages and comprehension questions.

Problem approach

Tip 1: Good grammar
Tip 2: Proper comprehension skills

3. Narration Exercise

English audio clips of 10 to 15 seconds were played once, and we had to record ourselves repeating the narration exactly as it was said.

Problem approach

Tip 1: Good listening
Tip 2: Understanding
Tip 3: Attention

02
Round
Easy
Online Coding Interview
Duration60 minutes
Interview date16 Feb 2025
Coding problem4

This round consisted of two coding questions and two SQL questions that we had to solve in one hour.

1. Find The Single Element

Easy
10m average time
95% success
0/40
Asked in companies
AmazonCognizantStimVeda Neurosciences

You are given a sorted array 'arr' of positive integers of size 'n'.


It contains each number exactly twice except for one number, which occurs exactly once.


Find the number that occurs exactly once.


Example :
Input: ‘arr’ = {1, 1, 2, 3, 3, 4, 4}.

Output: 2

Explanation: 1, 3, and 4 occur exactly twice. 2 occurs exactly once. Hence the answer is 2.
Problem approach

Just XOR all the numbers in the array, and the result will be the number that appears only once.

Try solving now

2. Balanced Root Check

Easy
0/40

For a given Binary Tree of type integer, your task is to determine if the height of the root's left subtree is exactly equal to the height of the root's right subtree.


The height of a binary tree is the number of nodes on the longest path from its root node down to the farthest leaf node.


An empty tree (a null node) has a height of 0.


A tree with a single node has a height of 1.


You must implement a function that calculates the height of the left subtree and the right subtree and returns true if they are equal, and false otherwise.


Problem approach

First, find the left height of the tree, then the right height. If they are both the same, return true; otherwise, return false.

Try solving now

3. SQL Query

In an Employees table, there is a column named First Name and another column named Last Name. Fetch the full name of all employees by combining the First Name and Last Name.

Problem approach

Tip 1: SQL Basics
Tip 2: String Concatenation in SQL

4. SQL Query

Given a Students table and a Books table in the library database, fetch the number of books issued to all the students.

Problem approach

Tip 1: SQL Joins
Tip 2: Group By

03
Round
Medium
Face to Face
Duration45 minutes
Interview date25 Feb 2025
Coding problem3

This was the final interview round, in which DSA and SQL questions, along with HR-based questions, were asked.

1. Count Character Occurrences

Easy
0/40
Asked in company
Cognizant

Given a string 'S' of length 'N' and a character 'C', the task is to count the occurrence of the given character in the string.


Return the total number of times the character 'C' appears in the string 'S'.


For Example :
Let 'N' = 5, 'S' = "bbacb", 'C' = 'b'.
The character 'b' appears 3 times in the string "bbacb".
Therefore, the answer is 3.
Problem approach

Create a map data structure, then use a for loop to iterate through each character of the string and increment the count for that character in the map. Finally, print all the characters with a count greater than 0.

Try solving now

2. DBMS

Implement an SQL INNER JOIN.

Problem approach

Tip 1: Writing the syntax for an INNER JOIN between two tables.
Tip 2: Basic SQL knowledge is required.

3. Internship Challenge

What was the most difficult problem you faced during your internship, and how did you overcome it?

Problem approach

Tip 1: I described how, once, I had to store image data for all visit requests in the database in Base64 format. Later, when I wanted to retrieve and display the images on the same web page, loading multiple images simultaneously caused database overhead. To solve this, I loaded the images one by one only when the specific image data was requested by clicking the "View More" button.

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