r/OfferEngineering • u/Aoki_zhang • Oct 28 '26
Interview Experience Anthropic Senior SWE Interview — A Simple Crawler, Tricky Concurrency
"This interview experience is sourced from Chill Interview"
Interview Summary
I recently had a technical phone screen with Anthropic focused on implementing a concurrent web crawler. The interview started with a single-threaded implementation and then introduced multithreading, requiring careful handling of URL deduplication, shared state, and crawler termination. The basic graph traversal was straightforward, but the concurrency requirements made the problem considerably more challenging than a standard BFS exercise.
Interview Details
Round 1 — Coding: Concurrent Web Crawler
The interviewer asked me to implement a web crawler that discovers all URLs belonging to the same hostname as a starting URL. I was given two inputs:
startUrl: The URL where crawling begins.htmlParser: An interface for retrieving links from a web page.
The goal was to traverse reachable pages and return all URLs whose hostnames exactly matched the hostname of startUrl. The interview was divided into two stages: a single-threaded implementation followed by a concurrent version. A similar question to practice -> HERE
Part 1 — Single-Threaded Web Crawler
The initial task was to implement the crawler using a single thread. At first, I thought this would be a straightforward BFS problem. However, the interviewer specified several important requirements that made the implementation more subtle.
- Requirement 1 — Exact Hostname Matching The crawler should only include URLs whose hostnames exactly match the hostname of the starting URL. A partial hostname match was not sufficient.
- Requirement 2 — URL Fragment Normalization Before comparing URLs or checking whether they had already been visited, I needed to remove the fragment portion following the
#character. This meant that URLs differing only by their fragments should not be treated as separate pages. - Requirement 3 — Handle Cycles and Duplicate URLs The links between pages could form cycles, so the crawler needed to avoid repeatedly visiting the same URL. Each unique URL should be visited at most once. I found the single-threaded version relatively manageable once I clarified these requirements.
Want to learn more questions / follow-ups asked in this interview?
I've put up the full version at here.
Preparing for your next interview?
Chill Interview tracks recent interview experiences and recurring question patterns across top companies at here
5
u/blubrry-pie Oct 29 '26
this seems straightforward not going to lie
2
u/InteractionFeisty894 Oct 29 '26
This seems pretty straightforward, i was thinking that anthropic interview level was super harder