This question evaluates a candidate's ability to design scalable, fault-tolerant systems for long-running file-crawl operations, including async job orchestration, pagination/streaming, concurrency control, caching/deduplication, failure handling, and storage-abstraction considerations.
You implemented a synchronous API that lists all files under a directory (recursive crawl). Now you need to scale it.
How would you scale the “list all files under a path” API when:
Discuss:
Based on your design in Part A, implement (or describe at a detailed interface level) an async crawl job:
rootPath
and gets back a
jobId
.
Specify key components/APIs, e.g.:
POST /crawl-jobs
→
{ jobId }
GET /crawl-jobs/{jobId}
→ status/progress
GET /crawl-jobs/{jobId}/results?cursor=...
→ paged results
State any assumptions (e.g., maximum result size, retention window, storage type).