Studio, Profilers & Firebase Interview Questions
BUILD & TOOLING › Delivery
Which Android Studio profilers do you use, and what is each for?
What a strong answer covers: The CPU profiler (method traces and system traces) finds slow code and main-thread work; the Memory profiler shows allocations, heap dumps and leaks; the network inspector shows requests and payloads; and the energy and power tools show battery use. Layout Inspector shows view and Compose hierarchies and recomposition counts; Database Inspector queries live Room databases.
How do you monitor crashes and app health in production?
What a strong answer covers: Use a crash reporter like Firebase Crashlytics or Sentry for crash and non-fatal reports with breadcrumbs and custom keys, Play Console's Android vitals for crash rate, ANR rate, startup and rendering compared to peers, and performance monitoring for traces and network latency. Set up alerts and look at issues by version and device.
How would you find a memory leak?
What a strong answer covers: Add LeakCanary to debug builds: it detects retained Activities, Fragments, ViewModels and Views after they should be gone and shows the reference chain causing the leak. Confirm with a heap dump in the Memory Profiler. Common causes: static references, singletons holding Context or views, listeners not unregistered, and long-lived coroutines or callbacks capturing a screen.
What is a system trace with Perfetto, and when would you use it over a method trace?
What a strong answer covers: A system trace records what all threads and processes are doing over time, including CPU scheduling, frames from the UI thread and RenderThread, Binder calls, GC and your own trace sections (Trace.beginSection or androidx.tracing). It has low overhead so timings are realistic. Method traces instrument every call and distort timing. Use system traces for jank, startup and ANR investigations, then drill down.
How do you use Firebase Remote Config, Crashlytics and Analytics together to ship a risky feature and know whether it's working?
What a strong answer covers: Put the feature behind a Remote Config flag rolled out to a percentage of users or an A/B test; tag Crashlytics reports with the flag state through custom keys so crashes can be split by variant; log analytics events that define success (conversion, engagement) and compare variants; set a kill switch. Decide the success criteria beforehand, watch both technical health and product metrics, and only then roll out to everyone and remove the flag.