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

Programmer Analyst Trainee

Cognizant
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Journey
In the starting i was not able to understand the basics of programming but later i get to know about the DSA+Dev course of Coding Ninjas through which i clear two technical round with confidence.
Application story
I have applied through on campus opportunity where we have register On Superset platform(https://app.joinsuperset.com/students/login) for Genc next profile. Application Process follows: 1. Application screening based on resume 2. Genc next Skill based Assessment 3. Technical Interview 4. HR Interview I passed Application Screening a got mail for taking Genc Skill based Assessment scheduled . I cleared the assessment and my Coding Interview and HR Interview .
Why selected/rejected for the role?
Because i have confidence in doing DSA. Practice a lot of questions already so questions are mostly not tough for me. Write only what i know in Resume.
Preparation
Duration: 5 months
Topics: Data Structures, DBMS, Computer Networks, OOPs, Mern
Tip
Tip

Tip 1 : Practice regularly .
Tip 2 : be focused while doing prep.
Tip 3 : Proactively looking what companies ask.

Application process
Where: Campus
Eligibility: NO
Resume Tip
Resume tip

Tip 1:Good projects atleast knowledge of one framework (Spring,react...)
Tip 2:Regularly practice DSA.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration60 mins
Interview date1 Sep 2021
Coding problem2

30 MCQ and 2 coding questions all to solve in 60 min.

1. Min Jumps

Easy
15m average time
85% success
0/40
Asked in companies
American ExpressSamsung R&D InstituteIntuit

You live in a Ninja town which is in the form of a N * M grid. In this town, people travel from one place to another by jumping over the buildings which are present in each cell of the grid. It is Christmas eve, and Santa wants to give gifts and chocolates to the kids who live in the building which is present at the cell (N - 1, M - 1). Initially, Santa is present on cell (0, 0). Since Santa is in a hurry, help him find a path from starting point to the endpoint with the least amount of time.

The Santa may go only from one building to any of its adjacent buildings which is present either to the right or to the bottom or bottom right cell i.e. if the current position is (x, y), he may go to (x + 1, y + 1) or (x + 1, y) or (x, y + 1) given that the new coordinates are in the grid. The time taken to reach from one building to another is equal to the absolute difference between the heights of buildings.

Note:

1. The heights of the buildings are positive.
2. Santa starts from the cell (0, 0) and he has to reach the building (N - 1, M - 1).
3. Santa cannot leave the grid at any point of time.
Problem approach

class Solution {
public int jump(int[] nums) {
if(nums.length == 1){
return 0;
}
int max = 0;
int curr = 0;
int count = 0;
for(int i = 0 ; i < nums.length - 1 ; i++){
max = Math.max(max , i + nums[i]);
if(curr == i){
curr = max;
count++;
}
if(curr>nums.length-1){
return count;
}
}
return count;
}
}

Try solving now

2. Find power of a number

Easy
15m average time
80% success
0/40
Asked in companies
QuikrCognizantAccenture

Ninja is sitting in an examination hall. He is encountered with a problem statement, "Find ‘X’ to the power ‘N’ (i.e. ‘X’ ^ ‘N’). Where ‘X’ and ‘N’ are two integers."

Ninja was not prepared for this question at all, as this question was unexpected in the exam.

He is asking for your help to solve this problem. Help Ninja to find the answer to the problem.

Note :

For this question, you can assume that 0 raised to the power of 0 is 1.
Problem approach

public double myPow(double x, int n) {
double result = 0;
if (n == 0) return 1;
else if (n == 1) return x;
else if (n == -1) return 1.0 / x;

if (n % 2 == 0) 
return myPow(x * x, n / 2);
else 
return x * myPow(x * x, (n - 1) / 2);
}

Try solving now
02
Round
Medium
Face to Face
Duration50 mins
Interview date4 Sep 2021
Coding problem2

It was Technical Interview. I have to log on to superset platform for this interview. The timing was morning 09:00 AM IST. 
Interviewer first asked me to Introduce myself. after that, he gave two DSA Questions that I was able to solve both question then he asked to optimize the code, I used Java to solve the questions. then he asked about projects, I explained my projects. I have had good Interview experience with him. he was very polite and helpful.

1. Reverse Linked List

Moderate
15m average time
85% success
0/80
Asked in companies
CIS - Cyber InfrastructureInfo Edge India (Naukri.com)Cisco

Given a singly linked list of integers. Your task is to return the head of the reversed linked list.

For example:
The given linked list is 1 -> 2 -> 3 -> 4-> NULL. Then the reverse linked list is 4 -> 3 -> 2 -> 1 -> NULL and the head of the reversed linked list will be 4.
Follow Up :
Can you solve this problem in O(N) time and O(1) space complexity?
Problem approach

Step 1 : First I gave him a recursive solution. The idea was to reach the last node of the linked list using recursion then start reversing the linked list. Time Complexity: O(N), for Visiting over every node one time
Auxiliary Space: O(N), for Function call stack space.
Step 2: Interviewer asked me to optimise the space complexity.
Step 3: then i gave a iterative solution that uses three pointers curr, prev, and forward to keep track of nodes to update reverse links. Time complexity: O(N). I have not used any extra space so Space complexity: O(1)

Try solving now

2. Remove Duplicates from Sorted Array

Easy
15m average time
85% success
0/40
Asked in companies
Tata Consultancy Services (TCS)Thought WorksGoldman Sachs

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


You need to remove the duplicates from the array such that each element appears only once.


Return the length of this new array.


Note:
Do not allocate extra space for another array. You need to do this by modifying the given input array in place with O(1) extra memory. 


For example:
'n' = 5, 'arr' = [1 2 2 2 3].
The new array will be [1 2 3].
So our answer is 3.
Problem approach

Step 1: I gave a solution using hashSet. I copied the array element each one by one in hashset. after this operation I copied all hashset element to new array and returned the array. Time complexity : O(N) and Space complexity : O(N). interviewer was happy with this solution did not ask to optimize it.

Try solving now
03
Round
Easy
HR Round
Duration30 mins
Interview date9 Sep 2021
Coding problem1

It was HR round, conducted in afternoon around 01:00 PM IST firstly HR asked my introduction, after that she verified my aadhar Card and 12th Marksheet. she also asked some typical HR round questions like why do you want to join Cognizant? In the end she asked " Are you okay with relocation with in India" I said yes. that's it. She was very happy with my answers. 
PS: I got selection mail from our College TPO after 3 weeks.

1. Basic HR Questions

Why do you want to join Cognizant?

Are you ok with relocation?

Problem approach

Tip 1: improve your soft skills
Tip 2: Keep your documents handy for showing to HR
Tip 3: prepare a good Introduction to give impression to HR

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
1409 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
812 views
0 comments
0 upvotes