Build a Testable Concurrent Go HTTP Client with Structured Failures

Quick Overview

Build a concurrent Go HTTP client with explicit timeouts, status and JSON errors, structured per-serial results, WaitGroup coordination, and injectable tests.

Build a Testable Concurrent Go HTTP Client with Structured Failures

Company: Coreweave

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: easy

Interview Round: Technical Screen

In Go, query serial numbers 1001 through 1010 and report each outcome. Handle non-200 HTTP responses with a failure reason, a request that times out, and malformed JSON such as unexpected EOF. Add concurrent execution, then refactor the method to return structured results instead of only printing or returning an error. ### Constraints & Assumptions The source does not provide endpoint URLs or the success JSON schema. Inject URL construction and use an illustrative generic decoded payload until the actual schema is supplied. Configure an explicit client timeout rather than assuming the default is bounded. ### Clarifying Questions to Ask - Is exactly status 200 required, or are other successful status codes valid? - Should result display remain in serial-number order despite concurrent completion? - Which fields distinguish transport, HTTP-status, and JSON-decoding failures? ```hint Separate transport from presentation A returned result struct can be asserted in tests and printed later without capturing console output. ``` ### What a Strong Answer Covers - A timeout-enabled reusable HTTP client, closed response bodies, and decoded errors. - One result per serial with distinct failure classes. - WaitGroup coordination without shared-write races. - Dependency injection and local HTTP fixtures for testing. ### Follow-up Questions - How would you bound concurrency for thousands of serials? - How would cancellation stop outstanding requests when the caller no longer needs results?

Overview: Build a concurrent Go HTTP client with explicit timeouts, status and JSON errors, structured per-serial results, WaitGroup coordination, and injectable tests.

Read the full Coreweave Software Engineer interview experience this question came from

Coreweave logo
Coreweave
Nov 12, 2026
easySoftware EngineerTechnical ScreenSoftware Engineering Fundamentals
6
0

In Go, query serial numbers 1001 through 1010 and report each outcome. Handle non-200 HTTP responses with a failure reason, a request that times out, and malformed JSON such as unexpected EOF. Add concurrent execution, then refactor the method to return structured results instead of only printing or returning an error.

Constraints & Assumptions

The source does not provide endpoint URLs or the success JSON schema. Inject URL construction and use an illustrative generic decoded payload until the actual schema is supplied. Configure an explicit client timeout rather than assuming the default is bounded.

Clarifying Questions to Ask Guidance

  • Is exactly status 200 required, or are other successful status codes valid?
  • Should result display remain in serial-number order despite concurrent completion?
  • Which fields distinguish transport, HTTP-status, and JSON-decoding failures?

What a Strong Answer Covers Guidance

  • A timeout-enabled reusable HTTP client, closed response bodies, and decoded errors.
  • One result per serial with distinct failure classes.
  • WaitGroup coordination without shared-write races.
  • Dependency injection and local HTTP fixtures for testing.

Follow-up Questions Guidance

  • How would you bound concurrency for thousands of serials?
  • How would cancellation stop outstanding requests when the caller no longer needs results?