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

Software Engineer

Cognizant
upvote
share-icon
4 rounds | 8 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 4 Months
Topics: Java, OOPS, Data Structures, Algorithms, DBMS, SQL, Full Stack (Spring Boot, Angular)
Tip
Tip

Tip 1 : Practice at least 250 DSA Questions from Leetcode or any other similar platforms, as the Assessment is going to be very difficult
Tip 2 : Practice at least 50 SQL Questions for the Assessment
Tip 3 : Do at least 3 projects in-depth on the tech stack you are selecting during the application process
Tip 4 : Be sure you know the basics about which tech stack you are selecting during the application process

Application process
Where: Campus
Eligibility: Above 60%
Resume Tip
Resume tip

Tip 1 : As the application is based on a tech stack. Have at least three or more projects on your resume
Tip 2 : If you have any certificate of a specific tech stack please mention it on your resume
Tip 3 : If you have Internship experience feel free to mention it, It will give an extra value
Tip 4 : Do not put false things on your resume, because high chance technical interview will be resume based

Interview rounds

01
Round
Hard
Online Coding Interview
Duration180 Minutes
Interview date14 Aug 2021
Coding problem4

Technical Skill Based Assessment ( 40 mins MCQ + 140 mins Coding)
25 MCQ questions of medium level based on Java, OOPS, DSA, DBMS, HTML-CSS, JDBC, etc 
6 Coding questions, 4 are DSA Based and 2 are from SQL
-> 4 DSA Based questions are medium to hard level 2 from Array, 1 DP, and 1 Graph
-> And 2 SQL questions are also medium level using nested queries and joins

1. Max Sum After 'K' Negations

Easy
15m average time
85% success
0/40
Asked in companies
IntuitCognizantSamsung R&D Institute

You are given an array/list ‘arr’ of size ‘N’. Find the maximum sum of the elements of the array you can obtain after flipping the sign of exactly ‘K’ elements

For example :
Let arr = [-2, 0, 5, -1, 2]
and K = 4

We will output 10 as we replace -2 by 2, -1 by 1, 0 by 0, and 0 by 0.
Note :
We can apply the flip operation to the same element multiple times
Try solving now

2. Concert Tickets

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

There is a song concert going to happen in the city. There are ‘N’ tickets available for the concert each with a certain price. The prices of ‘N’ tickets are given in an ‘N’ sized ‘price’ array. There are ‘M’ customers which come one by one in order to buy a ticket. Each customer offers a maximum price he or she can pay to buy a ticket. The maximum price offered by ‘M’ customers are given in an ‘M’ sized ‘pay’ array. The customer will get the ticket at the nearest possible price which will not exceed their offered maximum price. Your task is to return the price at which each customer will buy a ticket. If a particular is not able to buy the ticket, then consider -1 as the ticket cost in that case.

Try solving now

3. Candies

Moderate
10m average time
90% success
0/80
Asked in companies
MicrosoftOYOMorgan Stanley

Prateek is a kindergarten teacher. He wants to give some candies to the children in his class. All the children stand in a line and each of them has a grade according to his or her performance in the class. Prateek wants to give at least one candy to each child. If two children are standing adjacent to each other, then the one with the higher rating must get more candies than the other. Prateek wants to minimize the total number of candies he must buy.

Given an array 'STUDENTS' of size 'N' that contains the grades for each student, your task is to find what is the minimum number of candies Prateek must buy so that he can distribute them among his students according to the criteria given above.

Example :

Given students' ratings : [5, 8, 1, 5, 9, 4]. 
He gives the students candy in the following minimal amounts : [1, 2, 1, 2, 3, 1]. He must buy a minimum of 10 candies.

Note :

1. If two students having the same grade are standing next to each other, they may receive the same number of candies.
2. Every student must get at least a candy.
Try solving now

4. Minimum Travel Time

Hard
35m average time
55% success
0/120
Asked in companies
CognizantMAQ Software

Mr. X is planning to visit Ninja Land. Ninja Land has 'N' cities numbered from 1 to 'N' and 'M' bidirectional roads. Each road connects two of the 'N' cities, and no two cities have multiple roads between them. Mr. X wants to visit all the 'M' roads and 'N' cities of Ninja land. To do so, he can arbitrarily select any city as the starting city, travel through all the roads, and should end his journey in the same city which he selected as the starting city.

Given the description of each of the 'M' roads i.e, the two 2 cities that the road connects, and the time it takes to travel between the two cities. Your task is to find the minimum time that Mr. X will take to visit all the roads satisfying the above conditions.

If there is no possible way to travel all the roads, then return -1.

Try solving now
02
Round
Medium
Face to Face
Duration60 Minutes
Interview date26 Aug 2021
Coding problem2

The online face-to-face interview round was held on the Superset platform, and the timeslot given to me was from 10.30 am to 12 pm.
The round was really smooth. And the difficulty level is based on your resume and your knowledge. 
The questions were DSA problems and resume-based for almost all the candidates from my college. 


The interview starts with a warm welcome and introduction from both sides. 

As I had some internship experience mentioned on my resume, and I had many contributions on Git, So
-> the first question he asked me was What is Git Conflict and How to resolve it. He was not expecting the perfect answer from me, he just wanted to know what I can answer from my basic knowledge. But I managed to answer. 
->The next question he asked me was how I push an existing project to the git repo, that was pretty easy for me, and I answered with all the steps.


He was impressed with one of my personal projects, So, he asked me to explain it, and asked me several in-depth questions about it.
While explaining your project try to 
-> give an architectural overview of your project, 
-> what was the real-life problem solved by your project, 
-> and also try to explain the libraries and modules you have used in your project, what the alternatives were available for that task, and why you choose them.
-> and what are the future plans or improvements you are planning with it

