Level: Senior-Level
Round: Phone Screen · Type: Coding · Difficulty: 7/10 · Duration: 60 min · Interviewer: Neutral
Topics: Data Structures, Algorithms, Dependency Injection
Location: San Francisco Bay Area
Interview date: 2025-12-15
Got offer: False
I had to implement a ToDo list for an AI with task dependencies. The difficulty was high because I had to avoid regressing previous behavior while adding new functionality.
I prepared using commonly asked interview questions, but I still encountered new questions. The problem was divided into four parts, with each part (except the first) having 6-7 test cases.
The core of the problem was to implement a ToDo list for AI. I was given three classes: TaskStatus (Enum), Task, and ToDoList.
Part 1: I had to complete the add, get, and update status functions in the ToDoList class. This part was relatively straightforward, but I had to work quickly.
Part 2: A new concept of dependencies was introduced. I needed to update the existing add and update status functions. For add, each task has its own dependencies. If the status of all dependencies is not SUCCEEDED, the current task must be BLOCKED. For update status, if the current task becomes SUCCEEDED, all previously blocked dependencies need to update their status (e.g., from BLOCKED to READY). If the current task becomes FAILED, all dependencies must become FAILED.
This meant that a task had to keep track of both its parents (tasks it depends on) and its children (tasks that depend on it). Initially, I only tracked the children, so I had to go back and modify my code, which wasted time. I spent some time understanding the problem, and due to nervousness, my mind was in a mess. I barely finished the code, but two test cases failed, and the time was up. I didn't even get to the last two parts.