• Stars
    star
    127
  • Rank 281,745 (Top 6 %)
  • Language
  • Created over 2 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

📚 Questions for Android Engineer Interview 📚

Android Engineer Interview Questions

Android Kotlin

If this Repository helps you, Show your ❤️ by buying me a ☕ below.

Buy Me A Coffee

Need a Mentor? Click Here

Contents

Kotlin

  • What is the difference between const val and val?
    • Both are used to define read-only properties, but
    • const val properties should be initialized at compile-time whereas val properties can be initialized at runtime
    • If we decompile, const val variable will replace with its value but val not, because it can be initialized at runtime
    • const val BASE_URL = "https://github.com"
      val githubHandle = "anandwana001"
      val repoName: String
      
  • What is so interesting about data class?
    • Uses to hold data
    • Pre-functions like toString, equals, copy, and componentN
    • Data classes cannot be abstract, open, sealed, or inner.
    • Data classes cannot extend other classes
    • Supports destructuring declaration
  • Is singleton thread-safe? vs Object?
  • What are the different types of scope functions?
    • Let = T.let { R }
      • lambda result (R) is the return type
      • can be performed on any T type object
      • lambda reference is it
      • suitable for null check
    • Run = T.run { R }
      • same as let, but mostly used in initializing an object
      • lambda reference is this
      • suitable for null check
    • With = with(T) { R }
      • if T is nullable object use run else use with(T)
      • lambda reference is this
      • not suitable for null check
    • Also = T.also { T }
      • when need to perform multiple operations in chain use also
      • lambda reference is it
    • Apply = T.apply { T }
      • when need to perform the operation on the T object and return the same use apply
      • lambda reference is this
      • suitable for null check
  • What are the different Coroutine Scopes?
  • How to manage series and parallel execution?
  • Difference between Flow/SharedFlow/StateFlow and elaborate it.
  • What happens if we call .cancel() from a coroutine scope?
  • What is an Init block in Kotlin?
  • How to choose between apply and with?
  • What is inline function in Kotlin?
  • Difference between Coroutine and Java Thread
  • Why Coroutines are light weight?
  • How does Coroutine switch context?

Android

  • How does Garbage collection works?
  • What is a dangling pointer?
  • Elaborate Memory Leak?
  • Explain fragment Lifecycle when it comes to ViewPager and sliding between different fragments.
  • Difference between FragmentStateAdapter and FragmentStatePagerAdapter.
  • Difference between Serializable and Parcelable? What are the disadvantages of Serializable?
  • How you could implement observable SharedPrefs or observable Databases i.e. Observe a certain key/table/query?
  • How does layout inflation work from xml tags to view reference in memory?
  • 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 ViewModel instance provided to Activity and Fragment. How does ViewModelProviderStore decide when to retain the instance?
  • How do you inspect and solve Jank issue? here
  • How does the OutOfMemory happens?
  • How do you find memory leaks in Android applications?
  • What is Doze? What about App Standby?
  • What does setContentView do?
  • Process of creating a custom view
  • Deeplink understanding and architecture
  • Notifications

Lifecycle

  • How to keep a video maintain playing state when we rotate screen?
  • How many callbacks in Fragmnets?
  • What could be the reasons when onPause didn't get triggered?
  • What kind of events trigger onPause() to run?
  • In what scenario does the "onDestory" get called directly after "onCreate"?
  • Which callback gets called on Activity when an AlertDialog is shown?
  • What's the lifecycle in PIP (Picture-in-Picture)?
  • What happens if you rotate the device?
  • Inside a viewpager (Fragment state pager adapter) what will be the lifecycle of the fragments when you swap from tab to another ?
  • Why onActivityCreated is now depreciated in Fragment?
  • Which callback should i use if i want to know when my activity came to foreground?
  • When is onActivityResult called?
  • What does setRetainInstance do and how you can avoid it?
  • What callbacks trigger when a Dialog opens up? Conside both case, dialog attached from same activity/fragment and other activity/fragment.
  • What does launchWhenCreated, launchWhenStarted, and launchWhenResumed functions do?

Networking

  • What is the role of OkHttp and Retrofit?
  • What design pattern does Retrofit use?
  • How would optimise handling of access token expiration? How would you handle retry network call when the api fails? (Custom Interceptor response)

