Uber: In-memory shell with mkdir, cd, ls and pwd
Problem. Implement the core of a Linux-style file system shell in memory, supporting commands such as mkdir to create a directory, cd to move between directories, ls to list contents and pwd to print the current path.
Format. About 45 minutes. The candidate had the core logic working in roughly 35 minutes and used the rest to debug edge cases.
What the interviewer cared about.
- Clean, readable code.
- Choosing a suitable data structure for the folder hierarchy; the candidate believes a tree where each node can have many children was the intended model.
- Proper error handling, for example moving into a directory that does not exist.
Context. Part of an SDE2 loop in November 2025. The other coding rounds were a tree dynamic programming problem in the style of building an optimal search tree, and a two-player game where each player may only take from either end. The design round asked for a bill-splitting app, including minimizing the number of settlements within a group.
Comments 0
No comments yet. Ask the author something, or add what happened in your own round.