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

SDE - Intern

Zomato
upvote
share-icon
2 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 8 months
Topics: Data Structures, Algorithms, OOPs, Operating Systems, DBMS, Computer Networks.
Tip
Tip

Tip 1 : For DSA questions in interviews, start explaining from the brute force approach and then move to the optimal one. Convey your thought process to the interviewers, so that they can help you out if you get stuck. Communication skills matter a lot, and I think that is what makes the difference!
Tip 2 : Do some research about the company you are interviewing for and prepare the answers to the questions like Why should we hire you? (frame your answer in such a way that shows that your career goals align with the goals of the company), Why XYZ company?, Competitors of XYZ, etc. beforehand. Read about some latest news related to the company so that you can ask questions based upon that when the interviewer allows you to ask any question. This shows that you are genuinely interested to work for the company.
Tip 3 : Spend proper time making your resume and get it reviewed by seniors. Do not write anything that you are not confident of. Even if you write something that you don’t know, just be prepared that how you will defend it. The interviewers are much much experienced than you and they’ll catch you easily if you lie. So don’t take risks here.

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

Tip 1 : Try to include at least 1 development project in your resume.
Tip 2 : Do not write anything that you are not confident of. Even if you write something that you don’t know, just be prepared that how you will defend it.

Interview rounds

01
Round
Hard
Online Coding Test
Duration90 minutes
Interview date8 Oct 2021
Coding problem3

This round was scheduled for 8 Oct 2021 from 9:00 pm. It was an online coding assessment round that consisted of 3 DSA questions.

1. Split Binary String

Easy
15m average time
85% success
0/40
Asked in company
Amazon

Chintu has a long binary string ‘str’. A binary string is a string that contains only 0 and 1. He considers a string ‘beautiful’ if and only if the number of 0's and 1's in the string are equal.

For example :

0011 , 1100 , 101010 etc are beautiful strings whereas 1110, 0001,10101 etc are not beautiful strings.

Now Chintu wants to split the string into substrings such that each substring is beautiful. Can you help Chintu to find the maximum number of beautiful strings he can split the string into? If it is not possible to split the string in such a way that all strings are beautiful, return -1.

For example :

Let the given string be “101001”
We will return 3 as we can divide the string into 3 beautiful strings “10” “10” and “01’.
Problem approach

The idea was to calculate the count of 1s between every two consecutive 0s of the string.

Try solving now

2. Next Greater Element

Easy
10m average time
90% success
0/40
Asked in companies
IBMInfo Edge India (Naukri.com)Amazon

You are given an array 'a' of size 'n'.



The Next Greater Element for an element 'x' is the first element on the right side of 'x' in the array, which is greater than 'x'.


If no greater elements exist to the right of 'x', consider the next greater element as -1.


For example:
Input: 'a' = [7, 12, 1, 20]

Output: NGE = [12, 20, 20, -1]

Explanation: For the given array,

- The next greater element for 7 is 12.

- The next greater element for 12 is 20. 

- The next greater element for 1 is 20. 

- There is no greater element for 20 on the right side. So we consider NGE as -1.
Try solving now

3. Minimum Stop Required To Reach The Destination

Moderate
0/80
Asked in companies
IntuitNagarro SoftwareJosh Technology Group

Ninja bought a plane that can cover a distance of at most ‘K’ units in one flight. Now, the ninja wants to show this plane to his best friend, whose house lies at point (X, 0) on the x-axis. There are multiple airports on the x-axis marked by 1. If there is no airport at any point, then it is marked as 0.

Given an integer array ‘AIRPORTS’ of size ‘N’ containing the information about airports on the x-axis, can you find the minimum number of stops that must be taken by the plane to reach the destination (X,0) on the x-axis. If the destination is unreachable, return -1. The plane starts from the origin (0, 0).

For example:
You are given AIRPORTS = [1, 1, 1, 0, 1, 0], ‘K’ = 2 and ‘X’ = 4.
The answer will be 1. The plane makes its first stop at (2, 0) and then reaches the destination (4, 0) in the next fight. Hence the total number of stops is 1.
Try solving now
02
Round
Medium
Video Call
Duration90 minutes
Interview date26 Oct 2021
Coding problem3

