The Datadog technical phone screen centered on implementing a recursive filesystem deletion operation using only three fixed filesystem APIs. The initial task was straightforward conceptually: implement behavior similar to rm -rf without being allowed to modify the underlying APIs.
The more important part of the interview came from the follow-ups. The interviewer progressively moved the discussion toward production reliability and memory usage, asking about OOM scenarios, recursion versus iteration, extreme memory constraints, and how absolute paths could affect the design.
Interview Details
Coding — Implement DeleteTree Using Fixed Filesystem APIs The filesystem exposes only the following APIs, and their behavior cannot be changed:
fs.List(path) returns a list of absolute paths for all files and directories directly under path. Calling it on a file returns an empty list.
fs.Delete(path) deletes either a file or an empty directory. It returns true on success, but a non-empty directory cannot be deleted.
fs.IsDirectory(path) returns whether the supplied path represents a directory.
All paths passed into these APIs are absolute paths. The task was to implement DeleteTree(path) with semantics similar to rm -rf. The function should remove the requested path together with everything underneath it.
Follow-Up — Production OOM The interviewer then asked what could cause the implementation to run into memory problems after
Unlock Full Details
Create a free account to unlock this interview experience report.