Android System Design Interview Questions
34 questions
Library Design
- Design an image loading library.
Hard
Load an image from a URL into an ImageView through four stages, memory cache, disk cache, network fetch, then decode, with each stage there to make the next one unnecessary. Around the pipeline sit
- Design an LRU cache.
Hard
A hash map for O(1) lookup plus a doubly linked list for O(1) reordering, so get and put are both constant time. That is the whole data structure. The rest of the answer is why neither half works
- Design a caching library.
Hard
The design is a Cache<K, V> with a memory tier in front of an optional disk tier. Entries are evicted by bytes rather than by count, and expiry is checked lazily on read. This is the general-purpose
- Design a file downloader library.
Hard
A priority queue in front of a small pool of resumable transfers. Each one writes to a temporary file, persists its byte offset as it goes, and renames into place only once the file is whole. The
- Design a logging library.
Hard
A logging library is a leveled API in front of a set of swappable trees, with a batching writer behind the tree that persists to disk. The API has to be cheap enough to leave switched on in hot
- Design a networking library.
Hard
This is asking you to justify the shape of something like Retrofit plus OkHttp, not necessarily rebuild it from raw sockets. The useful way to answer is to name the layers and why each one exists,
- Design an analytics library.
Hard
A track() call validates the event, stamps it with an id and an identity, appends it to a queue on disk, and returns. Everything after that belongs to a background worker. Tracking an event can never
App & Feature Design
- Design a disk-based cache for the client (platform independent, 32-byte keys, byte-array values, persistent, 100k+ objects, configurable max size 10MB-1GB, opaque and secure).
Hard
A small fixed number of append only log files on disk, with an in-memory index from every 32-byte key to its shard, offset and length. Eviction is LRU against the configured cap, and every value is
- Design a server driven home screen like Swiggy or Blinkit.
Hard
How a server driven home screen works on Android, the section contract, the renderer registry, what an old app does with a widget type it has never heard of, caching, impressions and rollback, with the core code in Java and Kotlin.
- Design the components and overall architecture for a Search feature in an Android application.
Hard
Search feels like a text field and a list, but the design problem is really about not sending a network request on every keystroke while still feeling instant, and about giving the user something
- Design an error handling structure.
Medium
The goal of an error handling structure is that every layer of the app deals with one consistent error type. A ViewModel should never have to know whether a failure came from a network exception, a
- Design a Google Notes app.
Hard
A notes app looks small and is not. The interesting part is not the list screen, it is that the same note can be edited on two devices while both are offline, and both edits have to survive. Say that
- Design a trading app with real time charts and trades.
Hard
How a trading client keeps its chart and order book exactly right while thousands of ticks a second arrive, and still redraws smoothly.
- Design Instagram Stories.
Hard
Stories look like a media feature, but the design problem underneath is really about prefetching and expiry. The next story has to show instantly when the user taps, and content has to disappear
- Design live location tracking for a delivery app like Blinkit or Zomato.
Hard
How a rider app publishes its position all shift without flattening the phone, and how the customer's pin still glides across the map instead of jumping.
- Design the Uber app.
Hard
The riding app is really two apps sharing a backend, a rider client and a driver client, connected by one hard real-time requirement, both sides need to see a moving car's position update smoothly,
- Design WhatsApp.
Hard
A chat app is a good test of whether you reach for WebSocket by default or actually reason about it, messaging genuinely needs a persistent connection, but the harder design problems are message
- How do you implement a hotel list and detail screen? Discuss the APIs you would create and how the layout will work.
Hard
The trap in this question is designing one API that returns everything and one screen that renders it all at once. Hotel data splits into what's stable, photos, amenities and description, and what's
Caching & Offline
Offline and caching is where a mobile design round almost always ends up, because it is the part that separates mobile design from backend design.
- How do you build an offline-first app? Explain the architecture.
Hard
Offline-first means the local database is the source of truth the UI always reads from. The network is just one of the things that keeps that database up to date, not something the UI waits on. Get
- Implement a caching mechanism.
Medium
Room is the cache. The screen observes a table, the network writes into that table, and a failed refresh leaves the last good rows on screen. One lastFetchedAt timestamp beside the rows decides
- In an Android app, how do you handle data syncing when the network isn't stable?
Medium
An unstable network isn't the same problem as no network. It means requests intermittently fail, time out, or send partway before dropping. So the design has to assume any single attempt can fail,
Data & Security
- What is the difference between database normalization and denormalization?
Easy
Normalization splits data into separate related tables to eliminate duplication, denormalization deliberately duplicates data across tables to avoid joins and make reads faster.
- What is the difference between hashing, encrypting and encoding?
Easy
The difference is whether the transformation can be reversed, and if so, who's allowed to reverse it.
- What is the difference between symmetric and asymmetric encryption?
Easy
Symmetric encryption uses one key for both directions, the same key encrypts and decrypts. Asymmetric encryption uses a mathematically linked key pair, and the pair works two ways, the public key
Less common, worth knowing
These come up less often. Skim them once you are comfortable with everything above.
Library Design
- Design an image downloading library.
Hard
One download per URL however many callers ask for it, behind a per host permit. The bytes are committed into a disk cache through a temporary file and handed back to callers on their own thread.
App & Feature Design
- Can we identify the users who have uninstalled our application?
Medium
There is no callback. Android never tells your app it has been uninstalled, because by then nothing of yours is left running to hear it. You infer it instead, and there are two signals worth naming.
- How does "Where Is My Train" work without internet?
Medium
It does not use GPS or the network for its core trick. It uses the cell tower the phone is already camped on, since a phone keeps a tower connection for calls and SMS even with data off or unusable.
- Design a checkout screen.
Hard
The interesting part of a checkout screen isn't the layout, it's that this is the one screen in most apps where getting a network failure wrong costs the business real money, a duplicate charge or a
- Design a Facebook Near-By Friends app.
Hard
This is a location-sharing feature, opt-in, friends-only, showing who's nearby right now. The two things that make it hard are privacy, since this is exactly the kind of feature that goes badly if
- Design a real-time Twitter feed timeline. How will you structure the backend? WebSocket or REST, and why?
Hard
The honest answer is both, REST for loading the timeline and WebSocket for knowing when to refresh it, not one protocol doing everything. Picking a single protocol for the whole feature is usually
- How do voice and video calls work?
Hard
Voice and video calling is built on WebRTC, an open standard that gives browsers and mobile apps peer-to-peer real-time media. WebRTC deliberately doesn't solve the whole problem on its own, so two
- Solve design problems based on a location-based app.
Hard
Location questions come as a family, and there are only three shapes in it, nearby search, live tracking, and geofencing. Every one of them lands on the same tensions, accuracy versus battery, update
Data & Security
- What is the SMS Retriever API in Android?
Easy
The SMS Retriever API lets your app automatically read a one-time verification code from an incoming SMS, without asking the user for the READSMS or RECEIVESMS permission.
- How do you get accurate time in Android?
Medium
You do not get trustworthy wall clock time from the device, because the user can set it to anything. So you ask a source you trust once, and from then on you count forward with a clock the user