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

SDE

Cognizant
upvote
share-icon
2 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 2 months
Topics: Data structure and Algorithms, Competition Programming, DBMS, OOPS, System Design
Tip
Tip

Tip 1 : Clear all basics
Tip 2 : Focus on DSA 
Tip 3 : Solve at least 200 problems

Application process
Where: Campus
Eligibility: 6.5 CGPA, no current backlogs
Resume Tip
Resume tip

Tip 1 : At least 2 projects
Tip 2 : Do write internships

Interview rounds

01
Round
Easy
Online Coding Interview
Duration45 minutes
Interview date13 Sep 2021
Coding problem2

45 min 
Proctored environment

1. Balanced parentheses

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

Given an integer ‘N’ representing the number of pairs of parentheses, Find all the possible combinations of balanced parentheses with the given number of pairs of parentheses.

Note :

Conditions for valid parentheses:
1. All open brackets must be closed by the closing brackets.

2. Open brackets must be closed in the correct order.

For Example :

()()()() is a valid parentheses.
)()()( is not a valid parentheses.
Problem approach

My Approach
Declare a character stack S.
Now traverse the expression string exp. 
If the current character is a starting bracket (‘(‘ or ‘{‘ or ‘[‘) then push it to stack.
If the current character is a closing bracket (‘)’ or ‘}’ or ‘]’) then pop from stack and if the popped character is the matching starting bracket then fine else brackets are not balanced.
After complete traversal, if there is some starting bracket left in stack then “not balanced”

Try solving now

2. Valid Parentheses

Easy
10m average time
80% success
0/40
Asked in companies
OracleSwiggyAmerican Express

You're given a string 'S' consisting of "{", "}", "(", ")", "[" and "]" .


Return true if the given string 'S' is balanced, else return false.


For example:
'S' = "{}()".

There is always an opening brace before a closing brace i.e. '{' before '}', '(' before ').
So the 'S' is Balanced.
Try solving now
02
Round
Medium
HR Round
Duration30 minutes
Interview date11 Nov 2021
Coding problem2

Face to face HR interview
Make short and simple resume 
Add projects and internships

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. Intersection of Linked Lists

Easy
20m average time
70% success
0/40
Asked in companies
IntuitAmazonWalmart

You are given two linked lists L1 and L2 which are sorted in ascending order. You have to make a linked list with the elements which are present in both the linked lists and are present in ascending order.

Example:-
L1 = 1->2->3->4->7
L2 = 2->4->6->7

ANSWER:- The answer should be 2->4->7 because 2,4, and 7 are present in both the linked lists.
Try solving now

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
3 rounds | 5 problems
Interviewed by Cognizant
0 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
772 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)
1583 views
0 comments
0 upvotes
company logo
SDE
2 rounds | 3 problems
Interviewed by Tata Consultancy Services (TCS)
1038 views
0 comments
0 upvotes