Skip to content
tezvyn:
Menu

📱Mobile Dev

Mobile app development across platforms

1327 bites

Test yourself: Top 30 Mobile Dev interview questions →Multiple choice, with the correct answer and why it is correct on every question. Free, no sign-in.

Everything in Mobile Dev, page 28

How would you access a Hilt dependency in a non-injectable ContentProvider?
intermediate2 min read

How would you access a Hilt dependency in a non-injectable ContentProvider?

Tests Hilt's escape hatch for framework classes. Strong answer: define an EntryPoint in SingletonComponent, expose the dependency, and retrieve it with EntryPointAccessors.fromApplication. Red flag: field injection or manual static singletons.

How do you inject two different OkHttpClient instances with Hilt?
intermediate2 min read

How do you inject two different OkHttpClient instances with Hilt?

Tests Hilt qualifiers for same-type bindings. Answer: define a custom @Qualifier (or @Named), annotate two @Provides methods and the injection site. Red flag: manual client creation or subclassing OkHttpClient instead of qualifying the binding.

Explain Hilt scoping: @Singleton vs @ActivityRetainedScoped
intermediate1 min read

Explain Hilt scoping: @Singleton vs @ActivityRetainedScoped

Tests Hilt component lifecycles. Answer: @Singleton lives for the app process; @ActivityRetainedScoped survives config changes via ActivityRetainedComponent but dies when the activity finishes.

How do you inject UserRepository into a ViewModel with Hilt?
easy2 min read

How do you inject UserRepository into a ViewModel with Hilt?

Tests Hilt constructor injection for classes you own. Annotate UserRepository's constructor with @Inject so Hilt auto-provides it to consumers like a @HiltViewModel. Red flag: using a @Provides module for a class you control.

What is Dependency Injection and Hilt's benefit over manual instantiation?
easy2 min read

What is Dependency Injection and Hilt's benefit over manual instantiation?

Tests your grasp of inversion of control and why frameworks matter. A good answer defines DI as supplying dependencies from outside, states Hilt automates object graph creation and scoping, and notes manual instantiation scatters construction logic.

advanced2 min read

Configure OkHttp Cache for Retrofit and force network requests

This tests HTTP caching semantics in mobile networking. A strong answer covers Cache setup with a 50 MiB directory, server Cache-Control driving expiration, and CacheControl.FORCE_NETWORK to bypass.

advanced2 min read

Parse polymorphic media JSON with Kotlin sealed classes and custom serializers

Sealed Media with Image and Video; use Moshi Factory or kotlinx.serialization keyed on the type field.

How do you upload a file with text data in Retrofit?
intermediate2 min read

How do you upload a file with text data in Retrofit?

Tests multipart uploads versus JSON bodies. Strong answer: @Multipart, @POST, @Part; file as MultipartBody.Part and text as RequestBody; avoid @Field. Red flag: suggesting @Body with a data class.

How do you differentiate network and server errors in suspend functions?
intermediate2 min read

How do you differentiate network and server errors in suspend functions?

Catch IOException for connectivity and HttpException for HTTP errors; wrap in a sealed Result.

easy2 min read

How do you configure Moshi or Kotlinx.serialization for JSON key mismatches?

This tests library-specific field-mapping annotations. For Kotlinx.serialization use @SerialName with the JSON key; for Moshi use @Json with the name parameter. A red flag is confusing the two or using manual mapping instead of the built-in decorator.

How would you implement a robust offline-first repository?
advanced2 min read

How would you implement a robust offline-first repository?

Tests single-source-of-truth discipline and network-local sync. Outline a Room repository with Flow, background refresh, disk persistence, immediate local emission, and conflict resolution with retry.

Room DAO: Flow<List<User>> vs suspend fun getUsers(): List<User>
advanced2 min read

Room DAO: Flow<List<User>> vs suspend fun getUsers(): List<User>

This tests reactivity versus one-shot queries in Room and coroutines. Flow emits on every table change on Room's dispatcher, while suspend returns a single snapshot requiring manual refresh.

Preferences vs Proto DataStore: when is Proto significantly better?
intermediate2 min read

Preferences vs Proto DataStore: when is Proto significantly better?

This tests type safety and schema trade-offs. A strong answer contrasts Preferences key-value pairs with Proto typed protobuf schemas, then names nested settings or migration needs as the Proto win. A red flag is recommending Proto for a single boolean.

Model a Room one-to-many Playlist-to-Song relationship
intermediate2 min read

Model a Room one-to-many Playlist-to-Song relationship

Tests Room relational modeling. Strong answer: Song foreign key, @Embedded Playlist with @Relation to List<Song>, DAO wrapped in @Transaction. Red flag: embedding songs in Playlist or skipping @Transaction, which causes N+1 queries.

How do you add a non-null column with a default in Room?
intermediate2 min read

How do you add a non-null column with a default in Room?

Bump version; run ALTER TABLE ADD COLUMN with NOT NULL DEFAULT in a Migration; register via addMigrations.

How do you define a Room table for a Kotlin data class?
easy2 min read

How do you define a Room table for a Kotlin data class?

Tests your grasp of the minimum Room entity contract. A strong answer cites Entity and PrimaryKey, notes Kotlin defaults work out of the box, and mentions ColumnInfo for renaming.

Why choose DataStore over SharedPreferences for a toggle?
easy2 min read

Why choose DataStore over SharedPreferences for a toggle?

This tests your grasp of modern Android storage safety beyond syntax. A strong answer names DataStore's async coroutines API, type safety, transactions, and migration support. A red flag is claiming SharedPreferences is simpler while ignoring ANR risk.

What are Room's three main components and their functions?
easy2 min read

What are Room's three main components and their functions?

Tests whether you know Room's architectural layers. Name the three: Database holds config and is the access point; Entity represents a table schema; DAO defines SQL operations. Red flag: confusing DAOs with Repositories or claiming Room is a full ORM.

How would you architect state-driven UI with ViewModel and Compose?
advanced2 min read

How would you architect state-driven UI with ViewModel and Compose?

Tests unidirectional data flow and state hoisting. Model screen state as an immutable data class, expose StateFlow from ViewModel, and collect it in Compose so events flow up and state down. Red flag: exposing mutable state or putting logic in Composables.

How do you navigate between feature modules without direct dependencies?
advanced2 min read

How do you navigate between feature modules without direct dependencies?

This tests architectural decoupling in multi-module Android apps. A great answer describes a shared navigation contract or deep-link router that lets features stay independent. Recommending direct Gradle dependencies between features is a major red flag.

We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.

See open roles