Webview

  • What are the problems around security when dealing with WebView.
  • How to interact or make connections with JavaScript?

Dependency Injection

  • Provides vs binds
  • Subcomponent vs component dependency, what is the difference under the hood
  • What is subcomponent and what is the use? How do you use qualifiers or how would you provide different instances of a class with the same data type? Constructor Injection V/s Method Injection? What is the scope? Singleton Annotation?
  • What is Circular dependency in dagger?, and how to resolve it
  • What's interesting about Hilt?
  • Did you use Koin? What are your thoughts on it?

Jetpack Compose

  • How to launch coroutine from a composable function? - LaunchedEffect
  • How to launch coroutine from a non-composable function, but tied to composition? - rememberCoroutineScope()
  • What is recomposition? Recomposition
  • What is remember in compose?
    • A composable function to remember the value produced by a calculation only at the time of composition. It will not calculate again in recomposition.
    • Recomposition will always return the value produced by composition.
    • Whole Compose is based on concept of Positional Memoization
    • At the time of recomosition, remember internally calls a function called rememberedValue() whose work is to look into the slotTable and compare if the previous value and the new value has any difference, if not return, else update value
  • Why and when to use remember {}?
  • Difference between LazyColumn and RecyclerView?
  • What is AndroidView in compose?
  • What is the lifecycle of composeables? Lifecycle
  • How to avoid recomposition of any composable, if the state is not changed? Smart Recomposition
  • What are stable types which can skip recomposition?
  • What is State?
  • What is MutableState and how does recomposition happens?
  • How to retain State accross recomposition and configuration changes?
  • Difference between Stateless and Statefull composeables?
  • What are your thoughts on flat heirarchy, constraint Layout in compose vs the older view heirarchy in xml
  • Difference b/w remember and LaunchedEffect
  • Does re-composition of ComposeItem1 bring any affect on ComposeItem2? If yes, then how?
    • ComposeParent() { ComposeItem1 {} ComposeItem2() {...} }
    • What is CompositionLocal?
  • Custom views in compose
  • Canvas in Compose

Thread

  • Different type of threads?
  • Difference between different type of thread?
  • Thread <-> Handler <-> looper
  • UI vs Background Thread

Architecture

  • What is SOLID principles?
  • What is MVVM?
  • Brief about Android Architecture.

System Design

  • Design Image Loading Library
  • Design Image Downloading Library
  • Design LRU Cache
  • Design a real-time Twitter feed timeline. How will you structure the backend? Will you use WebSocket or REST for this use case? Justify.
  • Design Networking Library
  • Design Checkout Screen
  • Design Error handling Structure
  • REST <-> Web Sockets
  • Implement caching mechanism

Libraries

  • How Glide internally works?
  • Hoe does retrofit workss internally?
  • ViewModel internal working

Common Question

  • String vs StringBuilder
  • == vs .equals?
  • === vs ==?
  • Java OOP concepts

Questions from Company

Company Questions
Booking.com
  • Implement findViewById method
  • Given a list of words as input, output another list of strings, each containing words that are mutual anagrams
  • Identify whether four sides (given by four integers) can form a square, a rectangle or neither
  • Output a delta encoding for the sequence. In a delta encoding, the first element is reproduced as-is. Each subsequent element is represented as the numeric difference from the element before it
  • Three integer arrays are given with duplicate numbers. Find the common elements among three arrays
  • Twisted question related to ConcurrentModificationException in an ArrayList
  • How do you implement a hotel list and detail screen. Discuss what all APIs You will create how the layout will be
  • Fragments & their lifecycle, Activity lifecycle, Views, Layouts
  • Background task in Android - Asynctask, service, intent services etc
  • Given dates and number of check-in and check-out on those dates. Find the busiest day of the hotel. [Merge Array interval type question]
  • given an array, determine if there are repeated elements. If an element is repeated more than 3 times, return those elements. This question is basically doing a hash and checking if the hash already exists. Someone used a Map and a Set.
  • Given an list of positive words, negative words and a review, determine if the review is flagged as positive, negative or neutral. Someone solved it using a Set. Someone just needed to do some count (+ or -) regarding on where the word appeard (positive list or negative).
