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

Programmer Analyst Trainee

Cognizant
upvote
share-icon
3 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Journey
I started preparing from very basic i first started with c++ from YouTube and then started going deep with data structures and algorithms. Resources i used : YouTube,leetcode , geekforgeek.
Application story
So i joined this channel "techandtarget" on telegram. This person is doing an excellent job he post job opportunities explaining everything about the in his YouTube video.
Why selected/rejected for the role?
As my coding was good and was practicing my coding on leetcode so it helped me alot to crack this job.
Preparation
Duration: 2 months
Topics: Object oriented programming, Aptitude, database, data structures, Operating system
Tip
Tip

Tip 1 : Start with very basic such as choose any language that you like and have a command over that language.
Tip 2 : Once you have command over a particular language start with data structures and choose any resource from which you understand best in my case it was youtube i did my 90% of preparation on YouTube l.
Tip 3 : Once you have a fine knowledge about all the data structures and can choose any platform to practice your coding skill. In my case i was practicing on leetcode.com

Application process
Where: Other
Eligibility: Only technical degree required.
Resume Tip
Resume tip

Tip 1 : Only mention those skill in which you have knowledge that if any questions asked atleast you are able to frame the answer.
Tip 2 : Try explaining a bit about the project done.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration100min
Interview date11 Nov 2021
Coding problem1

1. Find all occurrences

Moderate
35m average time
60% success
0/80
Asked in companies
OracleTata Consultancy Services (TCS)HackerEarth

You are given a 'M' x 'N' matrix of characters, 'CHARACTER_MATRIX' and a string 'WORD'. Your task is to find and print all occurrences of the string in the given character matrix. You are allowed to search the string in all eight possible directions, i.e. North, South, East, West, North-East, North-West, South-East, South-West.

Note: There should not be any cycle in the output path. The entire string must lie inside the matrix boundary. You should not jump across boundaries, i.e. from row 'N' - 1 to 0 or column 'N' - 1 to 0 or vice versa.

Example:

Consider below matrix of characters,
[ 'D', 'E', 'X', 'X', 'X' ]
[ 'X', 'O', 'E', 'X', 'E' ] 
[ 'D', 'D', 'C', 'O', 'D' ]
[ 'E', 'X', 'E', 'D', 'X' ]
[ 'C', 'X', 'X', 'E', 'X' ]

If the given string is "CODE", below are all its occurrences in the matrix:

'C'(2, 2) 'O'(1, 1) 'D'(0, 0) 'E'(0, 1)
'C'(2, 2) 'O'(1, 1) 'D'(2, 0) 'E'(3, 0)
'C'(2, 2) 'O'(1, 1) 'D'(2, 1) 'E'(1, 2)
'C'(2, 2) 'O'(1, 1) 'D'(2, 1) 'E'(3, 0)
'C'(2, 2) 'O'(1, 1) 'D'(2, 1) 'E'(3, 2)
'C'(2, 2) 'O'(2, 3) 'D'(2, 4) 'E'(1, 4)
'C'(2, 2) 'O'(2, 3) 'D'(3, 3) 'E'(3, 2)
'C'(2, 2) 'O'(2, 3) 'D'(3, 3) 'E'(4, 3)
Problem approach

So to solve this problem i used hashmap .
And and in hashmap i stored occurrences of every character and in the end i simply retured the occurrence for the character asked.

Try solving now
02
Round
Medium
Face to Face
Duration30 mins
Interview date21 Nov 2021
Coding problem2

1. Maximum Number

Easy
15m average time
85% success
0/40
Asked in companies
FacebookWalmartJP Morgan

You are given an array of N elements. This array represents the digits of a number. In an operation, you can swap the value at any two indices. Your task is to find the maximum number by using operation at most once.

For Example :

Input array [1,3,2,7] so basically this array represents the number 1327.
All the possible combinations are :
1. [3 1 2 7] get by swapping indices 1 and 2.
2. [2 3 1 7] get by swapping indices 1 and 3.
3. [7 3 2 1] get by swapping indices 1 and 4.
4. [1 2 3 7] get by swapping indices  2 and 3.
5. [1 7 2 3] get by swapping indices 2 and 4.
6. [1 3 7 2] get by swapping indices 3 and 4.
Out of all the possible combinations, 3 give the maximum number as 7321, so we will return [7 3 2 1].

Note :

The input may have 0 before the most significant digit. e.g. [0,3,5,7] is a valid input and this represents number 357.
Problem approach

I simply used if else condition to find the greatest among those three given integers.

Try solving now

2. Puzzle

Question was to find the day after 45 days if today is Monday.

Problem approach

Tip 1 : Just keep on practicing on daily basis.

03
Round
Easy
HR Round
Duration5 mins
Interview date25 Jan 2023
Coding problem1

1. Basic HR Questions

She first asked to introduce myself and then she just simply asked what location i wanted. And that was it

Problem approach

Tip 1:Just say confidentially 

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