Then he asked me which language I'm comfortable to code, I choose java. There was an online live compiler, he can see what I write. He gave me two coding problems( leetcode medium) and I managed to solve both of them, try to optimize it as much as you can on your first attempt, because you will not get too much time for 2 or 3 attempts, and try to maintain the speed while coding.

After the coding questions, he asked me some questions and my experience during my SDE Internship, He was interested to know the project I have worked on, and what are the responsibilities I had. And also asked me some technical situation-based questions which I managed to answer with my experience.

While the application process I choose my tech stack as Full Stack Java, and some Full Stack Java Udemy Certificates are there on my resume, so he started asking some basic questions about Full Stack Development. And asked me some questions about OOPs and DBMS like transaction, and normalization. (OOPs questions are application and situation-based)

And at the end he asked me if I know about any Cloud Services, So, I mentioned AWS, which I have worked on in my internship. And he asked me some basic questions about AWS, he just wanted to know what type of AWS services I have worked on in my internship. 

And after that, the time was over, So, he asked me without interview feedback anything I want to know from him. I asked some questions which I was curious about. As his mood was really well after the interview, we spend another 10 mins to discuss on my question. And one tip, try to avoid random questions from the internet.

It was not just an interview it was a lovely conversation and experience-sharing session for me.

1. Color Value of Graph

Hard
0/120
Asked in companies
AppleCognizantHCL INFOSYSTEM

You are given a directed graph, with ‘N’ nodes and each node labelled from 0 to ‘N - 1’. You are also given a ‘colour’ array, where ‘colour [i]’ represents the colour of ‘ith’ node. The Colour value of a path is the frequency of the most frequently occurring colour in the path. Your task is to find the maximum colour value of all the valid paths in the graph, or return -1 if there exists a cycle.

Note:
The graph is connected.
For example:
You are given the following graph:

altText

Here the path 0->1->2 has the colour value of 3, which is the maximum colour value of the graph. Hence the answer is 3.
Try solving now

2. Container With Most Water

Moderate
15m average time
90% success
0/80
Asked in companies
ProtiumOracleGoldman Sachs

Given a sequence of ‘N’ space-separated non-negative integers A[1],A[2],A[3],......A[i]…...A[n]. Where each number of the sequence represents the height of the line drawn at point 'i'. Hence on the cartesian plane, each line is drawn from coordinate ('i',0) to coordinate ('i', 'A[i]'), here ‘i’ ranges from 1 to ‘N’. Find two lines, which, together with the x-axis forms a container, such that the container contains the most area of water.

Note :
1. You can not slant the container i.e. the height of the water is equal to the minimum height of the two lines which define the container.

2. Do not print anything, you just need to return the area of the container with maximum water.
Example

water-diagram

For the above Diagram, the first red marked line is formed between coordinates (2,0) and (2,10), and the second red-marked line is formed between coordinates (5,0) and (5,9). The area of water contained between these two lines is (height* width) = (5-2)* 9 = 27, which is the maximum area contained between any two lines present on the plane. So in this case, we will return 3* 9=27.
Problem approach

class Solution {
public int maxArea(int[] height) {
int left = 0, right = height.length - 1;
int maxArea = 0;

while (left < right) {
maxArea = Math.max(maxArea, Math.min(height[left], height[right])
* (right - left));
if (height[left] < height[right])
left++;
else
right--;
}

return maxArea;
}
}

Try solving now
03
Round
Easy
HR Round
Duration20 Minutes
Interview date26 Aug 2021
Coding problem1

The online face-to-face HR interview round was held on the Superset platform. They check the communication and behavior skills of candidates really well. This round happened after almost 45 mins of the Technical Interview round. This round happened for only those candidates who cleared the previous Technical Interview Round.

1. Basic HR Questions

1. Tell me about yourself. 

2. Why do you want to work for our company? 

3. Where do you see yourself in 5 years? 

4. Tell me about a time where you experienced difficulty at work while working on a project. 

5. How did you handle disagreements with your manager? etc

 

Problem approach

Tip 1 : Introduction tells many things about you. So, try to highlight your achievements 
Tip 2 : Try to answer in a positive way
Tip 3 : Try to answer from your past experiences, don't just copy-paste the same answer from Google
Tip 4 : Try to be honest while answering and don't tell them paragraphs, say to-the-point answers

04
Round
Easy
HR Round
Duration15 Minutes
Interview date3 Sep 2021
Coding problem1

The online face-to-face HR interview round was held on the Superset platform. Those who have cleared the previous HR round got mail for this round after a few days. This round is just to take some information about you and just a normal verification round.

1. Basic HR Questions

1. Tell me about yourself. 

2. If you know any foreign language 

3. Are you interested in an Internship with us before FTE in the 8th Semester 

4. If you can relocate to any location etc

Problem approach

Tip 1 : Try to be honest while answering

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
Software Engineer
2 rounds | 4 problems
Interviewed by Cognizant
1200 views
0 comments
0 upvotes
company logo
Software Engineer
3 rounds | 3 problems
Interviewed by Cognizant
1043 views
0 comments
0 upvotes
company logo
Software Engineer
2 rounds | 3 problems
Interviewed by Cognizant
974 views
0 comments
0 upvotes
company logo
Software Engineer
3 rounds | 6 problems
Interviewed by Cognizant
889 views
2 comments
0 upvotes
Companies with similar interview experiences
company logo
Software Engineer
4 rounds | 1 problems
Interviewed by Newgen Software
3195 views
2 comments
0 upvotes
company logo
Software Engineer
3 rounds | 6 problems
Interviewed by HashedIn
2574 views
0 comments
0 upvotes
company logo
Software Engineer
2 rounds | 2 problems
Interviewed by Ernst & Young (EY)
0 views
0 comments
0 upvotes