← 返回 atlassian 的题目列表Fetch a list of URLs in parallel and return responses
类型:online_judge
Change the URL fetching from sequential to parallel execution.
Requirements
Input: a list of URLs.
Behavior: send HTTP GET requests in parallel.
Output: a list of results.
If order preservation is required, the output must match the input order even if responses arrive out of order.
Tolerate per-request failures; one failure must not fail the whole batch.
Optional bonus: enforce a concurrency limit k (e.g., at most 5 in-flight requests).
Constraints
1 ≤ n ≤ 200
Optional: 1 ≤ k ≤ 20
Example Input: [A,B,C] Output: 3 results ordered as A,B,C (if order is required).
Example
Input
(mock) ["/slow","/fast"]
Output
2 results; if ordered output required then [/slow,/fast] order preserved