Spotify
  • Design components and overall architecture for a Search feature in an Android application. [Spotify - Android Engineer II - London, UK - Sep 2022]
  • Design a Disk based Cache for client. [Spotify System Design Android/iOS Client] Platform independent, Key will be 32 bytes, Value can be anything but in Byte array, Cache should be persistent, Cache should max hold 100k+ Objects, Cache Max size should be configurable ( Max Size : 10 MB upto 1GB), Cache should be opaque, Cache should be Secure
  • Linked List Cycle
  • Palindrome Linked List
PhonePe
  • Minimum Meetroom scheduling
  • Anagram Strings based question
Paytm
  • To check if strings are rotations of each other or not. And if they are in rotation print the no. of rotations.
  • Find the string is panagram or not
  • Design components and overall architecture for a Search feature in an Android application
  • Sort an array of 0s, 1s and 2s
  • Abstract vs Interface
  • Android Memory related
Meesho
  • SOLID principles
  • Dagger, why use dependency injection, what if we do not think it is important, like alternatives. How to create our own dependency injection library.
  • why use MVVM over MVP, think outside the box, we could have used observables using RxJava etc. - open ended questions around it
  • Multi Module benefits and why use it
  • How to handle dependencies or abstraction in multi module
  • val vs const
  • inline keyword
  • lateinit vs lazy

Contributing Guidelines

What interesting questions you had faced while giving interview for Android Engineer role (any level)? Let's open a PR.

If this repository helps you in anyway, show your love ❤️ by putting a ⭐ on this project ✌️

More Repositories

1

applied_cs_with_android_beginner_workshop

Build Android games 🎲 Learn computer science 💻 Applied CS is a free online course by Google 🚀
Java
34
star
2

RoomAccounting

📦 Room Database based application for accounting 📦
Kotlin
28
star
3

mindorks-cct

A sample application demoing chrome custom tabs in kotlin in androidx 🎨
Kotlin
27
star
4

ogTagParser

📲 Kotlin library to parse open graph tags
Kotlin
20
star
5

AppliedCSwithAndroid_Gits

Java
19
star
6

sampleflexbox

A sample application demoing flexbox layout library with kotlin 🧗🏻‍♂️
Kotlin
13
star
7

catchflicks

🎬 Kitchen sink project for learning android concepts 🎬
Kotlin
12
star
8

exoplayer-example

Kotlin
10
star
9

Tech-Jalsa

Tech Jalsa is an Android app to show details about tech fest of Techno India NJR. Contribute in this idea to bring all college events on a single platform!
Java
7
star
10

begin-with-android

Projects for complete beginner session who wants to learn Android App Development
Kotlin
6
star
11

anandwana001.github.io

Personal Website ✨📋✨
HTML
6
star
12

Android-Udacity-Project-in-Kotlin

This repository contains the Android Basic Developer Nanodegree projects in kotlin
Kotlin
6
star
13

WeatherAppsX

☀️ 🌤 Sample weather app with Retrofit, Hilt and Coroutines ☀️ 🌤
Kotlin
6
star
14

sample-protobuf-android

Kotlin
5
star
15

Compose-Closet

Learning Compose
Kotlin
4
star
16

android-kotlin-examples

Android Examples in Kotlin with AndroidX Libraries
Kotlin
3
star
17

ChicsConnect

ChicsConnect Android App will help girls find other girls and be friends with them wherever they are 👧 👜
3
star
18

Capstone-Project

This repo is the capstone project of android developer nanodegree.
Java
2
star
19

Movie-Manic

Movie Manic is an Android Nanodegree Project part where user can get list of new movies. Contribute in this project by including libraries to make work efficient!
Java
2
star
20

Wholesaler-Retailer

This repository is for learning purpose. Modify template according to wholesaler and retailer who can display their items on a webpage using firebase real time database.
Python
2
star
21

android_beginner_with_java

Java
1
star
22

leetcode_problems

Java
1
star
23

BakingTime

AND Project
Java
1
star
24

RoomMvvm

An Android app showing list of data from local database and having add, update and delete option. App developed using MVVM architecture and libraries like RxJava, Dagger, Architecture Components and Room of Database.
Kotlin
1
star