All bites
The whole library, newest first. Filter by what you are here for, or pick a topic if you already know.
4330 bites
Page 203

Explain generational GC in ART and why onDraw must avoid allocations
Covers young-gen nursery, mark-sweep fallback, and why a 5-10ms GC pause misses 16ms frame deadline.

How would you use Perfetto and Trace.beginSection to find a non-obvious bottleneck?
Tests correlation beyond CPU sampling. Covers coarse Trace.beginSection to limit 1-10us overhead, recording app ATrace with CPU/scheduling tracks, and correlating slices against scheduler latency. Red flag: omitting overhead or ignoring Perfetto SQL queries.

Purpose of Android app signing and keystore contents
Signing proves authorship and integrity, enables same-key updates, and binds app identity; a keystore holds private keys and certificates.

What is an Android App Bundle and its advantages over APK?
Tests knowledge of modern Play distribution. AAB is the publishing format with all code and resources; Play generates device-specific APKs for smaller downloads and supports dynamic features. Red flag: calling it a compressed APK or ignoring dynamic delivery.

Release build ClassNotFoundException not in debug: cause and file?
Tests R8 shrinking awareness: release-only obfuscation removes classes loaded by reflection. Check proguard-rules.pro first and add a -keep rule. Red flag: blaming multidex or disabling minification rather than writing a targeted keep rule.

Google Play App Signing: upload key versus app signing key
Tests Android signing infrastructure and key escrow knowledge. A strong answer states Google holds the app signing key while you retain an upload key, protecting critical signing material. Red flag: claiming both keys sign the final install artifact.
Describe staged rollout on Google Play Console, benefits, and metrics to monitor
Tests release engineering and risk mitigation. Covers: set percentage and countries, manually ramp, halt on bad signals; benefits are blast-radius reduction and real-world validation. Flag: auto-ramping claims or ignoring halted users keep the bad build.

Explain R8's shrinking, obfuscation, and optimization phases and how to influence optimization
Separate dead code removal, renaming, and bytecode transformation; cite ProGuard keep rules and selective passes.

Write the ProGuard keep rule to fix reflection after R8
This tests R8 dead-code removal and exact ProGuard syntax for reflective constructors. A strong answer gives -keep class com.example.T { <init>(...); } because R8 cannot trace dynamic class names. Broad -keep rules or omitting constructor are red flags.

How does App Bundle handle ABI splits versus multi-APK?
Tests dynamic delivery of native libs: AAB auto-generates per-ABI config splits, but multi-APK requires manual APK builds per ABI. Misconfiguration ships unused .so bloat or crashes on unsupported devices. Red flag: calling AAB a simple multi-APK zip.

What are RecyclerView.Adapter and ViewHolder, and why do they improve scrolling?
This tests RecyclerView's data-to-view separation. A strong answer says Adapter binds data while ViewHolder caches findViewById results, avoiding hierarchy scans on scroll. A red flag is calling ViewHolder a memory saver instead of a lookup cache.

How do include, merge, and ViewStub optimize deep layout nesting?
This tests Android view inflation and hierarchy flattening. A strong answer covers include for reuse, merge to strip redundant parents during inflation, and ViewStub for lazy-loading heavy views. A red flag is conflating them or citing XML brevity alone.

Explain touch event dispatch in a ViewGroup with a clickable child
It tests touch routing through the three key methods. A strong answer traces ACTION_DOWN from root to target, notes intercepting halts child delivery, and onTouchEvent true consumes while false bubbles up.

How do you diagnose and optimize a slow Room query?
Tests SQLite profiling and Room optimization. Isolate the query with Database Inspector, run EXPLAIN QUERY PLAN to spot scans, then add covering indexes, rewrite joins, or use Paging3. Red flag: blindly adding indexes or switching to NoSQL without measuring.
Difference between @Path and @Query in Retrofit with example URLs
Tests Retrofit URL construction. @Path fills a path template like /users/{user}/repos with "octocat" to make /users/octocat/repos. @Query appends ?q=retrofit to /search/repos. Red flag: claiming @Query changes the path.

OneTimeWorkRequest vs PeriodicWorkRequest and minimum repeat interval
Tests WorkManager scheduling constraints and battery tradeoffs. Contrast one-shot chaining with non-chained periodic work, cite the 15-minute minimum, and tie it to system batching under Doze and App Standby. Red flag: claiming exact intervals or no minimum.

Chain WorkManager tasks and pass a file URI between workers.
This tests WorkManager chaining and data passing. A strong answer chains Download, Unzip, and Process with WorkContinuation, passes URI via outputData, and reads it with inputData. A red flag is suggesting global state, SharedPreferences, or thread blocking.

Roles of minifyEnabled and shrinkResources and common pitfalls
Tests R8 code shrinking vs resource stripping and runtime risks. Outline: minifyEnabled shrinks code; shrinkResources removes unused assets and requires minifyEnabled; dynamic access like getIdentifier() crashes; keep resources with tools:keep or keep.xml.

Create a custom View from scratch that draws a shape
This tests Android View measurement and drawing contracts. A strong answer covers: onMeasure resolves dimensions against parent MeasureSpec; onDraw renders with Canvas and Paint; constructors parse attributes.
How do you implement OAuth2 token refresh with Retrofit Authenticator?
Implement authenticate() with a blocking refresh, new Request with new token, Mutex for parallel 401s.