└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # cp-android-interview-questions 2 | I'm confident that this repository will be a valuable resource for you as you prepare for Senior Android interviews in 2023. The questions included here were asked of me during my own interviews with various companies, and I believe that the answers I found through the linked articles were well-received by my interviewers. If you have any additional questions to contribute, I welcome your contributions to this growing resource. Best of luck in your interview journey! 3 | 4 | 1. ViewModel ( Don't miss the basics ): https://medium.com/androiddevelopers/viewmodels-a-simple-example-ed5ac416317e 5 | 2. Android lifecycle cheat sheet ( Don't ignore the activity, fragment lifecycle at all ): https://medium.com/androiddevelopers/the-android-lifecycle-cheat-sheet-part-i-single-activities-e49fd3d202ab 6 | 3. Threading fundamentals and Kotlin coroutines basics: https://proandroiddev.com/kotlin-coroutines-and-threading-fundamentals-9fd0130437ae 7 | 4. Difference between launch and async in Kotlin coroutines: https://stackoverflow.com/questions/46226518/what-is-the-difference-between-launch-join-and-async-await-in-kotlin-coroutines 8 | 5. Suspend functions in coroutines: https://stackoverflow.com/questions/47871868/what-does-the-suspend-function-mean-in-a-kotlin-coroutine 9 | 6. Difference between abstract classes and interface: https://stackoverflow.com/questions/1913098/what-is-the-difference-between-an-interface-and-abstract-class 10 | 7. Understanding the MVVM architecture: https://proandroiddev.com/mvvm-architecture-viewmodel-and-livedata-part-1-604f50cda1 11 | 8. Understanding MVI architecture: https://medium.com/swlh/mvi-architecture-with-android-fcde123e3c4a 12 | 9. Difference between setValue() and postValue(): https://stackoverflow.com/questions/51299641/difference-of-setvalue-postvalue-in-mutablelivedata 13 | 10. When to use coroutineScope() vs supervisorScope(): https://stackoverflow.com/questions/53577907/when-to-use-coroutinescope-vs-supervisorscope 14 | 11. Best practice for storing & protecting private API keys in applications: https://stackoverflow.com/questions/14570989/best-practice-for-storing-and-protecting-private-api-keys-in-applications 15 | 12. Making multiple coroutine API calls and waiting all of them: https://stackoverflow.com/questions/62892071/making-multiple-coroutine-api-calls-and-waiting-all-of-them 16 | 13. System design interview framework: https://proandroiddev.com/a-simple-framework-for-mobile-system-design-interviews-89f6f4134b84 17 | 14. Custom views: https://proandroiddev.com/android-custom-view-level-1-67ed1c3febe1 18 | 15. Dependency injection: https://medium.com/androiddevelopers/dependency-injection-on-android-with-hilt-67b6031e62d 19 | 16. Design patterns in Android: https://medium.com/@ahmadkazimi/6-design-patterns-every-android-developer-must-know-53d912b5864b 20 | 17. Intent filters: https://stackoverflow.com/questions/3321514/what-are-intent-filters-in-android 21 | 18. Communication between two apps: https://stackoverflow.com/questions/4638939/android-communication-between-two-applications 22 | 19. When to use inline function in kotlin: https://stackoverflow.com/questions/44471284/when-to-use-an-inline-function-in-kotlin 23 | 20. Why and when to use @JvmStatic with companion objects: https://stackoverflow.com/questions/48780003/why-and-when-to-use-jvmstatic-with-companion-objects 24 | 21. Kotlin flows: https://medium.com/yemeksepeti-teknoloji/introduction-to-kotlin-flows-827f5a71ad7e 25 | 22. Recycler view ( No one asked, but it's better to brush up ): https://medium.com/androiddevelopers/getting-to-know-recyclerview-ea14f8514e6 26 | 23. DiffUtils: https://medium.com/android-news/smart-way-to-update-recyclerview-using-diffutil-345941a160e0 27 | 24. Java hashmap internal implementation: https://anmolsehgal.medium.com/java-hashmap-internal-implementation-21597e1efec3 28 | 25. Difference between array and array list: https://www.javatpoint.com/difference-between-array-and-arraylist 29 | 26. What is the purpose of looper and how to use it: https://stackoverflow.com/questions/7597742/what-is-the-purpose-of-looper-and-how-to-use-it 30 | 27. Using a thread pool in Android: https://medium.com/@frank.tan/using-a-thread-pool-in-android-e3c88f59d07f 31 | 28. How to obtain ANR traces.txt from device: https://stackoverflow.com/questions/5316322/android-how-to-obtain-data-anr-traces-txt-from-samsung-galaxy-tab 32 | 29. Race conditions and how to handle it gracefully: Couldn't find a good article. You will have to make up an answer by saying if two threads try to modify an object at the same time and how it can affect it's results kinds. DiffUtils, Object classes are good examples where race conditions can happen. 33 | 30. Thread safety in Java singleton class: https://www.digitalocean.com/community/tutorials/thread-safety-in-java-singleton-classes 34 | 31. Kotlin Flow vs Android Live Data ( Read the accepted answer ): https://stackoverflow.com/questions/58773453/kotlin-flow-vs-android-livedata 35 | 32. Context providers ( If possible make two apps that communicate each other ): https://www.geeksforgeeks.org/content-providers-in-android-with-example/ 36 | 33. Android threading, all you need to know: https://www.toptal.com/android/android-threading-all-you-need-to-know 37 | 34. Broadcast receiver: https://www.geeksforgeeks.org/broadcast-receiver-in-android-with-example/ 38 | 35. Types of services: https://www.geeksforgeeks.org/services-in-android-with-example/ 39 | 36. Obfucation in Android: https://stackoverflow.com/questions/17290023/obfuscation-in-android-studio 40 | 37. Types of intents: https://stackoverflow.com/questions/26038839/knowing-about-sticky-intent-in-android 41 | 38. How to insert image in room persistence library: https://stackoverflow.com/questions/46337519/how-insert-image-in-room-persistence-library 42 | 39. Type converter in Room: https://clintpaul.medium.com/what-is-typeconverter-in-room-how-to-use-it-properly-e7b4847012b4 43 | 40. Difference between activity task and stack: https://stackoverflow.com/questions/4677729/task-and-activity-stack-what-is-difference-between-both 44 | 41. Memory leaks in Android ( Very important. Don't miss ): https://dropbox.tech/mobile/detecting-memory-leaks-in-android-applications#:~:text=Memory%20leaks%20occur%20when%20an,app%20performance%20and%20even%20crashes., https://www.geeksforgeeks.org/memory-leaks-in-android/, https://proandroiddev.com/everything-you-need-to-know-about-memory-leaks-in-android-d7a59faaf46a 45 | 42. Work manager: https://medium.com/androiddevelopers/introducing-workmanager-2083bcfc4712 46 | 43. How View model retains data: https://developer.android.com/topic/libraries/architecture/viewmodel/viewmodel-savedstate 47 | 44. Property initialization using "by lazy" vs "lateinit": https://stackoverflow.com/questions/36623177/property-initialization-using-by-lazy-vs-lateinit 48 | 45. Difference between "const" and "val": https://stackoverflow.com/questions/37595936/what-is-the-difference-between-const-and-val 49 | 46. When to use let, run, apply, also, and with: https://stackoverflow.com/questions/45977011/example-of-when-should-we-use-run-let-apply-also-and-with-on-kotlin 50 | 47. Working with Kotlin sealed classes ( Here, you can understand why sealed classes are better than enums ): https://blog.mindorks.com/learn-kotlin-sealed-classes/ 51 | 48. S.O.L.I.D principles, explanation and usage in Android: https://medium.com/android-news/android-development-the-solid-principles-3b5779b105d2 52 | 49. Data transfer from one destination to another: Not linking any articles. Answer can vary according to your usecases. You can use bundles, interface communication, Shared view model, seralizable and parcelable, event bus, etc for this purpose. Understanding different mechanisms are important here. 53 | 50. Difference between serializable and parcelabled: https://stackoverflow.com/questions/3323074/android-difference-between-parcelable-and-serializable 54 | 51. Higher order functions and lamdas in Kotlin: https://amitshekhar.me/blog/higher-order-functions-and-lambdas-in-kotlin 55 | 52. A safer way to collect flows from Android UIs: https://medium.com/androiddevelopers/a-safer-way-to-collect-flows-from-android-uis-23080b1f8bda 56 | 53. How to combine coroutines with sealed classes: https://mobikul.com/coroutines-with-sealed-class/ 57 | 54. Difference between shared flow and state flow: https://stackoverflow.com/questions/66162586/the-main-difference-between-sharedflow-and-stateflow 58 | 55. Understanding migrations with room: https://medium.com/androiddevelopers/understanding-migrations-with-room-f01e04b07929 59 | 56. Basics of Deep linking: https://www.geeksforgeeks.org/deep-linking-in-android-with-example/ 60 | 57. How to setup dynamic base URL in Retrofit: https://stackoverflow.com/questions/36498131/set-dynamic-base-url-using-retrofit-2-0-and-dagger-2 61 | 58. Coroutine scope vs context: https://www.baeldung.com/kotlin/coroutines-scope-vs-context 62 | 59. Global scope vs coroutine scope vs lifecycle scope: https://stackoverflow.com/questions/65008486/globalscope-vs-coroutinescope-vs-lifecyclescope 63 | 60. Difference b/w object and companion object in a class: https://stackoverflow.com/questions/43814616/kotlin-difference-between-object-and-companion-object-in-a-class 64 | 61. How to implement non-transitive dependencies: https://blog.blundellapps.co.uk/speed-up-your-build-non-transitive-r-files/ 65 | 62. Basics of Coroutines ( Coroutine scope, Job, coroutine context, job lifecycle, parent coroutine context explained ): https://medium.com/androiddevelopers/coroutines-first-things-first-e6187bf3bb21 66 | 63. Cancellation in Coroutines: https://medium.com/androiddevelopers/cancellation-in-coroutines-aa6b90163629 67 | 64. Exceptions in Coroutines: https://medium.com/androiddevelopers/exceptions-in-coroutines-ce8da1ec060c 68 | 65. Understanding unit tests: https://proandroiddev.com/understanding-unit-tests-for-android-in-2021-71984f370240 69 | 66. Example of explicit delegation in Kotlin: https://sachankapil.medium.com/the-art-of-delegation-image-loading-in-android-89254ed52911 70 | 67. App modularization basics: https://proandroiddev.com/intro-to-app-modularization-42411e4c421e 71 | 68. Android dynamic feature modules: https://medium.com/mindorks/dynamic-feature-modules-the-future-4bee124c0f1 72 | 69. Things to note when building an SDK/library: https://crushingcode.nisrulz.com/posts/things-i-wish-i-knew-when-i-started-building-android-sdk-libraries/ 73 | 70. Builder pattern example: https://www.baeldung.com/kotlin/builder-pattern 74 | 71. Abstract factory pattern example: https://www.baeldung.com/kotlin/abstract-factory-pattern 75 | 72. Clean architecture on Android: https://www.toptal.com/android/benefits-of-clean-architecture-android 76 | 73. Kotlin Coroutines vs RxKotlin: https://stackoverflow.com/questions/42066066/how-kotlin-coroutines-are-better-than-rxkotlin 77 | 74. Android Studio Profiler: https://medium.com/@umairkhalid786/the-easiest-way-to-detect-and-fix-memory-leaks-using-android-studio-profiler-tool-and-weakreference-cd7c212908a1 78 | 75. How to fetch OTP automatically: https://stackoverflow.com/questions/30862162/otp-token-should-be-automatically-read-from-the-message 79 | 76. Mapping of data objects in Kotlin: https://www.baeldung.com/kotlin/data-objects 80 | 77. Difference between init block and constructor in Kotlin: https://stackoverflow.com/questions/55356837/what-is-the-difference-between-init-block-and-constructor-in-kotlin 81 | 78. Why do we set content view in onCreate() and not in onStart() or onResume(): https://stackoverflow.com/questions/33973399/why-do-we-set-content-view-in-oncreate-and-not-in-onstart-or-onresume 82 | 79. How to exit an Android app programatically: https://stackoverflow.com/questions/17719634/how-to-exit-an-android-app-programmatically 83 | 80. Types of file storage in Android: https://commonsware.com/Jetpack/pages/chap-files-001.html 84 | 81. Synchronization, thread safety, and locking techniques in Java and Kotlin: https://proandroiddev.com/synchronization-and-thread-safety-techniques-in-java-and-kotlin-f63506370e6d 85 | 82. Understanding reflection using Kotlin: https://levelup.gitconnected.com/understanding-reflection-using-kotlin-a5874bf6301 86 | 83. How recyclerview works internally: https://medium.com/1mgofficial/how-recyclerview-works-internally-71290de5d2c4 87 | 84. 9-patch images: https://medium.com/flobiz-blog/create-resizable-bitmaps-9-patch-files-48c774db4526 88 | 85. Understanding onTrimMemory(): https://stackoverflow.com/questions/19398827/understanding-ontrimmemory-int-level 89 | 86. Difference between View.GONE() and View.VISIBLE: https://stackoverflow.com/questions/11556607/android-difference-between-view-gone-and-view-invisible 90 | 87. Difference between onTouch() and onClick(): https://stackoverflow.com/questions/9122679/difference-between-ontouch-and-onclick-android 91 | 88. Notification channels: https://medium.com/exploring-android/exploring-android-o-notification-channels-94cd274f604c 92 | 89. Why is it useful to have null values or null keys in hashmap: https://stackoverflow.com/questions/3622007/why-is-it-useful-to-have-null-values-or-null-keys-in-hash-maps 93 | 90. Why do we set contentView() in onCreate() and not in onResume() or onStart(): https://stackoverflow.com/questions/33973399/why-do-we-set-content-view-in-oncreate-and-not-in-onstart-or-onresume 94 | 91. Difference between view and view group: https://stackoverflow.com/questions/27352476/difference-between-view-and-viewgroup-in-android 95 | 92. How view model survives configuration changes: https://arkadiuszchmura.com/posts/how-viewmodels-survive-configuration-changes/ 96 | 93. Scoped storage: https://medium.com/microsoft-mobile-engineering/scoped-storage-in-android-10-android-11-28d58d989f3c 97 | 94. Understanding and using services in Android: https://medium.com/@Codeible/understanding-and-using-services-in-android-background-foreground-services-8130f6bbf2a5 98 | 95. Broadcast receivers explained: https://medium.com/android-news/broadcast-receivers-for-beginners-a9d7aa03fb76 99 | 96. withContext() vs async-await(): https://stackoverflow.com/questions/50230466/kotlin-withcontext-vs-async-await 100 | 97. Run two coroutines parallel inside another coroutine: https://stackoverflow.com/questions/57457079/run-two-kotlin-coroutines-inside-coroutine-in-parallel 101 | 98. How to check if a lateinit variable has been initialised: https://stackoverflow.com/questions/37618738/how-to-check-if-a-lateinit-variable-has-been-initialized 102 | 99. What is android:exported property in the manifest file: https://stackoverflow.com/questions/49471423/android-manifests-androidexported-false-prevents-app-from-running-on-device 103 | 100. What are shared view models: https://blog.mindorks.com/shared-viewmodel-in-android-shared-between-fragments/ 104 | 101. Difference between 'is' and 'as' in Kotlin: https://stackoverflow.com/questions/47067302/what-is-difference-between-as-and-is-operator-in-kotlin 105 | 102. Kotlin objects and singleton pattern: https://adventures92.medium.com/kotlin-objects-and-the-singleton-pattern-exploring-the-benefits-of-this-powerful-design-pattern-2acace56957f 106 | --------------------------------------------------------------------------------