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

SDE - 1

Cognizant
upvote
share-icon
2 rounds | 4 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 Aug 2021
Coding problem2

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

1. Pair Sum

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

You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to return the list of all pairs of elements such that each sum of elements of each pair equals 'S'.

Note:

Each pair should be sorted i.e the first value should be less than or equals to the second value. 

Return the list of pairs sorted in non-decreasing order of their first value. In case if two pairs have the same first value, the pair with a smaller second value should come first.
Problem approach

Sorting and Two-Pointers technique :-

Approach: A tricky approach to solve this problem can be to use the two-pointer technique. But for using two pointer technique, the array must be sorted. Once the array is sorted the two pointers can be taken which mark the beginning and end of the array respectively. If the sum is greater than the sum of those two elements, shift the right pointer to decrease the value of the required sum and if the sum is lesser than the required value, shift the left pointer to increase the value of the required sum.

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

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
02
Round
Easy
Face to Face
Duration45 minutes
Interview date1 Oct 2021
Coding problem2

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

1. Middle Of Linked List

Easy
20m average time
80% success
0/40
Asked in companies
NoBrokerSamsungCognizant

Given a singly linked list of 'N' nodes. The objective is to determine the middle node of a singly linked list. However, if the list has an even number of nodes, we return the second middle node.

Note:
1. If the list is empty, the function immediately returns None because there is no middle node to find.
2. If the list has only one node, then the only node in the list is trivially the middle node, and the function returns that node.
Problem approach

Traverse linked list using two pointers. Move one pointer by one and the other pointers by two. When the fast pointer reaches the end slow pointer will reach the middle of the linked list.

Try solving now

2. Puzzle

Suppose that you are trapped on the surface of a frozen lake. The surface is so smooth and ideal that there is no friction at all. You cant make any grip on the ice and no wind is blowing to help you out. You have just a mobile phone with you which has got no reception disabling you to call for help. How will you plan your escape before you freeze to death on the frozen lake?

Problem approach

Step-by-step explanation:

Well as there is no friction, the ice would be slippery. It would automatically make you slide towards the ends as there is no friction to stop you.

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