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

Software Engineer

ZS
upvote
share-icon
4 rounds | 7 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 2.5 months
Topics: Data Structures, OOPS, SQL, DBMS, Operating Systems, Dynamic Programming
Tip
Tip

Tip 1 : Keep a good hold on basics of Arrays and Strings and basic knowledge of every data structure like Linked list, Stack, Queue, Binary Tree, Binary Search Tree and Graph.
Tip 2 : Practice Questions of Famous Data Structures like Arrays, Strings, Linked list, Binary tree and BST as much as you can!
Tip 3 : Be Confident and keep a smile on your face throughout the interview.

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

Tip 1 : Prepare your projects thoroughly! 
Tip 2 : Don't put so many things in your resume, which you don't even know about.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 minutes
Interview date13 Sep 2022
Coding problem2

Round consists of 4 sections,
Section 1 consists of Mcq's related to OOPS.
Section 2 consists of Mcq's related to JavaScript.
Section 3 consists of Mcq's related to SQL.
Section 4 consists of 2 coding Questions out of which one was moderate difficulty and other was of Hard difficulty.

1. Break The Prison

Moderate
0/80
Asked in companies
ZSMicrosoftInnovaccer

Ninja has been caged up in a prison and he is planning to escape from it. The prison's gate consists of horizontal and vertical bars that are spaced one unit apart, so the area of each hole between the bars is (1 * 1). Ninja manages to remove certain bars and make some of these holes bigger. Your task is to determine the area of the largest hole in the gate after the bars are removed.

For example, let us consider that the initial prison gate with ‘n’ = 8 horizontal and ‘m’ = 8 vertical bars, where the area of the biggest hole in the bars is (1 * 1). If we remove the 4th horizontal bar and 6th vertical bar, then our maximum area will be (2 * 2).

Problem approach

The solution is quite simple if the height of wall is less than or equal to x, only one jump in that wall is required else we can calculate it by height of wall-(climb up-climb down) and get the jumps required.

Try solving now

2. Shortest Substring with all characters

Easy
0/40
Asked in companies
AmazonZSUnthinkable Solutions

You have been given a string 'S' which only consists of lowercase English-Alphabet letters. Your task is to find the shortest (minimum length) substring from 'S' which contains all the characters of 'S' at least once.

Note:

If there are more than one substring with the shortest length, then find one which appears earlier in the string ‘S’ i.e. substring whose starting index is lowest.
For example:
If the given string ‘S’ = "abcba", then the possible substrings having all the characters of ‘S’ at least once and of minimum length are "abc" and "cba". 

As "abc" starts with a lower index (i.e. 0, "cba" starts with index 2), we will return the string "abc" as our shortest substring that contains all characters of 'S'.
Problem approach

I stored all the characters from string S to an unordered_map mp.
I took 3 variables, ans(to store the size of the minimum substring), start(to store the start index) & count(to store the map size, if it became 0 that means we got a substring)
Now taking 2 pointers i & j, I iterated using j & decremented the element count in map.
if at any point the value became 0 that means we got all the elements of that char till now, so we’ll decrement the size of the count.
In this way, we will decrement and once the count will be 0 if there is a substring with all the elements present.
Now we’ll increment i and check if there is possible to remove any more characters and get smaller substrings.
We’ll store the smaller length to ans & store the ith index in the start variable. Also, we’ll add the element to our map and increment the count variable if it became greater than 0.
Now if the ans have some length except int_max, then return the substring from start index to length of ans. Else return empty string.
Time complexity: O(m), where m is the length of string S.

Try solving now
02
Round
Medium
Coding Test - Pen and paper
Duration60 minutes
Interview date15 Sep 2022
Coding problem2

This was basically a Case Study Round, Three questions were given to us out of which we have to do any two.
One question was of Algorithms, second was of Data structures and the third was of DBMS.
We didn't had to write the whole code, just pseudo code works too.
This was an non elimination round.

1. Largest Square

Moderate
20m average time
80% success
0/80
Asked in companies
HCL TechnologiesZSDeutsche Bank

You are given a binary grid containing only 0s and 1s. You are also given an integer, ‘K’ and you are asked ‘Q’ queries. In each query, you are given the location of a cell. For each query, you need to find the largest square containing at most ‘K’ 1s and having its center as the cell given in the query.

