Implement sequential and parallel URL requests
Company: Atlassian
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Technical Screen
You are given a list of URL strings. For each URL, send an HTTP GET request and return the responses.
### Output format
Return a list of objects:
- `url`: the requested URL
- `status`: HTTP status code (or an error indicator if the request fails)
- `body`: response body as text (or an error message)
### Tasks
1. **Sequential requests:** Implement a function that sends requests **one-by-one** in the given order.
2. **Deduplication:** Update the logic so that duplicate URLs are requested only once (preserve the order of the **first occurrence** in the input).
3. **Parallel requests:** Update the implementation to send requests **in parallel** (e.g., using promises/futures) and return results for the deduplicated URL list.
### Notes / assumptions
- You may assume a Node.js/JavaScript environment and may use a standard HTTP client library.
- Handle failures gracefully (e.g., DNS failure, timeout, non-2xx responses) and still return an entry for that URL.
Quick Answer: This question evaluates proficiency in HTTP networking, asynchronous and parallel programming (promises/futures), deduplication and order preservation, and robust error handling for I/O operations.