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

SDE - 1

Cognizant
upvote
share-icon
2 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 3 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1 : Solve Aptitude and Problem Solving Books.
Tip 2 : Practice Coding questions from geek for geeks.

Application process
Where: Campus
Eligibility: No Criteria
Resume Tip
Resume tip

Tip 1 : Have some projects on resume.
Tip 2 : Do not put false things on resume.

Interview rounds

01
Round
Hard
Online Coding Test
Duration60 Minutes
Interview date10 Feb 2022
Coding problem5

- Morning time
- Environment was good.
- No
- Interviewer was good

1. Check Equations

Moderate
0/80
Asked in company
Cognizant
You are given a list of comparison equations, where each equation is in the form of “a!=b” or “a==b”. Your task is to check if all the equations satisfy or not and print the boolean value accordingly.
Note:
All the variables in the equations are lower case English alphabets.
For Example:
You are given ‘equations’ = [‘a==b’, ‘a==c’, ‘b!=c’], here ‘a’ is equal to ‘b’ and ‘c’ so by associative law ‘b’, and ‘c’ must be equal, but it is given ‘b!=c’. Hence all the equations do not hold. Therefore the answer is False.
Try solving now

2. Minimum days to complete work

Easy
15m average time
90% success
0/40
Asked in companies
IBMCognizantOptum

We have to complete a total of ‘N’ works. Now, each work can be done on only one of the two special days given in 2 different arrays ‘day1’ and ‘day2’ respectively.

day1[i] denotes that the ‘i-th’ work can on the day1[i] th day and day2[i] denotes that the ‘i-th’ work can on the day2[i] th day. Also, it is guaranteed that day2[i] < day1[i].

Also, make sure, the works are being done in such a way that they must be in non-decreasing order in terms of days given in array ‘day1’.

Your task is to find the minimum number of days in which all the work can be completed.

For example
day1 = {5, 6, 2}
day2 = {2, 4, 1}

In this case, the ideal order will be to perform work 3 on the first day, work 1 on the second day and work 2 on the fourth day. The order with respect to Day1 in which the work is done will be {2, 5, 6} which is non-decreasing. Hence the number of days needed to finish all work will be 4.
Try solving now

3. Busy Ninja

Moderate
20m average time
80% success
0/80
Asked in companies
OYOUberCognizant

Ninja is doing an offline course that has a duration of ‘N’ days. After attending the course, the ninja gains some experience ‘EXP[i]’ (for the day ‘i’). On some days, the ninja is busy and will not be able to attend the course, hence not gaining any experience on that day. If ‘BUSY[i] = 1’, then the ninja is busy on day ‘i’. Otherwise, if ‘BUSY[i] = 0’, the ninja attends the course on day ‘i’. To get the most out of the course, the ninja can focus for ‘K’ days straight (only once during the course), attending the course every day for these ‘K’ consecutive days. You are given two arrays, ‘EXP’ and ‘BUSY’, each of size ‘N’. You are also given an integer ‘K’. The task is to find the maximum experience that the ninja can gain from this course.

Example :
‘N’ = 6, ‘K’ = 3
‘EXP’ = [1, 4, 2, 2, 3, 6]
‘BUSY’ = [0, 1, 1, 0, 0, 1]
To get the maximum experience ninja has to focus on the last ‘3’ days. The maximum experience gained will be = 1 + 2 + 3 + 6 = 12. So, the answer is 12.
Try solving now

4. Gold mine problem

Moderate
35m average time
70% success
0/80
Asked in companies
Tata Consultancy Services (TCS)Goldman SachsAmazon

You have been given a gold mine represented by a 2-d matrix of size ('N' * 'M') 'N' rows and 'M' columns. Each field/cell in this mine contains a positive integer, the amount of gold in kgs.

Initially, the miner is at the first column but can be at any row.

He can move only right, right up, or right down. That is from a given cell and the miner can move to the cell diagonally up towards the right or right or diagonally down towards the right.

Find out the maximum amount of gold he can collect.

Try solving now

5. Maximum In Sliding Windows Of Size K

Moderate
20m average time
80% success
0/80
Asked in companies
QuikrHCL TechnologiesGoldman Sachs

Given an array/list of integers of length ‘N’, there is a sliding window of size ‘K’ which moves from the beginning of the array, to the very end. You can only see the ‘K’ numbers in a particular window at a time. For each of the 'N'-'K'+1 different windows thus formed, you are supposed to return the maximum element in each of them, from the given array/list.

Problem approach

s1- Explanation
The subarrays of size x = 1 are [1],[2],[3],[1], and [2],
s2- Because each subarray only contains 1 element, each value is minimal with respect to the subarray it is in. The maximum of these values is 3. Therefore, the answer is 3

Try solving now
02
Round
Easy
HR Round
Duration30 Minutes
Interview date8 Jun 2022
Coding problem1

- Morning time
- Environment was good.
- No
- Interviewer was good

1. Basic HR Questions

1 Why did you decide to apply to this role?
2. What experience do you have that would be relevant to this role?
3. Tell me about your experience in …
4. What did you like most about the job description?
5. Why are you leaving your current job? / Why did you leave your previous job?
6. What do you know about our company’s product/services?
7. Tell me about this gap in your resume.
8. Describe the workplace where you’ll be most happy and productive.
9. What are your salary expectations?
10. Do you have any questions?

Problem approach

Tip 1 : Communicate in a good manner
Tip 2 : Show your strength
Tip 3 : Practice of speaking

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 - 1
2 rounds | 6 problems
Interviewed by Cognizant
1760 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 6 problems
Interviewed by Cognizant
1798 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 9 problems
Interviewed by Cognizant
909 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
1 rounds | 2 problems
Interviewed by Tata Consultancy Services (TCS)
0 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 4 problems
Interviewed by Tata Consultancy Services (TCS)
6877 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 3 problems
Interviewed by BNY Mellon
6240 views
3 comments
0 upvotes