Nooks·Software Engineer·Technical Phone Screen
- Given a start URL and a function that returns all hyperlinks on a page, write a function that crawls and returns all reachable pages on the same hostname using breadth-first traversal, visiting each URL at most once.
- How do you prevent the crawler from visiting the same URL more than once?
- What are the time and space complexities of your crawler solution?
“I went straight to BFS with a queue and a visited set, which was the right call.”