Phone Screen 1: Coding — Implement Hit Counter
Implement a Hit Counter that records the time of each request and can query how many hits happened in the last 5 minutes, i.e. within 300 seconds.
Main interface:
- hit(timestamp) records a request
- getHits(timestamp) returns the number of requests in the past 300 seconds
You can use a queue, or a circular buffer aggregated by second. The focus is on how to efficiently remove expired data and control the space complexity.
Phone Screen 2: System Design — Distributed Rate Limiter
Design a distributed Rate Limiter, fairly similar to the Rate Limiter problem on Hello Interview.
Mainly uses Token Bucket:
- each user or API key maps to a bucket
- the bucket has a fixed capacity
- tokens are refilled at a fixed rate
The main discussion was how to store and atomically update tokens in a distributed environment, and how to guarantee low latency and high availability.
Onsite 1: Coding Debug
A Java debugging problem. They gave me code for a KV Store scan iterator, and I needed to read through it, find the bug, and fix it.
Main things to watch for:
- the start and end range of the scan
- boundary conditions
- whether data could be missed or duplicated
- the iterator's behavior after it finishes
Onsite 2: System Design — iCloud Photo Storage
Design iCloud Photo Storage, overall similar to the S3 / Object Storage problem on Hello Interview.
Main discussion points:
- photo upload and download
- storing metadata and blob data separately
- object storage
- multi-device sync
- how hot data and cold data get loaded and stored
Onsite 3: BQ / Hiring Manager
A behavioral interview with the hiring manager, fairly standard questions — you can prep for it with Hello Interview's BQ guide.
Main topics:
- the project with the biggest impact
- an experience disagreeing with someone
- how to drive cross-team collaboration
- how to handle conflicting priorities
Onsite 4: Coding — Top K Closest Pairs
Given a sorted array: [1, 2, 4, 7, 11, 16]. The distance between two numbers is defined as: d = |a - b|. Find the Top K pairs with the smallest distance. For example, if K = 2, the result is: [(1, 2), (2, 4)], with distances 1 and 2 respectively.
Discussion
Loading comments…