The interview problem
A customer client receives unreadable bytes from an endpoint that works in your browser. Diagnose content encoding.
Original practice, not a reported company interview. Scenarios and numbers are illustrative. Interview date: not applicable. Sources retrieved October 1, 2026.
1. Scope and worked approach
Inspect Accept-Encoding, Content-Encoding, Content-Type and behavior at each proxy hop. Determine which component compresses and which decompresses, then test raw and decoded representations. Keep media type and transfer representation separate in the contract.
2. Trace the design or derivation
Client negotiation → server representation → proxy handling → decompression → parser
Record both wire bytes and decoded bytes in diagnostics so performance comparisons remain meaningful. A successful browser test may simply reflect automatic decompression that a custom client lacks. Return actionable errors without logging the entire customer payload.
3. Calculate the example
A 1 MB JSON document compressed to 200 KB still decodes to 1 MB. A client that treats the 200 KB compressed body as UTF-8 JSON will fail before JSON parsing can succeed.
4. Failure cases and trade-offs
Double compression or a proxy stripping the encoding header breaks decoding. Limits based only on compressed bytes can allow excessive memory expansion. Caches must vary appropriately on negotiated representation.
5. Validation, follow-ups and self-review
Acceptance: test compressed and identity responses through the customer proxy, including corrupt bodies. Follow-up: where are decoded-size limits enforced? Self-review: distinguish encoding, media type and size.
Sources and related practice
Technical reference: developer.mozilla.org — HTTP representation encoding.
Source publication/update: Not established. Retrieved October 1, 2026. The workflow, calculations and review exercises are original; this reference is not evidence that a company asked this question.
Continue with Diagnose payload content-type mismatches; Set safe archive-import limits.
Continue your preparation
Choose a connected learning path or browse more FDE interviews questions. Read our editorial method and attribution policy.