Problem approach

Create auxiliary horizontal and vertical arrays first

Then starting from bottom right for every i, j ; we find small=min (ver[i][j], hor[i][j]) (marked in orange) , then look at all distances in [1,small] vertically in hor array and horizontally in ver array. If values(shown in blue) are greater than small and if small is greater than curr result, then we update result.

Try solving now

2. System Design

Design a sales Data base System.

Problem approach

Tip 1 : Basically create an entity relationship diagram.
Tip 2 : Try to be as accurate as you can.
Tip 3 : If you know you're not sure of anything, just mention it on the page where you were drawing ER diagram.

03
Round
Medium
Video Call
Duration90 minutes
Interview date18 Sep 2022
Coding problem2

It was a technical + case study discussion round, Interviewer was very friendly and supportive,
Basically I was asked about the OOPS concept, then I was given a problem related to data structures which I solved using map, then interviewer had a discussion on the case study round and told me to explain the code which I wrote in case study round, also told me to explain the ER diagram and at last he asked me an SQL query related to join and group by.

1. Count Distinct Elements In Every Window

Moderate
15m average time
85% success
0/80
Asked in companies
AmazonHSBCZS

Given an array of integers ‘arr’ of size ‘n’ and an integer ‘k’. You need to find the count of distinct elements in every sub-array of size ‘k’ in the given array. Return an integer array ‘count’ that consists of n - k + 1 integers where ‘count[i]’ is equal to the number of distinct elements in a sub-array of size ‘k’ starting from index ‘i’.

Note:
1. The sub-array of an array is a continuous part of the array.
2. Consider ‘0’ based indexing.
3. ‘k’ will always be less than or equal to ‘n’.
3. Don’t print anything, just return the integer array ‘count’.
Problem approach

I solved this problem using unordered_map, where I mapped each string with the freq of it and later I traversed in the map and printing all those strings whose frequency == 1

Try solving now

2. Total Salary

Easy
0/40
Asked in company
ZS

Write a program to calculate the total salary of a person. The user has to enter the basic salary (an integer) and the grade (an uppercase character), depending upon which the total salary is calculated as:

    Total_salary = Basic + HRA + DA + Allow – PF
where :
HRA   = 20% of basic
DA    = 50% of basic
Allow = 1700 if grade = ‘A’
Allow = 1500 if grade = ‘B’
Allow = 1300 if grade = ‘C' or any other character
PF    = 11% of basic.

Round off the total salary and then print the integral part only.


Note for C++ users :

To round off the value, please include<cmath> library at the start of the program and round off the values in this way.
int ans = round(yourFinalValue);
Problem approach

Tip 1 : Use Join to join two tables.
Tip 2 : Use group by clause to group the data on department name

Try solving now
04
Round
Easy
HR Round
Duration20 minutes
Interview date22 Sep 2022
Coding problem1

I was told to explain my projects which were written in resume, Interviewer was very friendly and supportive, few questions on data structures, then basic HR questions were asked.

1. Basic HR Questions

1. Tell me about yourself.

2. What are your greatest strengths and weaknesses?

3. What is your biggest achievement so far?

Problem approach

Tip 1 : Be confident while answering.
Tip 2 : Name only that data structure in which you are confident enough to solve any problem.

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

What is recursion?

Choose another skill to practice
Similar interview experiences
Software Engineer
4 rounds | 4 problems
Interviewed by ZS
2009 views
0 comments
0 upvotes
Software Engineer
4 rounds | 5 problems
Interviewed by ZS
1409 views
0 comments
0 upvotes
Software Engineer
2 rounds | 3 problems
Interviewed by ZS
1643 views
0 comments
0 upvotes
SDE - 1
2 rounds | 4 problems
Interviewed by ZS
917 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Software Engineer
4 rounds | 1 problems
Interviewed by Newgen Software
3210 views
2 comments
0 upvotes
company logo
Software Engineer
3 rounds | 6 problems
Interviewed by HashedIn
2582 views
0 comments
0 upvotes
company logo
Software Engineer
2 rounds | 2 problems
Interviewed by Ernst & Young (EY)
0 views
0 comments
0 upvotes