0% found this document useful (0 votes)
8 views3 pages

Senior Android Interview Guide

Uploaded by

osmansio
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

Senior Android Interview Guide

Uploaded by

osmansio
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Senior Android Developer Interview Prep Guide (7+ years)

1. Android Core & Lifecycle


Q1: Explain Activity, Fragment, and ViewModel lifecycle. A1: Activity: onCreate → onStart → onResume
→ onPause → onStop → onDestroy. Fragment: similar, tied to host Activity. ViewModel survives
configuration changes; tied to lifecycle owner.

Q2: Communication between Activity and Fragment? A2: Shared ViewModel scoped to Activity; LiveData
or StateFlow for reactive updates; avoid passing large objects via Bundle.

Q3: BroadcastReceiver vs ContentProvider vs Service? A3: BroadcastReceiver: event notifications;


ContentProvider: data sharing across apps; Service: background tasks, IntentService deprecated,
WorkManager preferred for background tasks.

2. Memory Management & Performance


Q4: How does Android memory management work? A4: Heap vs Stack; GC cleans unreferenced objects;
prevent leaks by avoiding static Context references, clearing listeners, using WeakReferences; tools:
LeakCanary, MAT, Profiler.

Q5: ANRs and debugging? A5: ANR occurs when main thread blocked >5s. Debug using traces.txt,
Profiler. Move heavy tasks to background threads or coroutines.

Q6: Optimizing startup time? A6: Lazy SDK initialization, deferred Room setup, Baseline Profiles, App
Startup library, lightweight layouts, avoid reflection-heavy DI at startup.

3. Concurrency & Coroutines


Q7: Threads vs AsyncTask vs Executor vs RxJava vs Coroutines? A7: Threads: manual; AsyncTask:
deprecated; Executor: parallel tasks; RxJava: reactive; Coroutines: structured concurrency, suspend
functions, use Dispatchers.IO for background.

Q8: Long-running tasks post Android 12? A8: WorkManager for deferred tasks; ForegroundService if
immediate execution; respect battery optimization.

Q9: Coroutine scopes? A9: GlobalScope (avoid), viewModelScope (tied to VM), lifecycleScope (tied to
lifecycle), SupervisorJob for isolated error handling.

4. Database & Storage Optimization


Q10: Room optimization for large datasets? A10: Paging3 for lists, indices for queries, bulk inserts in
transactions, Flow/LiveData for reactive updates, avoid main-thread queries.

1
Q11: Data sharing across apps? A11: ContentProvider, FileProvider, AIDL/Binder for IPC, Broadcasts for
messages (beware security).

5. Networking & API Efficiency


Q12: Reduce network latency & battery usage? A12: OkHttp caching, conditional GETs, batch requests,
WorkManager for sync, GZIP/Protobuf payloads, HTTP/2 keep-alive connections.

Q13: API versioning? A13: Backward-compatible responses, feature flags, handle deprecated fields
gracefully, use sealed classes or Result wrappers.

6. UI, Graphics & Compose Optimization


Q14: Optimize RecyclerView / LazyColumn for 10k+ items? A14: Paging3, DiffUtil, ViewHolder reuse,
placeholders, snapshotFlow in Compose.

Q15: UI rendering optimization? A15: Shallow view hierarchy, ConstraintLayout, avoid overdraw, recycle
bitmaps, use remember in Compose, hardware acceleration profiling.

Q16: Custom Views drawing? A16: Override onMeasure, onLayout, onDraw, minimize object allocations
in onDraw, cache Paint objects.

7. Navigation & Architecture


Q17: Navigation Components vs Compose Navigation? A17: XML-based: nav_graph.xml, fragments,
SafeArgs; Compose: NavHost in code, composable routes, navArguments. Backstack handled by
NavController.

Q18: Multi-module project structure? A18: - app/: entry point - core/: network, DB, UI components -
domain/: models, use cases - feature/: login, profile, dashboard Dependency: app → feature → domain
→ core.

Q19: Offline-first architecture? A19: Room cache → WorkManager for sync → conflict resolution
(timestamps) → paging for large datasets → reactive UI updates.

8. Security & App Hardening


Q20: Secure sensitive data? A20: EncryptedSharedPreferences, EncryptedFile, avoid storing secrets in
APK, certificate pinning, obfuscation with R8.

Q21: Prevent reverse engineering? A21: Code obfuscation, resource shrinking, dynamic features,
runtime checks.

2
9. Debugging & Profiling
Q22: Performance bottleneck analysis? A22: Android Studio Profiler (CPU, Memory, Network), Systrace/
Perfetto for frame drops, Logcat for ANRs, Traceview for method-level profiling.

Q23: Measuring battery consumption? A23: Energy Profiler in Android Studio, ADB Battery Historian,
optimize network calls, wake locks, background jobs, test on real devices.

10. Advanced Topics


Q24: JNI / NDK usage? A24: Native code for performance-critical tasks (image processing, crypto),
reduce Java overhead.

Q25: Animations? A25: ValueAnimator vs ObjectAnimator vs Compose animation APIs, hardware-


accelerated, avoid allocations during onDraw.

Q26: Dynamic Feature Modules? A26: Split APKs for on-demand features, reduces initial download size,
enables modular development.

11. Behavioral / Leadership Questions


Q27: Prioritize features vs tech debt? A27: Assess business value vs risk, timebox tech debt fixes,
communicate trade-offs, automate tests to prevent new debt.

Q28: Mentoring juniors & ensuring code quality? A28: Code reviews, pair programming, knowledge
sharing sessions, CI/CD pipelines, documentation.

Q29: Performance improvement story? A29: STAR method: Identify issue → analyze profiler → defer
SDK init → optimize DB → reduce PNG → result: startup 6s → 2.5s, memory usage improved.

Q30: Architecture trade-off decision? A30: Example: Hilt vs manual DI for build speed vs APK size,
justified decision with trade-offs.

Visual Diagrams (to include in PDF / prep sheet)

1. Multi-module project: app → feature → domain → core (boxes & arrows)


2. Navigation flow: NavController, NavHost, composables, fragment-based flow
3. Offline-first sync: Room DB cache → WorkManager → remote API → UI

This guide can be converted into a 1–2 page PDF cheat sheet with diagrams for quick revision before
interviews.

You might also like