> For the complete documentation index, see [llms.txt](https://notes.tejpratapsingh.com/_/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://notes.tejpratapsingh.com/_/android-tips/interview/general-kotlin-and-android-dev.md).

# General Kotlin and Android Dev

### Kotlin & Language

1. What are the key differences between `inline`, `noinline`, and `crossinline` functions in Kotlin?
2. How do coroutines differ from RxJava in terms of cancellation, backpressure, and thread management?
3. Explain the difference between `Flow` and `LiveData`—when would you choose one over the other?
4. What are reified type parameters and what limitations do they solve?
5. How does Kotlin's delegation pattern (`by`) work under the hood, and where have you used it in production?
6. What are the risks of using `suspend` functions inside non-suspending lambdas?
7. How do you handle structured concurrency when launching coroutines in custom `ViewModel` scopes?
8. Explain the difference between `SharedFlow` and `StateFlow` with respect to configuration and replay behavior.
9. What is the purpose of `sealed` classes versus `sealed` interfaces in Kotlin, and how do they affect exhaustive `when` expressions?
10. How do you prevent memory leaks when using coroutines in custom views or long-lived components?

***

### Android Architecture & Design Patterns

11. Describe the evolution of your app's architecture from MVP to MVVM to MVI—what drove each transition?
12. How do you enforce unidirectional data flow in a large-scale app with multiple feature modules?
13. What is your approach to designing a clean architecture boundary between domain and data layers?
14. How do you handle navigation in a multi-module app—do you prefer the Navigation Component, custom routers, or something else?
15. What are the trade-offs of using a monolithic `ViewModel` versus splitting state into multiple smaller `ViewModel`s?
16. How do you manage shared state across features without creating tight coupling?
17. Explain how you would architect a feature that needs to work both online and offline with eventual consistency.
18. What strategies do you use to prevent `ViewModel` bloat when a screen has complex business logic?
19. How do you approach error handling architecture—do you use `Result` types, exceptions, or domain-specific error models?
20. Describe how you would structure a feature module to be reusable across multiple apps in your organization.

***

### Jetpack Compose & UI

21. How does Compose's recomposition model differ from the traditional View system's invalidate/measure/layout cycle?
22. What techniques do you use to optimize recomposition in deeply nested Composable hierarchies?
23. How do you handle state hoisting when a Composable is used across multiple screens with different state requirements?
24. Explain the difference between `remember`, `rememberSaveable`, and `derivedStateOf` with concrete use cases.
25. How do you integrate Compose into an existing large codebase using the legacy View system?
26. What is your strategy for theming and design system adoption in Compose at scale?
27. How do you test Composables that rely on `LaunchedEffect` or `DisposableEffect`?
28. What are the pitfalls of using `Modifier` chains extensively, and how do you avoid them?
29. How do you handle animations in Compose while maintaining 60fps on low-end devices?
30. Describe your approach to building accessible Composables—what tools and testing practices do you enforce?

***

### Performance & Optimization

31. How do you diagnose and fix ANRs in production, not just during development?
32. What is your process for investigating memory leaks using the Memory Profiler and Heap Dumps?
33. How do you optimize RecyclerView scrolling performance when dealing with heterogeneous view types and images?
34. What strategies do you use to reduce APK size in a multi-module app with heavy native dependencies?
35. How do you benchmark app startup time, and what specific optimizations have you implemented?
36. Explain how you would optimize battery consumption for an app using location services in the background.
37. What are the trade-offs between using ProGuard, R8, and DexGuard in a commercial app?
38. How do you handle large bitmaps without running into `OutOfMemoryError`?
39. What tools do you use to profile jank and frame drops, and what are the most common causes you've fixed?
40. How do you optimize Room database queries for screens that display complex relational data?

***

### Networking, Data & Storage

41. How do you design a network layer that gracefully handles flaky connectivity and retries?
42. What is your strategy for caching API responses—do you prefer OkHttp cache, Room, or a custom solution?
43. How do you handle API versioning and backward compatibility when the backend ships breaking changes?
44. Explain your approach to syncing local database state with remote server state in a conflict-prone environment.
45. How do you manage API keys and sensitive configuration in a way that resists reverse engineering?
46. What is your experience with GraphQL on Android, and how does it compare to REST in production?
47. How do you implement pagination at the data layer—Paging 3, custom solutions, or a hybrid?
48. Describe how you would migrate a production database schema using Room without data loss.
49. How do you handle large JSON payloads efficiently without blocking the UI thread?
50. What is your approach to data serialization—Kotlinx Serialization, Moshi, Gson, or Protobuf? Why?

***

### Testing & Quality Assurance

51. What is your testing pyramid for an Android app, and what coverage thresholds do you enforce?
52. How do you write effective UI tests for flows that depend on biometric authentication or hardware sensors?
53. What is your strategy for testing ViewModels that interact with multiple UseCases and Repositories?
54. How do you handle flaky Espresso tests in CI, and what alternatives have you evaluated?
55. What mocking framework do you prefer—MockK, Mockito-Kotlin, or fakes—and why?
56. How do you test coroutine-based code that involves `Dispatchers.IO` or `Dispatchers.Main`?
57. Describe your approach to screenshot testing and how you prevent visual regressions.
58. How do you enforce code quality standards across a team of developers with varying skill levels?
59. What is your process for conducting thorough code reviews on architectural changes?
60. How do you test edge cases in background work like WorkManager tasks or foreground services?

***

### Security

61. How do you securely store OAuth tokens and refresh tokens on Android?
62. What is your approach to certificate pinning, and how do you handle certificate rotation?
63. How do you protect against reverse engineering and tampering in a high-risk app?
64. Explain how Android Keystore System works and when you would use it over EncryptedSharedPreferences.
65. What measures do you take to prevent intent hijacking and exported component vulnerabilities?
66. How do you handle root detection and emulator detection in financial or healthcare apps?
67. What is your strategy for obfuscating sensitive business logic beyond standard R8 rules?
68. How do you implement secure inter-process communication between your app and a SDK or partner app?
69. What are the risks of using `WebView` for sensitive flows, and how do you mitigate them?
70. How do you ensure compliance with GDPR or CCPA data handling requirements in your Android app?

***

### Background Processing & System Integration

71. How do you choose between WorkManager, Foreground Service, AlarmManager, and JobScheduler for a given task?
72. What are the implications of Android 12+ restrictions on foreground services and exact alarms?
73. How do you implement reliable push notification delivery using FCM, especially for time-sensitive data?
74. Describe how you would design a background sync engine that respects Doze mode and App Standby.
75. How do you handle Bluetooth LE scanning and connections while managing battery impact?
76. What is your experience with Android's Camera2/CameraX APIs, and how do you handle device-specific quirks?
77. How do you implement deep linking that works consistently across notification taps, widgets, and external apps?
78. What strategies do you use for handling media playback in the background with proper audio focus?
79. How do you manage permissions across Android versions, especially for location, notifications, and Bluetooth?
80. Describe your approach to implementing widgets and ensuring they update reliably without draining battery.

***

### Build System, CI/CD & Tooling

81. How do you structure a Gradle build to support multiple build variants, flavors, and feature modules efficiently?
82. What is your strategy for managing dependency versions across a large multi-module project?
83. How do you optimize Gradle build times for a team of 10+ developers?
84. Describe your CI/CD pipeline—what checks run on PR, merge, and release builds?
85. How do you automate app distribution to internal testers, beta users, and production?
86. What is your approach to versioning and release management in a fast-paced delivery cycle?
87. How do you handle build failures caused by transitive dependency conflicts?
88. What static analysis tools do you enforce—Detekt, KtLint, Android Lint, custom rules?
89. How do you manage secrets and signing configurations in CI without exposing them in repository history?
90. Describe how you would set up a modular build system where features can be developed and tested in isolation.

***

### Leadership, Team & Process

91. How do you onboard a junior developer and bring them up to speed on your team's architecture?
92. Describe a time you had to push back on a product requirement due to technical constraints—how did you handle it?
93. How do you balance shipping features quickly with maintaining long-term code health?
94. What is your approach to resolving technical disagreements within the team?
95. How do you mentor developers who are resistant to adopting new patterns like Compose or coroutines?
96. Describe how you would plan the migration of a legacy Java codebase to Kotlin while keeping the app shippable.
97. How do you ensure knowledge is distributed and no single developer is a bottleneck?
98. What is your process for evaluating new libraries or architectural patterns before team-wide adoption?
99. How do you communicate technical debt and its impact to non-technical stakeholders?
100. How do you handle a critical production crash when the root cause is unclear and pressure is high?

***

### System Design & Cross-Functional

101. Design a real-time chat feature that supports offline messaging, media sharing, and end-to-end encryption.
102. How would you architect an app that needs to support both phone and tablet form factors with shared code?
103. Design a navigation and routing system for an app with 50+ screens and deep linking requirements.
104. How would you build a SDK that third-party developers integrate into their apps—what constraints matter most?
105. Describe the architecture for an app that streams video with adaptive bitrate and offline download support.
106. How would you design a feature flag system that works across Android, iOS, and backend?
107. Design a local-first architecture where the app remains fully functional without network for days.
108. How would you approach building a white-label Android app framework used by multiple brands?
109. Describe how you would design an analytics pipeline that respects user privacy while providing product insights.
110. How would you architect an Android app that integrates with a complex existing backend built for web-first?

***

### Emerging Tech & Future-Proofing

111. What is your assessment of Kotlin Multiplatform for sharing code between Android and iOS in production?
112. How do you evaluate the maturity of Jetpack Compose for replacing an entire existing UI layer?
113. What is your understanding of Android's declarative UI evolution beyond Compose—like Glance for widgets?
114. How do you stay current with Android platform changes and decide when to adopt new APIs?
115. What is your view on large language models or on-device AI integration in Android apps?
116. How do you approach foldable and large-screen device support from an architectural standpoint?
117. What role do you see for Baseline Profiles and Macrobenchmark in your performance strategy?
118. How do you think about Wear OS, TV, or Auto development in relation to your mobile app strategy?
119. What is your experience with server-driven UI frameworks, and when are they appropriate?
120. How would you prepare your team's architecture for potential future platform shifts or form factors?


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://notes.tejpratapsingh.com/_/android-tips/interview/general-kotlin-and-android-dev.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
