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

SDE - 1

Cognizant
upvote
share-icon
3 rounds | 3 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 12 Months
Topics: Data Structures, Python, Networking, Operating System, Oops Concept, DBMS
Tip
Tip

Tip 1 : Practice Data Structures Algorithms
Tip 2 : Practice atleast one programming language
Tip 3 : Practice SQL commands

Application process
Where: Campus
Eligibility: Overall 60%, no active backlogs, no year gap
Resume Tip
Resume tip

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

Interview rounds

01
Round
Easy
Online Coding Interview
Duration90 minutes
Interview date2 Sep 2019
Coding problem1

1. Huffman Coding

Moderate
25m average time
75% success
0/80
Asked in companies
CognizantMedia.netZS

You are given an array 'ARR' of Integers having 'N' elements. The array contains an encoded message. For each index 'i', 'ARR[i]' denotes the frequency of the 'i'th' character in the message. The characters are of an alien language having 'N' alphabets. Given the frequency of each of the 'N' alphabets in the message, your task is to find out the Huffman codes for each of the 'N' alphabets in the message.

The Huffman Code for a message is the set of codes such that :

1) All codes are binary strings.
2) Each code should be able to determine its corresponding character uniquely.
3) The total numbers of bits used to represent the message are minimized.

Note:

If there are multiple sets of valid Huffman codes for a message. You can print any of them.

For example:

Consider the array ARR = [ 1, 4, 2 ] having 3 elements. 
The array containing Huffman Codes for the above array will be [ '10', '0', '11' ]. Other Valid Huffman Codes are [ '01', '1', '00' ], [ '00', '1', '01' ] etc. Codes like [ '1', '0', '01' ], [ '1', '10' , '0' ] are some of the invalid Huffman Codes.
Try solving now
02
Round
Medium
Face to Face
Duration60 Minutes
Interview date14 Sep 2019
Coding problem1

1. Second largest element in the array

Easy
15m average time
80% success
0/40
Asked in companies
AdobeTata Consultancy Services (TCS)Samsung

You have been given an array/list 'ARR' of integers. Your task is to find the second largest element present in the 'ARR'.

Note:
a) Duplicate elements may be present.

b) If no such element is present return -1.
Example:
Input: Given a sequence of five numbers 2, 4, 5, 6, 8.

Output:  6

Explanation:
In the given sequence of numbers, number 8 is the largest element, followed by number 6 which is the second-largest element. Hence we return number 6 which is the second-largest element in the sequence.
Problem approach

1. Sort the array
2. Check for largest number
3. Check if the number next to largest number is equal to the number, if yes check for other number in the series until the next number is not equal to the largest number

Try solving now
03
Round
Easy
HR Round
Duration30 Minutes
Interview date14 Sep 2019
Coding problem1

1. Basic HR Questions

Why do you want to join Cognizant?
Will you be able to relocate?

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