Round 1
Given an array heights, where each element represents the height of a vertical line. Choose two lines to act as the walls of a container. Return the maximum amount of water the container can hold (max area).
Given an array of integers temps representing daily temperatures, write a function to calculate, for each day, how many days you'd have to wait until a warmer temperature. The function should return an array answer where answer[i] is the number of days after day i you'd need to wait for a warmer temperature. If there's no future day with a warmer temperature, set answer[i] = 0. The interviewer asked me to walk through an example.
Round 2
Design an app called LunchDrop, mainly for company employees to order food at the workplace. The app has a list of restaurants and their menus, and the available restaurants rotate daily. Users need to be able to:
- Log into the app and see which restaurants are available that day.
- Browse each restaurant's menu.
- Choose food and customize it based on available options (like tacos, vegetables, toppings, sauces, etc).
- Submit the customized order.
Follow-up questions and discussion on the LunchDrop design:
- If there's a technical issue at order time, or the menu changes so that an ordered item becomes unavailable, how should the system handle that?
- What type of database should the menu database use?
- How do we get updates from real-time data? How does that fit into this system design?
- Restaurant data also gets updated — where in this system could we use caching?
Behavioral Questions
The interviewer also asked:
- Why eBay?
- Why are you leaving your current company?
Round 3: HM Round (Design Round)
Design a dashboard that shows eBay's Top 10 items and Top 10 categories, ranked by sales volume (units sold).
Follow-up questions and discussion on this dashboard design:
- Explain the item quantity aggregator and category aggregator in detail.
- How does the system determine the current count for each aggregator?
- Given eBay's high traffic, how often do we need to write updates to the state store? What are the pros and cons of writing more frequently vs. less frequently?
- How do we retrieve the final aggregated results from RocksDB?
- If each partition has its own RocksDB instance, how does the item aggregator maintain and process aggregated data across all partitions?
- When do we trigger the process of merging data across all partition-level database instances?
- Suppose there are 1 million events, and each event triggers an update. Does that mean 1 million events get published to the intermediate Kafka topic? If not, how do we optimize this?
Behavioral Questions
The interviewer also asked these situational questions:
- Have you ever had a conflict with a teammate? How did you resolve it?
- Why eBay?
- Have you ever had a conflict with your manager? How did you resolve it?
Discussion
Loading comments…