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

Data Analyst

Cognizant
upvote
share-icon
3 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 4 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1 - Practice at least 50 Questions
Tip 2 - Do at least 1 project

Application process
Where: Campus
Eligibility: No criteria
Resume Tip
Resume tip

Tip 1 : Mention good projects and only those skills in which you are confident.
Tip 2 : Do not put false things on resume.

Interview rounds

01
Round
Medium
Online Coding Test
Duration60 minutes
Interview date14 Apr 2022
Coding problem3

- Morning time
- Environment was good.
- No
- Interviewer was good

1. Perfect Rectangle

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

You are given N rectangles whose sides are aligned with the x-axis and the y-axis. Each rectangle is represented by 4 integers [ a, b, c ,d ]. Here, (a, b) are x and y coordinates of the bottom left corner, and (c, d) are x and y coordinates of the top right corner.

You need to find if they all together form a rectangular region cover.

For Example :
If the given rectangle is [1, 1, 3, 2]. It means the bottom left corner is at [1, 1] and the top right corner is at [3, 2]. Hence, the top left corner is at [1, 2] and the bottom right corner is at [3, 1].

For the given figure is for N = 4, rectangle[0] = [1, 1, 4, 5], rectangle[1] = [4, 1, 6, 2], rectangle[3] = [4, 2, 6, 5], rectangle[4] = [6, 1, 8, 5].

alt text

As they all form a big rectangle [1, 1, 8, 5]. So, the answer is 1.

Note :

Two integers are used to represent Point - x and y coordinates.

Two points are used to represent a Rectangle - Bottom left corner and top right corner.
Problem approach

s1 - There are three golden rectangles: (165, 100), (170, 100), (160, 100).
s2 - I applied matrix multiplication 
s3 - Interviewer satisfied for this approach

Try solving now

2. Count of paths

Hard
50m average time
60% success
0/120
Asked in companies
DirectiCognizant

Given a sequence of N integers: arr0, arr1, arr2, ….. arrN-1 and an integer K

K is divisible by all the array elements, ie: K % arri = 0 for (0 <= i <= N-1).

A directed graph is built using this sequence. A directed edge from the jth to the ith array element exists if j < i and ai is divisible by aj, ie: ai % aj = 0.

Find the count of different paths from 0th element to ith element for 0 <= i <= N-1. As the answer can be very large, return answer modulo 109+7.

 

Problem approach

s1 - The points shown are the points on or in the specified square.
s2 - Those that are red are the points that the frog could be at after seconds 6.

Try solving now

3. Maximum Difference

Moderate
30m average time
85% success
0/80
Asked in companies
MicrosoftExpedia GroupHike

Given an n x n matrix mat[n][n] of integers, find the maximum value of mat[c][d] – mat[a][b] over all choices of indexes such that both c > a and d > b.

Example:-

1 2 3 4 
5 6 7 8
1 9 2 3

In this example, the maximum value is 8 (mat[2][1]-mat[0][0]).
Try solving now
02
Round
Medium
Face to Face
Duration30 minutes
Interview date12 May 2022
Coding problem2

- Morning time
- Environment was good.
- No
- Interviewer was good

1. Flower Shop

Easy
0/40
Asked in companies
ArcesiumCognizantCuemath

Oasis visits a Florist Shop. Shop has N flowers each being of a specific type and every flower costs 1 unit.

You are given type of each flower in an array P = [p1,p2,...,pN]. If he buys a flower of type P’ , then he will get all flowers whose type lies between P’ to P’+4 (both inclusive) for free.

You need to find and print the price Oasis has to pay to buy all flowers.

Problem approach

s1 - Query 1: we have to buy exactly pots. There are six possible options: [1,2]
s2 - Buy pot of first kind, pots of second kind. The cost is 6 .
Buy pot of first kind, pots of second kind. The cost is: 60 .

Try solving now

2. Maximum Sum

Moderate
35m average time
70% success
0/80
Asked in companies
DunzoAdobeArcesium

You are given an array “ARR” of N integers. You are required to perform an operation on the array each time until it becomes empty. The operation is to select an element from the array(let’s say at ith index i.e ARR[i]) and remove one occurrence of the selected element from the array and remove all the occurrences of (ARR[i]-1) and (ARR[i]+1) from the array(if present). Your task is to maximize the sum of selected elements from the array.

For example, let’s say the given array is [2, 3, 3, 3, 4, 5].

The maximum possible sum for the given array would be 14. Because if we select one of the 3’s from the array, then one 3 and all occurrences of (3-1) and (3+1) i.e 2 and 4 will be deleted from the array. Now we left with {3,3,5} elements in the array. Then again we select 3 in the next two steps and in both steps 3 will be deleted also (3-1) and (3+1) doesn't exist in the array so nothing extra to delete in both steps. Now we left with only {5} and in the next step, we select the 5 and delete it. Then the array becomes empty. Thus the sum of selected elements will be 3+3+3+5 = 14.

Try solving now
03
Round
Medium
HR Round
Duration30 minutes
Interview date6 May 2022
Coding problem1

- Morning time
- Environment was good.
- No
- Interviewer was good

1. Basic HR Questions

1. Tell me about yourself?
2. Why are you interested in this position? 
3. Why are you leaving your current job? 
4. Can you describe a work or school instance in which you messed up?
5. Tell me about a time when you experienced conflict with a co-worker and how you dealt with it.

Problem approach

Tip 1 : Keep your eye contact in front
Tip 2 : Speak and dress well.
Tip 3 : Communication should be good

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
Programmer Analyst Trainee
2 rounds | 3 problems
Interviewed by Cognizant
1409 views
0 comments
0 upvotes
company logo
Genc Next
2 rounds | 7 problems
Interviewed by Cognizant
1734 views
0 comments
0 upvotes
company logo
Frontend Developer
3 rounds | 7 problems
Interviewed by Cognizant
2408 views
0 comments
0 upvotes
company logo
Programmer Analyst
3 rounds | 8 problems
Interviewed by Cognizant
952 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Data Analyst
2 rounds | 3 problems
Interviewed by Tata Consultancy Services (TCS)
0 views
0 comments
0 upvotes