Networking interview questions
48 questions from real iOS interviews. Topics: URLSession, HTTP/2, caching, retries, auth, WebSocket, offline.
- NetworkingShort answer
URLSession structure
You've inherited an app that does all its networking through URLSession.shared. Can you walk me through the objects involved when URLSession handles one reques…
#urlsession #urlsessionconfiguration #task #shared
- NetworkingMultiple choice
Background transfers
In an app that uses URLSession, you want a large file download to keep going after the user sends the app to the Home screen, and to be handled correctly when …
#background-session #downloadtask #uploadtask
- NetworkingShort answer
Codable JSON decoding
The server responds with something like {"user_id": 3, "created_at": "2026-09-11T02:00:00Z"}. Can you walk me through how that response gets mapped onto a Swif…
#codable #decodable #jsondecoder #serialization
- NetworkingMultiple choice
URLComponents and URL encoding
You want to send the search term "café & bar" as the query parameter q to https://api.example.com/search. Select all the correct statements about building the …
#urlcomponents #percent-encoding #query #url
- NetworkingMultiple choice
HTTP methods and idempotency
In a REST API, select all the methods that are idempotent, meaning sending the same request several times leaves the server in the same state as sending it onc…
#rest #http-method #idempotent
- NetworkingMultiple choice카카오
HTTP status codes
Select all the correct statements about HTTP response status codes.
#http #status-code #401 #403
- NetworkingMultiple choiceSAP
Transport protocols and data link basics
In a first-round iOS interview you get a networking fundamentals question: "What protocols are in the transport layer, and what are frames and ARP in the data …
#tcp #udp #arp #osi
- NetworkingShort answer
Unstable response schemas
You're decoding responses into the model below with Codable, but the server includes the nickname field in some responses and leaves it out of others entirely.…
#codable #optional #decodeifpresent #schema
- NetworkingMultiple choice
Predicting a Codable decode
What happens when you run this Codable decoding code? …
#codable #decodable #optional #null
- NetworkingShort answer
API error design
You've found network-layer code that collapses every failure into completion(nil). As a senior engineer, how would you model API errors and carry them all the …
#error-handling #result #typed-throws #http-status
- NetworkingShort answer
Retry strategy
A payment confirmation API times out now and then. A junior engineer opened a PR that says "if it fails, send it three more times." What would you point out?
#retry #exponential-backoff #jitter #idempotency
- NetworkingMultiple choice
What to retry
An idempotent GET request failed. Select all the failures where an automatic retry (with backoff) is appropriate.
#retry #http-status #transient-error
- NetworkingShort answer
Response caching and memory cache
An image-heavy feed app keeps getting memory warnings. How should the response cache have been set up?
#urlcache #nscache #http-cache #memory-warning
- NetworkingMultiple choice
NSCache traits
Select all the statements that correctly describe how NSCache differs from Dictionary.
#nscache #dictionary #cache
- NetworkingMultiple choice
HTTP/1.1 vs HTTP/2
Select all the statements that correctly describe HTTP/2 compared with HTTP/1.1.
#http2 #multiplexing #hpack #urlsession
- NetworkingShort answer
Handling connectivity state
There's code that checks Reachability at launch so it can show a "No internet connection" popup. What's the problem with that approach?
#nwpathmonitor #waitsforconnectivity #reachability #connectivity
- NetworkingShort answer
Synchronous requests and moving to async/await
The legacy code has a function that waits on a URLSession response with DispatchSemaphore to make it "synchronous," and older spots still use NSURLConnection.s…
#async-await #urlsession #nsurlconnection #main-thread
- NetworkingMultiple choiceGoogle
Image download without third parties
At an onsite whiteboard you're asked to download images from a list of URLs and show them in list cells, without a library like Kingfisher. Select all the corr…
#urlsession #datatask #downloadtask #main-thread
- NetworkingShort answerDoorDash
Provided completion code and choosing an async style
In a coding screen the company hands you completion-handler-based networking code and a JSON file, asks for a list screen, and says you can use async/await, Co…
#async-await #continuation #combine #dependency-injection
- NetworkingShort answerByteDance
How HTTPS capture works and defending against it
How can tools like Charles and Proxyman show app traffic that's encrypted with HTTPS in plain text?
#https #mitm #proxy #certificate-pinning
- NetworkingShort answerTencent
URLSession redirect handling
After login, a request sent with an Authorization header gets a 302 from the server to a different host, and then a 401 comes back. Why did that 401 happen?
#redirect #urlsession-delegate #authorization-header #302
- NetworkingShort answerAlibaba Group
What HTTPDNS is for and its side effects
There are reports that API access is slow, or lands on the wrong server, only for users on certain carriers and in certain regions, and a senior teammate says …
#dns #httpdns #sni #cdn
- NetworkingMultiple choice토스
Sending JSON POST with URLRequest
For a take-home assignment you wrote this code that POSTs JSON with URLRequest. Select all the statements that correctly describe problems with it. …
#urlrequest #post #content-type #status-code
- NetworkingShort answer지마켓글로벌
REST from the client's side
The interviewer says "explain what a RESTful API is." Going beyond the textbook definition, from the point of view of someone building an iOS client, how does …
#rest #http-method #idempotent #api-design
- NetworkingShort answerCitiinterview report
Designing a networking layer on URLSession
In a phone screen you're asked to design a simple networking layer in Swift. Without third parties, what types would you put on top of URLSession, and what is …
#networking-layer #endpoint #generic #error-handling
- NetworkingShort answerCalm
Fetching, sorting, and showing a JSON list (live coding)
This is a senior iOS virtual onsite, live coding. You have to build, without searching, an app that fetches a list of content from a public JSON API, parses it…
#json #codable #sorting #live-coding
- NetworkingShort answerThe New York Timesinterview report
Parsing XML and a display transform layer
A take-home assignment asks you to download an XML feed from the company's API, show it as a list, and add a feature that swaps the English strings for made-up…
#xml #xmlparser #parsing #take-home
- NetworkingShort answer
HTTPS and TLS
When the app sends a request to https://api.example.com, what happens at the TLS level before the first byte comes back?
#https #tls #certificate #ats
- NetworkingShort answer
Image upload pipeline
Say you're building a feature that uploads several profile photos. What does the multipart request that a library builds for you actually look like?
#multipart #upload #heic #photokit
- NetworkingShort answer
WebSocket connection management
You've got a bug report that the chat app's WebSocket connection drops often and the app is slow to notice. How would you detect a dropped connection promptly …
#websocket #urlsessionwebsockettask #reconnect #ping
- NetworkingShort answer
Diagnosing one network environment
A report says image uploads work on cellular but fail only on the office Wi-Fi. What causes would you suspect?
#debugging #wifi #captive-portal #proxy
- NetworkingMultiple choice
Canceling an async URLSession request
In this Swift Concurrency code that sends a URLSession request, task.cancel() runs before the network response arrives. What happens? …
#async-await #cancellation #task #urlerror
- NetworkingShort answer
Token refresh concurrency
Five API calls go out at once when a screen appears, the access token has expired, and all five get a 401. Right now each request calls refresh on its own, so …
#auth #token-refresh #actor #401
- NetworkingMultiple choice
URLSessionConfiguration options
In an app that uses URLSession, a user on the subway loses the connection for a moment. Instead of failing immediately, you want the request to wait until the …
#urlsessionconfiguration #waitsforconnectivity #timeout
- NetworkingShort answerApple
Image downloader and cache (request coalescing)
In a coding interview you're asked to build, in 30 minutes, an ImageManager that fetches an image by URL and returns it from cache if it's been fetched before.…
#image-cache #nscache #actor #in-flight
- NetworkingShort answerDoorDash
Search debounce, cancellation, and out-of-order responses
You're asked to build, without third parties, a screen that calls a server search API on every keystroke in a search bar and refreshes the results list. How wo…
#search #debounce #task-cancellation #race-condition
- NetworkingShort answerPayPal
Idempotency keys for transfers
The user taps the send money button, and the signal drops right after the request goes out. What should the app do?
#idempotency #retry #payments #reliability
- NetworkingMultiple choiceRevolutinterview report
Handling a payment request timeout
A payment confirmation request, POST /payments, failed with URLError.timedOut. Select all the correct statements.
#timeout #idempotency #retry #urlsessionconfiguration
- NetworkingShort answerNetEase
Resuming large downloads and integrity
You're downloading an audio file of several hundred MB, and the app gets terminated or the network drops. You want to resume instead of starting over. Which HT…
#range-request #resume-data #download-task #integrity
- NetworkingMultiple choiceMeituan
TLS 1.3 vs 1.2
The server team moved to TLS 1.3 and says app connections got faster. Select all the statements that correctly describe what changed from TLS 1.2 to 1.3.
#tls #tls13 #handshake #forward-secrecy
- NetworkingMultiple choiceSonyinterview report
Downloading large media
You're building a feature that downloads video and audio files (hundreds of MB to GB) for offline playback. Select all the correct statements about a URLSessio…
#download-task #background-session #media #resume-data
- NetworkingShort answer코인원interview report
REST snapshot plus WebSocket delta consistency
This is an exchange app's order book and ticker screen. The design fetches the current snapshot over REST first and then applies only the changes (deltas) that…
#websocket #snapshot #sequence-number #orderbook
- NetworkingMultiple choice스푼라디오interview report
Live broadcast: HLS and WebSocket roles
In a live audio broadcast app, the broadcast audio plays over HLS and chat goes over WebSocket. Select all the correct statements about the two protocols' char…
#hls #websocket #streaming #live
- NetworkingShort answer카카오엔터테인먼트interview report
FairPlay key exchange on HLS
A music and video streaming app plays paid content over HLS and has to add FairPlay Streaming (DRM) for copyright protection. On top of the HLS playback flow, …
#hls #fairplay #drm #avcontentkeysession
- NetworkingShort answer
Network metrics and request priority
A report says the app is slow only for users in one region, but the server metrics look normal. What would you measure in the app's network layer to split the …
#urlsessiontaskmetrics #priority #http2 #connection-coalescing
- NetworkingShort answerPayPalinterview report
Priorities in an API-to-list exercise
In a one-hour exercise you're asked to build an app that calls a public API and shows the results in a list, and you'll be graded on architecture, error handli…
#live-coding #architecture #error-handling #pagination
- NetworkingShort answer
Background session completion
A large file is downloading through a background URLSession and the app gets terminated completely (by the system, not a swipe up). When the download finishes,…
#background-session #handleeventsforbackgroundurlsession #downloadtask #delegate
- NetworkingMultiple choice
HTTP cache revalidation
A server response came with Cache-Control: max-age=60 and ETag: "abc" and was stored in URLCache. With the default cache policy (.useProtocolCachePolicy), if y…
#urlcache #etag #cache-control #304