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

Programmer Analyst Trainee

Cognizant
upvote
share-icon
4 rounds | 12 Coding problems

Interview preparation journey

expand-icon
Journey
When I began preparing for this opportunity, I had a foundational understanding of programming and databases—particularly in Python and SQL—thanks to my academic coursework. However, I was relatively new to problem-solving in a time-bound setting and hadn’t practiced many aptitude or communication-based assessments. So, while I wasn’t a complete beginner, I knew I needed to sharpen my core skills and build confidence in areas like verbal communication, coding under pressure, and analytical thinking to meet placement standards.
Application story
I applied for Cognizant’s 2025 campus recruitment drive through the Superset platform, which was the official medium used by my college for placements. After completing the application and registering for the appropriate role, I received communication regarding the assessment schedule. The entire selection process—from the initial communication assessment to the final technical interview—was conducted virtually. Each stage was well-coordinated, with timely updates and clear instructions shared via email and the Superset dashboard. The process was smooth, structured, and effectively designed to assess both technical and soft skills.
Why selected/rejected for the role?
I believe I was selected because of my strong grasp of the basics in Python and SQL, along with clear communication skills. I focused on consistent preparation, practiced coding regularly, and remained calm during the interview. My ability to confidently explain my thought process and demonstrate real-time problem-solving made a positive impact.
Preparation
Duration: 2.5 months
Topics: Python programming, SQL queries, data structures and algorithms, aptitude (quantitative and logical), communication skills
Tip
Tip

Tip 1: Practice coding regularly on coding platforms to improve problem-solving speed and accuracy.
Tip 2: Take mock communication and aptitude tests to build confidence and become familiar with the exam pattern.

Application process
Where: Other
Eligibility: No backlogs, 60% or above in Class X and XII, 6 CGPA or above in Graduation. (Salary Package: 4 LPA)
Resume Tip
Resume tip

Tip 1: Highlight 1–2 strong projects that showcase your practical skills and problem-solving approach.
Tip 2: Keep your resume concise and tailor it to the role you're applying for by emphasizing relevant skills and coursework.

Interview rounds

01
Round
Medium
Face to Face
Duration58 minutes
Interview date17 Apr 2025
Coding problem1

The first round, the Communication Assessment (held on April 17th, 2025), was divided into four sections:

Section A: Reading and Listening (23 questions)

Section B: Speaking on a Topic (4 questions)

Section C: English Grammar (34 questions)

Section D: Comprehension (16 questions)

This round tested my English language proficiency and communication skills through various formats, including listening comprehension, grammar accuracy, and spoken expression. It was designed to assess my ability to understand, interpret, and effectively communicate in a professional environment.

1. Puzzle

Discuss the importance of healthy eating.

02
Round
Easy
Online Coding Interview
Duration80 minutes
Interview date20 Apr 2025
Coding problem4

The Aptitude Assessment round was conducted over 80 minutes and was divided into two main sections:

Section A: Quantitative Aptitude (30 minutes, 30 questions)
This section tested my mathematical and logical reasoning skills, covering topics such as arithmetic, algebra, percentages, time and work, and data interpretation. The questions were designed to evaluate accuracy, speed, and problem-solving ability under time constraints.

Section B: Game-Based Challenge
This section consisted of interactive, scenario-based puzzles and challenges aimed at assessing analytical thinking, decision-making skills, and the ability to apply logical reasoning in dynamic situations. It was engaging and required strategic planning and quick thinking.

Overall, the aptitude round focused on testing both my numerical skills and my ability to think critically and creatively under pressure.

1. Puzzle

X is inversely proportional to the cube root of Z. It is given that X = 64 when Z = (1/64). What is the value of Z when the value of X is 24/13?

A. 17576/27
B. 15657/32
C. 26/3
D. 676/9

2. Puzzle

What is the cost price of a fancy showpiece if it was sold for Rs. 1780 after having two consecutive discounts of 11% and 20% from the retailer?

A. Rs. 2150
B. Rs. 2250
C. Rs. 2500
D. Rs. 2000

3. Puzzle

Jack and Adam can finish a piece of product in 24 days and 20 days, respectively. They started working together, and Jack left a few days later. In this event, Adam completes the leftover work in 8 days. For how long did they work together?

A. 6(2/11) days
B.7(2/11) days
C. 6(6/11) days
D.5(10/11) days

4. Puzzle

A bag contains 7 green and 9 yellow rubber bands. What is the probability of drawing 2 yellow rubber bands in succession if the first rubber band drawn is replaced?

A. 81/256
B. 41/256
C. 49/128
D. 81/128

03
Round
Hard
Online Coding Test
Duration120 minutes
Interview date25 Apr 2025
Coding problem4

The Technical Round was conducted on April 25th, 2025, with a duration of 120 minutes. It was designed to assess problem-solving ability and technical knowledge in programming and databases.

The round consisted of:

2 SQL Questions: One easy and one of medium difficulty, testing concepts such as joins, aggregations, filtering, and query optimization.

2 Python Questions: One easy and one hard, covering topics such as data structures (lists, dictionaries), string manipulation, and algorithmic logic.

This round required writing and executing code to solve real-time problems, with a focus on both logic and efficiency. It evaluated not only syntax knowledge but also the ability to think algorithmically and work with structured data.

1. SQL query

Write an SQL query to display the first name and last name of all users whose first name starts with 'K'.

Problem approach

Step 1: I began by understanding the requirement — to fetch the first and last names of users whose first name begins with the letter 'K'.

