Platform system-design scenarios and interviews
Scenario: app returns after process death
Symptoms: blank checkout, missing navigation ID, singleton is null.
Reasoning:
- Activity/task navigation was restored.
- The old process and every in-memory object were gone.
- Essential state lived only in a singleton.
- Restore small keys through saved state and reload durable business data from persistence/server.
Scenario: release works in debug but crashes
Check R8/obfuscation, reflection, generated adapters, resource shrinking, release-only manifest placeholders, signing, and environment configuration. Reproduce with the actual release variant and retrace obfuscated stack traces using mapping files.
Scenario: TransactionTooLargeException
Inspect Bundles, saved state, fragment arguments, Intent extras, and Binder calls. Pass IDs/URIs, not large object graphs or bitmaps; reload data at the destination.
Interview questions
Task versus process?
A task is a user navigation history of Activities. A process is an OS execution container with memory and threads. They have different lifetimes.
Does Service run in background thread?
No. A Service is a component/lifetime abstraction and runs callbacks on the main thread unless work is dispatched.
What is Binder?
Android's IPC mechanism using proxies, stubs, Parcels, the Binder driver, identity, and remote process threads.
Why can Fragment binding leak?
The Fragment may remain while its View is destroyed. A retained binding keeps the old View tree reachable.
Checklist
- I distinguish component, task, and process lifetimes.
- I can explain cold-start steps and process death.
- I understand DEX, ART, Binder, and transaction limits.
- I know Activity reuse and
onNewIntentbehavior. - I use Fragment view lifecycle ownership.
- I understand resource qualifiers and configuration recreation.
- I can explain variants, dependency exposure, R8, signing, and build measurement.
Platform mastery means designing for work Android controls: process lifetime, component recreation, IPC, resources, packaging, and release optimization. Treat those as normal operating conditions, not exceptional bugs.