Requirements and Device Constraints

Topics Covered

The Device as a Constrained Node

Functional requirements first, but briefly

Networks are slow, variable and often absent

Data costs and constrained modes

Battery is the budget you share with everything else

What the interviewer is checking here

Reading network state without trusting it

In a backend design you choose the hardware. You pick instance sizes, add machines when load rises and put them in data centres with redundant power and fast networks. In a mobile design you choose none of this. Your code runs on hardware the user bought, sometimes years ago, on a network they do not control, with a battery they expect to last all day, inside an operating system that will pause or kill your process whenever it decides another app matters more. That is why requirements in a mobile round are as much about constraints as about features.

This lesson covers those constraints one by one: networks, battery, memory, storage and CPU, the operating system lifecycle, the store and update cycle, old versions in the wild, and accessibility and localisation. The last section gives you a bank of scoping questions that turn these constraints into a short, written list in the first five minutes of the round. The previous lesson explained where requirements sit in the six step framework; this one is about what to ask and why each answer changes the design.

Functional requirements first, but briefly

Start with what the app does. Restate the product in a sentence, list the core features and confirm which are in scope. For a photo sharing app that might be: view a feed of photos from accounts you follow, like and comment, post a photo with a caption, see notifications for activity on your posts. Stories, direct messages, search and editing filters are probably out of scope unless the interviewer wants them.

Keep this to two or three minutes. Interviewers rarely score feature lists highly on their own; they score whether you pick a sensible core and whether you notice which features are hard on a device. Posting a photo is hard because of upload over bad networks. Viewing the feed is hard because of images, memory and cold start. Notifications are hard because of push delivery and background limits. Say that out loud as you list them, because it previews your deep dives.

Networks are slow, variable and often absent

The biggest difference between a server and a phone is the network. A server talks to its neighbours over links with sub millisecond latency and almost no loss. A phone talks to the internet over a radio link whose quality changes every few seconds.

Round trip times vary hugely. On good Wi-Fi or a strong 5G signal a round trip to a nearby server can take a few tens of milliseconds. On a congested 4G cell it can be one or two hundred. On a weak 3G or 2G connection, still common in parts of the world and in buildings, trains and rural areas everywhere, it can be many hundreds of milliseconds, with bandwidth measured in tens of kilobytes per second. Satellite messaging on recent phones exists but carries only tiny payloads at very high latency. A design that makes six sequential requests to show the first screen might take a third of a second on Wi-Fi and three seconds or more on a weak cellular link.

Connections also break. When a user walks out of their house, the phone moves from Wi-Fi to cellular and gets a new IP address. Every open TCP connection on the old network dies, often in the middle of a response. Lifts, tunnels, underground stations and aeroplanes cut the network entirely. Captive portals in hotels and airports make the network look connected while returning login pages instead of your API. The client has to treat every request as one that might time out with no way of knowing whether the server processed it.

Leaving Wi-Fi breaks open connections; the client has to notice and retry safely on the new network.

Some of this is softened by modern protocols. HTTP/3 over QUIC supports connection migration, so a connection can survive an IP change if both client and server support it, and both platforms' standard HTTP stacks can use HTTP/3 when the server offers it. But your design cannot rely on it everywhere. The safe assumption is that any request can fail at any point, so writes need idempotency keys and retries, reads need cached fallbacks, and the UI must never block on a request whose answer the user does not strictly need.

Data costs and constrained modes

In many markets mobile data is expensive relative to income, and users watch their data usage closely. Both platforms expose this. iOS marks a network as expensive (cellular or a personal hotspot) or constrained (the user turned on Low Data Mode) through the Network framework and URLSession settings. Android exposes metered networks and the user's Data Saver setting through ConnectivityManager. A good design checks these signals and changes behaviour: skip video autoplay and prefetching on constrained networks, upload large files only on unmetered networks unless the user asks otherwise, and request smaller image variants.

Ask the interviewer about it directly: are many users on slow or expensive data? If the answer is yes, data efficiency becomes a top requirement and shapes payload design, image sizes and prefetching.

Battery is the budget you share with everything else

Users notice battery drain and they blame the app at the top of the battery settings screen. Both operating systems show per app battery usage, and both throttle apps that use too much in the background. Battery cost on a phone comes mainly from four places: the screen, the cellular and Wi-Fi radios, location hardware and the CPU and GPU.

The radio deserves special attention because its cost is not proportional to bytes. When the app sends a request on cellular, the radio moves into a high power state, transfers the data and then stays in that high power state for several seconds in case more data follows, before stepping down to idle. This trailing period is often called the radio tail. Ten requests of two kilobytes each, spread over a minute, can keep the radio in its high power state for most of that minute. The same twenty kilobytes sent in one batch costs one wake and one tail.

The radio stays awake after each transfer, so scattered small requests cost far more than one batch.

The design consequence is to batch and defer. Analytics events are queued and sent in batches every few minutes or when the app goes to the background. Prefetching happens while the radio is already awake for a user request. Background sync is left to the operating system's schedulers, which line up work from many apps into shared windows. Location updates use the coarsest accuracy and lowest frequency the feature allows. When the user enables Low Power Mode on iOS or Battery Saver on Android, the app should cut optional work further, and both platforms let you detect those modes.

What the interviewer is checking here

When you raise networks and battery in the requirements, the interviewer is checking whether you think of the phone as a phone. A candidate who asks should the app work offline, what networks are users on, and is there a battery budget for features like live location has shown device awareness before drawing a single box. Those three questions set up the whole design: offline means a local source of truth, slow networks mean small payloads and resumable transfers, and a battery budget means batching and careful background work.

Reading network state without trusting it

Both platforms let the app observe the current path: NWPathMonitor on iOS and ConnectivityManager network callbacks on Android report whether a network is available, whether it is Wi-Fi or cellular, and whether it is expensive or constrained. Use these signals to choose behaviour, such as pausing a large download on cellular or showing an offline banner, but never as proof that a request will succeed. A phone can report a connected Wi-Fi network that has no route to the internet, or a strong cellular signal on a congested cell. The reliable test is the request itself. That is why good clients combine path monitoring with per request timeouts, retries with backoff, and waiting for connectivity rather than failing instantly. On iOS, URLSession can wait for connectivity before starting a request instead of failing; on Android, WorkManager constraints can hold work until a suitable network appears.

Count wake ups, not bytes

On cellular, the cost of a request is dominated by waking the radio and the several seconds it stays in high power afterwards, not by the size of the payload. Batching small transfers into fewer, larger ones is usually the biggest single battery win in a networked app.