Zomato SDE - 1 | 2022 grad | 9 months experience | Gurgaon | onsite| accepted
Summary
I successfully secured an SDE-1 position at Zomato with 9 months of experience. The onsite interview process consisted of two challenging rounds, focusing on low-level design, data structures, algorithms, and system design, ultimately leading to an offer.
Full Experience
I learned about the opportunity through a friend's referral and LinkedIn posts. Zomato primarily considers referred applications, and after applying multiple times, I finally received an interview call one week post-referral. Interestingly, there was no initial coding round.
I was invited for an onsite interview at Zomato's office.
Round 1
This round began with a discussion of my experience and projects at Synopsys. The interviewers were very relaxed and created a comfortable atmosphere, even conversing in 'hinglish'. After detailing my work, we moved into a low-level design problem. I was asked to consider 1 million objects, each with 3-4 properties, and determine the optimal data structure to store them, focusing on fast retrieval of record groups. We discussed the factors influencing data structure choice and how a query would retrieve data from my proposed structure.Next, I was tasked with writing code to parse a JSON file and transform its nested structure into a flattened key-value format (e.g.,
a: {a1: 123, a2: {b: "abc"}} to a.a1 = 123, a.a2.b = "abc"). Following this, they presented a classic DSA problem: finding the longest substring with an equal number of 0s and 1s in a binary string. I solved this efficiently within 5 minutes and then thoroughly tested it with their provided test cases. The interviewers seemed quite satisfied, and I was shortlisted for the next round.Round 2
This round also started with introductions and questions about my work at Synopsys. The first major problem was a system design challenge: how to distribute incoming application requests across multiple servers to ensure an almost equal load, essentially designing a load balancer. I proposed token bucket and leaky bucket approaches, then elaborated on consistent hashing, explaining its differences from normal hashing and outlining each step involved. We also discussed primary and secondary indexing.Subsequently, they asked me to detail the entire lifecycle of a request, covering DNS, caching, and gateways. We explored the internal workings of a gateway, Content Delivery Networks (CDNs) and their types, and how DNS resolution leads to a server response. We also discussed various factors to reduce latency, such as vertical and horizontal scaling and geo-DNS routing.
Finally, I was asked to design a basic music player system, similar to Spotify, incorporating features like creating playlists, adding songs, and searching. I needed to specify the appropriate database, explain normalization and denormalization strategies for optimizing queries, and propose a suitable schema. The interviewers were pleased with my responses and provided feedback immediately. About 30 minutes later, I received confirmation that I had cleared the second round, and we proceeded to discuss compensation.
Interview Questions (6)
Given 1 million objects, each with 3-4 properties, what data structure should I use to store these records? The goal is to optimize data retrieval for groups of records. What factors would I consider when choosing a particular data structure, and how would I perform a given query on this structure to retrieve data?
Write code to read a JSON file and transform its nested structure into a flattened key-value pair format using dot notation. For example, given the JSON:
a: {
a1 : 123,
a2: {
b: "abc",
c: 32
}
} It should be converted into: a.a1 = 123
a.a2.b = "abc"
a.a2.c = 32Find the length of the longest contiguous sub-array in a binary string that contains an equal number of 0s and 1s.
Design a system to distribute incoming application requests to multiple servers such that each server receives an almost equal amount of requests. This involves discussing concepts like token bucket and leaky bucket approaches, consistent hashing (including its difference from normal hashing and the steps involved), primary indexing, and secondary indexing.
Describe every step a request goes through during its cycle, including DNS, caching, and gateways. What specifically happens inside a gateway? What is a Content Delivery Network (CDN), what are its different types? What is DNS, and how does a server respond to a request? Finally, what factors can be used to reduce latency in this entire process?
Design a basic music player system similar to Spotify, but with core features like creating playlists, adding songs to a playlist, and searching for songs. What type of database should be used? How can this database be normalized and denormalized to optimize for specific queries? What should be the schema design?