← 返回 atlassian 的题目列表Sequential, Deduped, and Parallel URL Fetcher
类型:qbank
Given a list of URLs, send requests and return each response with URL, status code, and body. Follow-ups add deduplication, tests, and parallel request execution under a short phone-screen time box.
Requirements
Input is a list of URLs.
Send a request to each URL and return response records containing at least URL, status code, and response body.
Base version sends requests sequentially.
Follow-ups include:
Deduplicate URLs before requesting.
Test that deduplication does not change the expected response set.
Convert the implementation to parallel calls.
Notes
The phone screen can use HackerRank and may require JavaScript/Node. One candidate switched from Java after seeing HTTP requests; the interviewer supplied an axios import.
Clarify timeout, error, and ordering behavior before writing the parallel version.
Preparation
Write sequential, deduped, and Promise.all/async versions.
Add tests for duplicate URLs, failed requests, empty input, and preserving input order versus completion order.