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

SDE

Cognizant
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 2 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming, My SQL, Database
Tip
Tip

Tip 1 : Prepare some Projects
Tip 2 : Practice At least 250 Questions of DS algo
Tip 3 : Do at least 2 application based projects

Application process
Where: Campus
Eligibility: 7 CGPA
Resume Tip
Resume tip

Tip 1 : Add some application based projects in your resume.
Tip 2 : Do not put false things on resume.

Interview rounds

01
Round
Easy
Online Coding Interview
Duration180 minutes
Interview date1 Jul 2021
Coding problem2

Conceptual and Code Analysis based MCQ after that there was a coding challenge and Database queries.

1. Remove Duplicates

Easy
0/40
Asked in companies
CognizantPaytm (One97 Communications Limited)CIS - Cyber Infrastructure

Given a string S, remove consecutive duplicates from it recursively.

Problem approach

Create an auxiliary array temp[] to store unique elements.
Traverse input array and one by one copy unique elements of arr[] to temp[]. Also keep track of count of unique elements. Let this count be j.
Copy j elements from temp[] to arr[] and return j

Try solving now

2. Stock Span

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

Afzal has been working with an organization called 'Money Traders for the past few years. The organization is in the money trading business. His manager assigned him a task.


Given an array ’prices’ which denotes stock prices for ’n’ days, e.g., 'prices[ i ]' = price of the stock at ‘ith’ day, Find the stock's span for each day.


The span of the stock's price today is defined as the maximum number of consecutive days(starting from today and going backward) for which the price of the stock was less than today's price.


Example:
Input: ‘n’ = 7,  ‘prices’ = [100, 80, 60, 70, 60, 75, 85]

Output: [1, 1, 1, 2, 1, 4, 6]

Explanation: 
On the sixth day, when the stock price was 75, 

The span came out to be 4 because the last three prices(plus today) were less than the current or the sixth day's price.

Similarly, we can deduce the remaining results.
Note:
You don’t need to print anything. Just implement the given function
Problem approach

We see that S[i] on the day i can be easily computed if we know the closest day preceding i, such that the price is greater than on that day than the price on the day i. If such a day exists, let’s call it h(i), otherwise, we define h(i) = -1. 
The span is now computed as S[i] = i – h(i).

Try solving now
02
Round
Medium
Video Call
Duration45 minutes
Interview date1 Aug 2021
Coding problem2

I was asked some questions from DS algo + DBMS. Few Aptitude questions were asked and few questions on Project were also asked.

1. Cycle Detection in a Singly Linked List

Moderate
15m average time
80% success
0/80
Asked in companies
InformaticaUrban Company (UrbanClap)PhonePe

You are given a Singly Linked List of integers. Return true if it has a cycle, else return false.


A cycle occurs when a node's next points back to a previous node in the list.


Example:
In the given linked list, there is a cycle, hence we return true.

Sample Example 1

Problem approach

1. Traverse linked list using two pointers.
2. Move one pointer(slow_p) by one and another pointer(fast_p) by two.
3. If these pointers meet at the same node then there is a loop. If pointers do not meet then linked list doesn’t have a loop.

Try solving now

2. Check whether K-th bit is set or not

Easy
0/40
Asked in company
Cognizant

Given a number ‘N’ and a number ‘K’. Return true if ‘K’th bit of number is set, else return false.


Example:
Input: ‘N’ = 5, ‘K’ = 1

Output: YES

5 in binary can be written as 101 and as we can see a first bit from the right of 5 is set so the answer is 'YES'.
Problem approach

if((n&(1< print("Set")
}else{
print("Not set")
}

Try solving now
03
Round
Easy
HR Round
Duration20 minutes
Interview date15 Aug 2021
Coding problem1

Basic HR Questions were asked

1. Basic HR Questions

1. Introduction. 

2. Why do you want to join this organisation? 

3. Where do you see yourself in next 5 years?

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
2 rounds | 4 problems
Interviewed by Cognizant
918 views
0 comments
0 upvotes
company logo
SDE - 2
3 rounds | 5 problems
Interviewed by Cognizant
1063 views
0 comments
0 upvotes
company logo
Program Analyst
2 rounds | 6 problems
Interviewed by Cognizant
604 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
SDE
2 rounds | 6 problems
Interviewed by Tata Consultancy Services (TCS)
2132 views
0 comments
0 upvotes
company logo
SDE
3 rounds | 6 problems
Interviewed by Tata Consultancy Services (TCS)
1584 views
0 comments
0 upvotes
company logo
SDE
2 rounds | 3 problems
Interviewed by Tata Consultancy Services (TCS)
1039 views
0 comments
0 upvotes