Your crash reports show rising out-of-memory crashes after a release. How do you find and fix the problem?
What the interviewer wants to hear
- Use crash data to narrow the version, devices and user flows
- Reproduce the flow and profile memory over repeated navigation
- Use LeakCanary, Android Studio Profiler, Xcode Memory Graph or Instruments
- Common causes: retained contexts, retain cycles, listeners, large bitmaps, caches
- Fix, add tests or checks, and verify with staged rollout metrics
Model answer
First I narrow it down with data: which version introduced it, which devices, and what breadcrumbs or screens appear before the crash. Rising OOMs after many minutes usually mean a leak, while instant OOMs on one screen point to huge allocations like full-size bitmaps. Then I reproduce the flow, for example opening and closing the product screen twenty times, while watching memory in Android Studio Profiler or Xcode Instruments. If memory climbs and never returns, I take a heap dump or use the Xcode Memory Graph to see which objects are retained and by what. LeakCanary helps catch Android leaks automatically in debug builds. Typical causes are closures capturing self strongly, unregistered listeners, static references to an Activity, unbounded caches and undecoded large images. After fixing, I watch the OOM rate in the staged rollout before releasing to everyone.
Can you answer it under time pressure?
Take a timed hard round and get scored on every answer.
More hard Mobile App Developer questions
- How would you design the mobile client for a chat app like WhatsApp?
- Your app has grown to 40 developers and one huge module. Builds are slow and teams block each other. How would you restructure it?
- A delivery app must track the rider location all day. How do you balance accuracy with battery life and OS limits?
- In a Flutter or React Native app, you need a feature that only exists in native SDKs, such as a payment terminal SDK. How would you integrate it well?
- How would you measure and improve app performance for real users in production, not just on your test phone?
- Users keep running old versions of your app for months. How do you evolve the API and decide when to force an update?
- How would you implement secure login with an OAuth or OpenID Connect provider in a mobile app?
- How would you migrate a large UIKit or Android View app to SwiftUI or Jetpack Compose without stopping feature work?
- Millions of users have data in your app local database. How do you change the schema safely?