This round was scheduled for 26 Oct 2021 from 11:00 am. It was a technical interview round where I was asked questions from my resume and questions based on DSA.

1. Data Structure Supporting Insert Delete And GetRandom

Easy
15m average time
85% success
0/40
Asked in companies
OYOAmazonWalmart

Design and implement a data structure which supports the following operations:

insert(X): Inserts an element X in the data structure and returns true if the element was not present, and false otherwise.

remove(X): Removes the element X from the data structure, if present. Returns true if the element was present and false otherwise.

search(X): Search the element X in the data structure. Returns true if the element was present and false otherwise.

getRandom(): Return a random element present in the data structure.

Four types of queries denote these operations:

Type 1: for insert(X) operation.
Type 2: for remove(X) operation.
Type 3: for search(X) operation.
Type 4: for getRandom() operation.
Note:
It is guaranteed that at least one element will be present in the data structure when getRandom() operation is performed.
Follow Up:
Can you implement every operation such that it works in O(1) time?
Problem approach

Step 1 : I explained the O(n) approach to the interviewer by using an array.
Step 2 : I optimized the previous approach to O(1) using a hashmap and explained the same to the interviewer.
Step 3 : The interviewer asked me to code my approach on a shared coding editor.

Try solving now

2. Count Inversions

Moderate
40m average time
55% success
0/80
Asked in companies
MicrosoftAdobeSamsung R&D Institute

For a given integer array/list 'ARR' of size 'N' containing all distinct values, find the total number of 'Inversions' that may exist.

An inversion is defined for a pair of integers in the array/list when the following two conditions are met.

A pair ('ARR[i]', 'ARR[j]') is said to be an inversion when:

1. 'ARR[i] > 'ARR[j]' 
2. 'i' < 'j'

Where 'i' and 'j' denote the indices ranging from [0, 'N').
Problem approach

Step 1 : I explained the O(n*n) approach to the interviewer by using an array.
Step 2 : I optimized the previous approach to O(n) using the merge sort algorithm and explained the same to the interviewer.
Step 3 : The interviewer asked me to code my approach on a shared coding editor.

Try solving now

3. Best Time to Buy and Sell Stock III

Hard
0/120
Asked in companies
Samsung R&D InstituteMicrosoftSalesforce

You are Harshad Mehta’s friend. He told you the price of a particular stock for the next ‘n’ days.


You are given an array ‘prices’ which such that ‘prices[i]’ denotes the price of the stock on the ith day.


You don't want to do more than 2 transactions. Find the maximum profit that you can earn from these transactions.


Note

1. Buying a stock and then selling it is called one transaction.

2. You are not allowed to do multiple transactions at the same time. This means you have to sell the stock before buying it again. 
Example:
Input: ‘n’ = 7, ‘prices’ = [3, 3, 5, 0, 3, 1, 4].

Output: 6

Explanation: 
The maximum profit can be earned by:
Transaction 1: Buying the stock on day 4 (price 0) and then selling it on day 5 (price 3). 
Transaction 2: Buying the stock on day 6 (price 1) and then selling it on day 6 (price 4).
Total profit earned will be (3 - 0) + ( 4 - 1) = 6. 
Problem approach

Step 1 : I gave a recursive approach to solving this question. The recursive relation will be like this: maxProfit = max( P[left]*k + solve(P, k+1, left+1, right), P[right]*k + solve(P, k+1, left, right-1) ).
Step 2 : I optimized the previous approach to using memoization and explained the same to the interviewer.
Step 3 : The interviewer asked me to code my approach on a shared coding editor.

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

What is recursion?

Choose another skill to practice
Similar interview experiences
SDE - Intern
3 rounds | 6 problems
Interviewed by Zomato
3064 views
0 comments
0 upvotes
SDE - Intern
2 rounds | 3 problems
Interviewed by Zomato
1596 views
0 comments
0 upvotes
SDE - Intern
3 rounds | 5 problems
Interviewed by Zomato
0 views
0 comments
0 upvotes
SDE - Intern
2 rounds | 4 problems
Interviewed by Zomato
1369 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Amazon
15481 views
4 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
15338 views
1 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Amazon
10142 views
2 comments
0 upvotes