Step 2: I identified the relevant table and columns involved (first_name, last_name).

Step 3: I used the LIKE operator with 'K%' to filter names starting with 'K', which is efficient for pattern matching in SQL.

Step 4: I then wrote the SELECT query using the condition and tested it. The output was as expected, and the interviewer was satisfied with the use of pattern-based filtering.

2. SQL Query

Write a query to retrieve the registration ID, vehicle code, performance score, and transaction ID of all operators whose performance score is at least 4.5 and whose transaction status is not "Failed".

Problem approach

Step 1: I identified the two necessary data tables: operators and transactions, which are linked through the common field Operator_ID.

Step 2: I performed an INNER JOIN between these tables to merge their records based on matching Operator_ID values.

Step 3: I filtered the results to include only those operators whose performance score was 4.5 or higher.

Step 4: I excluded any transactions marked as "Failed" by adding a condition to omit those statuses.

Step 5: Finally, I selected the required attributes — registration ID, vehicle code, performance score, and transaction ID. Upon execution, the query returned the expected results, confirming the correctness of both the filtering and join logic.

3. Command Unit Counter

Easy
0/40
Asked in company
Cognizant

You are given a string S which consists only of digits from '1' to '9'. This string can be interpreted as a sequence of commands. A "command unit" can be either:

1) A single digit.
2) A pair of two consecutive digits that form a number less than or equal to 26.

Your task is to count the total number of valid command units (both single-digit and valid two-digit combinations) that can be found in the string.


Problem approach

Step 1: I began by checking if the input string input1 is empty. If it is, there are no possible mappings, so the function returns 0.

Step 2: I initialized a counter variable count to keep track of the total number of valid single-digit and two-digit mappings.

Step 3: I iterated over each character in the string to count valid single-digit mappings.
A digit from '1' to '9' corresponds to a valid alphabet character (A to I), so for each such character, I incremented count by 1.

Step 4: I then used a loop to extract every possible two-digit substring from the input.
For each pair of consecutive digits, I converted the substring to an integer and checked whether its value lies between 10 and 26 (inclusive), as these map to valid letters (J to Z).
If the condition was satisfied, I incremented count by 1.

Step 5: Finally, I returned the total count of valid single-digit and two-digit combinations.

Try solving now

4. Optimal Interval Excitement

Easy
0/40
Asked in company
Cognizant

You are given an array of integers B of size N. Your task is to find an optimal numeric interval [X, Y] that results in the maximum and minimum possible final "excitement levels".

The excitement level starts at 0 and is calculated by iterating through each number in the array B:

1) If a number is within the interval X, Y, the excitement level increases by 1.
2) If a number is outside the interval [X, Y], the excitement level decreases by 1.

You have complete freedom to choose the integers X and Y to define the interval. You need to return the maximum and minimum possible final excitement levels.


Problem approach

Step 1: Initialize two variables:

max_level to track the highest excitement level achieved (start at 0)

min_level to track the lowest excitement level achieved (start at 0)
Also, initialize current_level to 0 to track the excitement level as we process the array.

Step 2: Iterate through each integer num in the array B.

Step 3: For each num, check if it lies within the interval [X, Y].

If X <= num <= Y, increase current_level by 1.

Otherwise, decrease current_level by 1.

Step 4: After updating current_level, update max_level and min_level if current_level is higher than max_level or lower than min_level, respectively.

Step 5: After processing all numbers, the values in max_level and min_level represent the maximum and minimum excitement levels Alex experienced.

Step 6: Return the result as a string "max_level min_level".

Try solving now
04
Round
Medium
Video Call
Duration20 minutes
Interview date11 May 2025
Coding problem3

The final interview round lasted approximately 20 minutes and consisted of two parts. The first part focused on technical questions, primarily related to Python and SQL. I was asked to solve coding problems and write SQL queries to demonstrate my understanding of data manipulation and algorithmic thinking.

The second part involved personal and HR questions, covering topics such as my willingness to relocate, career aspirations, and behavioral fit. This round was designed to assess both my technical competence and cultural alignment with the company.

1. Python Expression

Write a Python expression that returns the maximum of two given numbers in a single line.

Problem approach

Step 1: Understand that Python provides a built-in function max() that returns the larger of two values.

Step 2: Use max(a, b), where a and b are the two input numbers.

Step 3: This expression returns the greater value in a single line.

2. SQL Query

Write an SQL query to find the names of employees whose salary is greater than the average salary in their department.

Problem approach

Step 1: Identify that the inner query will calculate the average salary per department.

Step 2: The outer query selects employee names where their salary exceeds their department's average.

Step 3: Use a nested query in the WHERE clause to compare each employee's salary with the department average.

3. Python Expression

Write a Python expression to reverse a given string in one line.

Problem approach

Step 1: Know that Python strings support slicing.

Step 2: Use slicing with [::-1] to reverse the string.

Step 3: This returns the reversed string in one line.

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
Programmer Analyst Trainee
4 rounds | 6 problems
Interviewed by Cognizant
1173 views
0 comments
0 upvotes
company logo
Programmer Analyst Trainee
2 rounds | 3 problems
Interviewed by Cognizant
1408 views
0 comments
0 upvotes
company logo
Programmer Analyst Trainee
3 rounds | 7 problems
Interviewed by Cognizant
925 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
Programmer Analyst Trainee
3 rounds | 4 problems
Interviewed by Newgen Software
811 views
0 comments
0 upvotes