How in-depth can you answer these as an experienced Android engineer?
Android Framework System is a vastly complex system with a lot of moving parts. As mid-level/senior Android folks we are expected to know some and pick up a lot. This makes Android tech interviews hard at judging the candidate.
“The ability to ask the right questions is more than half the battle of finding the answer”
- Thomas Watson
After being interviewer at Flipkart and interviewing for companies like Uber, Microsoft & Google and some startups, this is a list I worked on for Android folks to have answers to. This is not an exhaustive list on a must know everything basis but just something that would differentiate you as a candidate.
If you claim to know or worked in an area, having an extensive answer to the questions would give you an edge. Alternatively, this can also be used by folks in interviews or to ponder upon and top up their knowledge wells.
- How does layout inflation work from xml tags to view reference in memory? How are attributes read and drawn and how many passes does a view before it’s completely shown on screen?
- How would you go about implementing findViewById? Given 2 view references, how would you go about finding their ancestor view?
- Explain in complete detail on when you tap on a position/coordinate on phone say (140, 250), to the types of listeners fired, their priority on execution and event handling mechanism between child and parent layouts.
- What is a thread, handler, looper and message queue?
- What are the different methods of concurrency on Android? Can you explain the difference between ExecutorService vs CachedThreadPool vs FixedThreadPool vs AsyncTasks vs HandlerThreads?
- How does Garbage Collection work on Android? Explain the terms reference counting, mark and sweep?
- Think and list down all the different ways to communicate between an application component and a service?
- When should you bind to a service, what is a ServiceConnection & how does binding work internally?
- What is the difference between using Messenger and AIDL? What are the advantages of using AIDL for interprocess communication?
- In-memory vs Bundle vs SharedPrefs vs Database? What state do you persist in where?
- List down all the ways that you can think of to reduce the apk size.
- How is ANR, frame drop and frozen frames caused, how are they all different?
- What are the 3 steps of Proguard/R8, how to enable and disable them?
- What is consumer proguard, how is it different from Proguard?
- How do we unobfuscate a stack trace of a Proguard/R8 obfuscated apk?
- What is the difference between commit and apply in SharedPrefs? Which is more performant SharedPrefs vs Databases?
- Describe how you could implement observable SharedPrefs or observable Databases i.e. Observe a certain key/table/query?
- How is sharing data and sharing control between process on Android different? How would you do both?
- What is the difference between Serializable and Parcelable? What are the disadvantages of Serializable?
- What are the different ways to protect api key inside a shipped apk?
- What is a man in the middle attack, how do you secure your apis from it and other attacks?
- What are the steps in Android build process from java/kt files to packaging? Explain in detail what is R.java, resources.arsc, manifest merging & signing etc.
- How is app bundle different from apk? What are build flavours and how are they different from product flavours and splits?
- How would you communicate between an Activity & Activity, Fragment & Fragment and Activity & Fragment?
- What are the different activity launch modes?
- What is the viewholder pattern, how will you implement it on a ListView? Explain the best practice to specify the listeners on the items inside the RecyclerView?
- What are the steps you can think of optimising RecyclerView performance?
- How would you implement a Sticky header in a RecyclerView from scratch.
- How is change in the dataset reflected in the RecyclerView? What is DiffUtil?
- What is Reflection in Java and why is it advised to use minimally?
- What are Generics in Java? In what cases are they useful and how do you restrict them?
- What is a Content Provider in Android and how do you access the content it provides?
- Implement an Android Content Provider on top of a dataset of comma separated files. Is it possible?
- How is data stored on databases on Android? What is an ORM & a Data Access Object? What are some ways to optimise Database read, write and update?
- How thread safe is SQLite? Table-level lock or DB-level lock?
- What is Dependency Injection Pattern? How does it compare to Service Registry Pattern?
- What are Dagger and Koin and how do they internally work?
- What are the problems around security when dealing with webviews.
- What is the different between unit and instrumentation tests? Mockito vs RoboElectric?
- What is CI/CD in context of Android? What are the pipelines and their guard-rails you have encountered in your experience before code merge, testing, release & rollout?