FastPrepConcurrent Web Crawler Reachability
Problems/Concurrent Web Crawler Reachability

Concurrent Web Crawler Reachability

Temporal logoTemporal● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A firsthand Temporal phone-interview report dated October 19, 2025 describes a concurrent web-crawler coding exercise. Here, the input is the list of which pages link to which, so the answer is always the same for the reported concurrent walk. Our version is about 91% the same as the reported question.

A production crawler fetches many discovered pages concurrently while ensuring that each known page is fetched at most once.

In this practice version, pages[i] identifies a known page and outgoing[i] contains the links found after fetching it. Starting at startUrl, return every reachable known page in lexicographic order. Ignore links that do not occur in pages.

The result must be independent of worker completion order. As a discussion point, explain how an atomic visited set and a size-limited worker queue prevent duplicate fetches and too many fetches at once.

Function

crawlReachable(startUrl: String, pages: String[], outgoing: String[][]) → String[]

Examples

Example 1

startUrl = "a"pages = ["a","b","c","d"]outgoing = [["b","c"],["d"],["d"],[]]return = ["a","b","c","d"]

Both branches reach d, but it is returned once.

Example 2

startUrl = "home"pages = ["home","about","orphan"]outgoing = [["about","external"],[],["home"]]return = ["about","home"]

Unknown external is ignored and orphan is not reachable.

Example 3

startUrl = "solo"pages = ["solo"]outgoing = [["solo"]]return = ["solo"]

A self-link does not duplicate the page.

Constraints

  • 1 <= pages.length == outgoing.length <= 100000.
  • Page identifiers are unique non-empty strings, and startUrl occurs in pages.
  • The total number of links is at most 300000.

More Temporal interview questions

  • Concurrent Volley ShotPHONE SCREEN · Seen Apr 2026
  • Normalize and Aggregate Error LogsPHONE SCREEN · Seen Feb 2026
  • Delayed Task Executor OrderingPHONE SCREEN · Seen May 2025
  • Game of Life Next GenerationONSITE INTERVIEW · Seen Oct 2025

Similar questions at other companies

  • Crawl Same-Hostname URLs ConcurrentlyAnthropic · PHONE SCREENAnthropic interview questions
  • Concurrent Web Crawler SimulationOpenAI · PHONE SCREEN · ONSITE INTERVIEWOpenAI interview questions
  • Shortest Pin Path Through TopicsPinterest · PHONE SCREENPinterest interview questions
  • Course ScheduleAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Shortest Travel Time in a Grid with Traffic LightsWaymo · PHONE SCREENWaymo interview questions
  • Word Chain Jumps in a GridGoogle · PHONE SCREENGoogle interview questions
  • Linked Merchants Within Two HopsStripe · PHONE SCREENStripe interview questions
  • Evaluate DivisionApple · PHONE SCREENApple interview questions
  • Shortest Word Chain Between Two WordsFanatics · PHONE SCREEN
  • Minimize CommuteDatabricks · OA · PHONE SCREENDatabricks interview questions
All Temporal interview questionsSee Temporal hiring insights
Saved
class Solution {
    public String[] crawlReachable(String startUrl, String[] pages, String[][] outgoing) {
        // Write your code here.
    }
}
Checking account…