I have no idea why I failed this interview. I finished both the original question and the follow-up, and the interviewer said both my approach and code looked good. Then I was told the next day that I'd been rejected.
Question:
interface WebCrawler { List fetchAndParse(String url); // Already provided; returns all links on this page
}
Implement:
void crawl(String seedUrl); // Starting from the seed, visit each reachable page exactly once; return nothing
Single-threaded first → Follow-up = find the bottleneck + speed it up with concurrency (= LC 1242 Web Crawler Multithreaded)
The interviewer explicitly said the code didn't need to run, but it had to be production quality.
Discussion
Loading comments…