← All problems

Mobile System Design

HTTP Client Library

hardPremiumAsked at
Meta

"Design an HTTP client library like OkHttp."

Analyzing the Problem

OkHttp behind Retrofit is an HTTP client library for Android: one shared client runs requests synchronously or asynchronously with plug-ins for cross-cutting concerns like auth and logging, reuses warm connections per host with many in-flight requests over a single connection via HTTP/2 multiplexing, caches responses on disk keyed by URL plus Vary headers, pins each host to its server certificate with a backup pin for safe rotation, retries only failures that are safe to replay spaced out so a recovering server isn't stampeded, and cancels or caps the total time of any single call. Past the socket, the server on the far side is someone else's problem.

Premium content

The full breakdown is locked.

Premium unlocks every system design, every coding question, and every challenge - with unlimited code runs in the live editor.

Browse free problems