Level: Mid-Level
Round: Full Journey · Type: Multiple Types · Difficulty: 7/10 · Duration: 300 min · Interviewer: Unfriendly
Topics: Graph, Arrays, Topological Sort, System Design
Location: San Francisco Bay Area
Interview date: 2025-12-31
Got offer: False
Question: Find the Celebrity.
Question: Largest Island problem using an array and Resolve Dependencies problem involving package installation order.
Question: Count Clouds in a 2D array and variations.
Question: Find Influencer in a social network represented by an adjacency matrix.
Question: Design ChatGPT, including discussions on model size, GPU usage, precision, and caching strategies.
The question was to find the celebrity.
The first coding question was:
Largest Island: Given a 1D array of 1s (land) and 0s (water), and a material count, find the largest continuous island that can be formed by filling at most 'material' number of 0s with 1s. I was given example inputs and expected outputs.
The second coding question was:
Resolve Dependencies: Given a list of packages and a dependency dictionary, return a correct installation order. Raise ValueError if there are cyclic dependencies. packages (List[str]): List of package names to install. dependencies (Dict[str, List[str]]): Dictionary where the key is a package name and the value is a list of its dependencies.
The coding question was:
Count Clouds: Given a 2D array representing the sky, where each cell has a heat radiation index (0-9), count the number of clouds. A cloud is defined as one or more connected cells with an index <= 4. Cells are connected horizontally or vertically, not diagonally.
Follow-up questions included:
The question was:
Influencer Finder: Given a group of N LinkedIn users (IDs 0 to N-1), find the Influencer. An Influencer is defined as not following anyone and being followed by everyone else. Input is a boolean adjacency matrix followingMatrix[i][j], where followingMatrix[i][j] == true means user i follows user j. followingMatrix[i][i] == false. Return the Influencer's ID, or -1 if none exists.
Follow-up question:
Find the user with the most followers.
The system design question was to design ChatGPT. We discussed how many GPUs to use for a 400B model, using bf16 precision. I was asked how the system would interact with Redis if I stored the KV cache in Redis.