Zomato Interview
Summary
I successfully navigated a three-round interview process at Zomato for a backend role, covering technical skills, system design, and cultural fit, ultimately leading to an offer.
Full Experience
Round 1 - Technical (60 minutes)
This round began with a discussion about my previous work experiences at startups. The interviewer then delved into some core backend concepts:
- How scaling pooling works
- The differences between processes and threads
- When to opt for multithreading versus multiprocessing
Having a backend background, I felt comfortable answering these questions.
Next, I was given two SQL problems. The first involved writing a query to find employees who earn more than their manager from an employees table (emp_id, name, manager_id, salary). The second, using the same table, required finding the number of employees reporting to each manager, specifically showing only managers with at least 3 direct reports. I solved both using self-joins and a combination of GROUP BY and HAVING clauses.
The DSA segment presented a graph problem. First, I had to find the shortest path distance from a source node to all other nodes. I used BFS for this, achieving an O(V+E) complexity. The second part was more challenging: identify which edge removal would cause the maximum number of nodes to become unreachable from the source. My initial approach involved trying to remove each edge and re-running BFS, and I also discussed optimization strategies with the interviewer, who seemed satisfied.
A few days later, I received a call confirming that I had cleared this round and that my next interview was scheduled.
Round 2 - System Design (75-80 minutes)
This round was conducted by a Senior Engineer. We started with a brief chat about my work experience and some general tech topics for the first 5-10 minutes.
The core of the round was a system design question: Design a food order tracking system. The requirements included real-time updates for users (order confirmed, restaurant preparing, delivery partner picked up, delivery partner location, order delivered), handling concurrent orders, and delivering updates to millions of users in real-time.
Over about 70 minutes, we had an extensive discussion covering:
- The choice between WebSocket vs Server-Sent Events for real-time updates
- Utilizing a message queue like Kafka for order status events
- Designing the database for orders and delivery tracking
- Using Redis for caching active delivery locations
- Strategies for handling connection drops and reconnections
- Crucially, how to scale WebSocket servers for a large user base
There was a significant back and forth on the tradeoffs of different architectural approaches.
Towards the end, for the last 15 minutes, I was given a coding question: Design a basic rate limiter. The task was to implement a function that returns true/false based on whether a user request should be allowed, adhering to a constraint of max N requests per minute per user. I implemented a solution using a sliding window approach with timestamps. The interviewer then probed about memory optimization, leading to a discussion about the token bucket algorithm, which I didn't have time to implement.
I cleared this round as well, receiving confirmation after a few days.
Round 3 - Zomato's Culture Round (30 minutes)
This final round was more focused on culture fit and felt somewhat like a formality, especially after clearing the first two technical rounds. The interviewer was a VP-level individual with extensive experience.
For the initial 10 minutes, he inquired about my background, what I was looking for in my next role, and specifically why I was interested in Zomato. Following that, he provided insights into:
- The team structure and who I would be collaborating with
- The day-to-day work culture at Zomato
- Work-life balance, honestly mentioning crunch times during peak periods
- Growth opportunities and the performance review process
- The current tech stack and ongoing projects
Towards the end, we discussed compensation. He shared details regarding the base salary, ESOP structure with vesting schedule, and standard benefits. I had the opportunity to ask questions about the role and team, making it a very open conversation.
He concluded by mentioning that HR would send the official offer letter in a few days, which I subsequently received via email within 2-3 days.
Interview Questions (9)
Discuss how scaling pooling mechanisms work in distributed systems.
Explain the differences between processes and threads.
Describe when to use multithreading versus multiprocessing, including their respective advantages and disadvantages.
Given an 'employees' table with columns: emp_id, name, manager_id, salary. Write a SQL query to find employees who earn more than their manager.
Given the 'employees' table with columns: emp_id, name, manager_id, salary. Write a SQL query to find the number of employees reporting to each manager, but only show managers with at least 3 direct reports.
Given a graph and a source node, find the shortest path distance from the source to all other nodes.
Given a graph and a source node, identify which single edge removal causes the maximum number of nodes to become unreachable from the source.
Design a food order tracking system. When a user places an order, they should receive real-time updates on statuses such as: Order confirmed, Restaurant preparing food, Delivery partner picked up, Delivery partner location updates, and Order delivered. The system needs to handle concurrent orders and send updates to millions of users in real-time.
Design a basic rate limiter. Implement a function that returns true or false indicating whether an incoming user request should be allowed, subject to the constraint of a maximum of N requests per minute per user.