← 返回 scale.ai 的题目列表Existing Codebase Debugging Round
类型:qbank
Debug an unfamiliar existing codebase under time pressure. The task is less about inventing a new algorithm and more about navigating files, running tests, identifying a few small defects, and communicating the debugging path.
Requirements
Environment: IDE-like workspace or existing multi-file codebase.
Candidate can run the existing code and tests.
Fix several seeded bugs; one MLE version describes 3 or 4 bugs, each requiring only 1-2 lines once identified.
SWE loop variant centers on an "assign project" codebase and is time-constrained.
Example bug shapes:
A loop forgets to call a reset function.
Filtering uses the wrong identifier field, such as filtering by id instead of course_id.
Communicate while navigating the codebase. The interviewer may provide help, but the round values how quickly the candidate builds a mental model of unfamiliar files.
Notes
The bugs can be easy after discovery; the hard part is locating them under time pressure.
Start by running tests or the failing scenario, reading the stack trace / assertion, then tracing data flow to the smallest responsible function.
Avoid broad rewrites. Patch the narrow defect, rerun the relevant test, then move on.
Keep a running hypothesis list out loud: what failed, where the data changes, what invariant should hold, and how the patch restores it.
Preparation
Practice debugging a 3-5 file Python project with tests already present; timebox yourself to 45 minutes.
Drill common defect classes: wrong id field, stale state not reset, off-by-one loops, filter predicates, missing validation, and mutation of shared state.
Rehearse a concise narration style: observation, hypothesis, experiment, patch, verification.