Free practice questions

Technical
Interview questions

Prepare for technical interviews with questions by technology, clear explanations, step-by-step solutions and code you can run.

Mobile App Development questions
50 questions
25
25 concept questions
25
25 coding questions

Mobile App Development technical questions

Android (Kotlin, Jetpack Compose, Room), iOS (Swift, SwiftUI, SwiftData), App Architecture & Production Snippets
Total 50 Questions
Part A: Core concept & theory questions
Questions 01 to 25 • Theoretical Foundations
25 Concept Questions

Native means I build the app separately for each phone: Kotlin for Android, Swift for iOS. It runs best and gets new features first. Cross-platform tools like Flutter or React Native let me write one codebase for both. Hybrid apps are basically a website inside an app shell, so they usually feel the slowest.

Android uses Kotlin (or Java) in Android Studio. iOS uses Swift (or Objective-C) in Xcode, and Xcode only runs on a Mac, which is something people forget until they need it.

The main steps are onCreate, onStart, onResume, onPause, onStop and onDestroy. The screen is visible after onStart and I can actually tap it after onResume. One thing that surprises beginners is that rotating the phone destroys and recreates the activity.

An activity is one screen the system can open. A fragment is a reusable chunk of UI that lives inside an activity and has its own lifecycle. These days many apps use a single activity and switch screens with the Navigation library.

An explicit intent names the exact screen to open, like my own DetailActivity. An implicit intent just says what I want done, like "open this link," and Android finds an app that can do it.

A service does work without showing a screen. For background jobs that must finish even if the app closes, like syncing data, I use WorkManager. It also lets me add conditions like "only on Wi-Fi" and retries if it fails.

It holds the screen's data and survives things like rotation. That keeps logic out of the UI code, so the screen only shows whatever the ViewModel gives it.

With XML, I design the screen in a separate file and then update it from code. With Compose, I write the UI as Kotlin functions and it redraws on its own when the state changes. I write much less boilerplate with Compose.

They let me write async code, like a network call, in a normal top-to-bottom way without freezing the screen. Inside a ViewModel, I start them with viewModelScope.

It sits on top of SQLite so I don't write messy database code. I define a table class (entity), the queries (DAO) and a database class. It checks my SQL while compiling, and it can return a Flow so the screen updates when data changes.

I declare the permission in the manifest, and for sensitive things like camera or location I also ask the user while the app is running. They can say no, so the app should still behave nicely or explain why it needs it.

A leak happens when something long-lived holds on to something short-lived, like a static variable holding an Activity, so it never gets freed. An ANR ("Application Not Responding") is when the main thread is blocked for several seconds, usually because I did heavy work on it.

An APK is the file you install. An AAB (Android App Bundle) is what I upload to Google Play, and Play builds a smaller APK for each device from it.

A struct is a value type, so passing it around makes a copy. A class is a reference type, so everyone shares the same object. SwiftUI views and most simple models are structs. I use a class when I need shared state or inheritance.

A type that can hold a value or nil, like String?. Swift forces me to deal with the empty case using if let, guard let or ??, so a lot of crashes never happen.

Automatic Reference Counting frees an object when nothing strongly points to it. A retain cycle is when two objects point at each other, so neither is ever freed. I break it with weak, often writing [weak self] inside closures.

UIKit is the older way, where I build and update views step by step. SwiftUI is declarative: I describe what the screen should look like for the current state, and it keeps itself updated. New apps usually start with SwiftUI.

Not running, inactive, active, background and suspended. In SwiftUI I can watch for changes with scenePhase.

@State is simple data a view owns. @Binding lets a child view read and change the parent's data. @StateObject creates and keeps alive an observable object, like a ViewModel, for as long as the view exists.

A protocol is a list of things a type promises to do. With the delegate pattern, one object hands a job or an event to another through a protocol. I mark the delegate weak so I don't create a retain cycle.

Modern Swift uses async/await and actors. Older code uses GCD (DispatchQueue). UI updates have to be on the main thread, and @MainActor makes sure of that.

UserDefaults for small settings, the Keychain for secrets like tokens, files for documents, and Core Data or SwiftData for structured data. Passwords never go in UserDefaults.

I need an Apple Developer account, then Xcode can manage certificates and profiles for me. I archive the app, upload it to App Store Connect, test it with TestFlight and then submit it for review.

The app registers with the platform's push service, APNs on iOS and Firebase Cloud Messaging on Android, and gets a device token. My server sends the message to that service using the token, and the service delivers it to the phone.

For speed: lazy lists, small images, no heavy work on the main thread. For security: HTTPS, secure storage for tokens, no secrets in the code. For offline use: save data locally and sync again when the internet comes back.

Part B: Coding questions & algorithm solutions
Questions 01 to 25 • Runnable Solution Scripts
25 Coding Questions

Manage button click state with remember and mutableStateOf in Jetpack Compose.

Mobile App Development Solution
@Composable
fun Counter() {
    var count by remember { mutableStateOf(0) }

    Button(onClick = { count++ }) {
        Text("Clicked $count times")
    }
}

Render performant scrolling collection using LazyColumn and items.

Mobile App Development Solution
@Composable
fun NameList(names: List<String>) {
    LazyColumn {
        items(names) { name ->
            Text(name, modifier = Modifier.padding(12.dp))
        }
    }
}

Validate email against Patterns.EMAIL_ADDRESS and display error state.

Mobile App Development Solution
@Composable
fun LoginForm() {
    var email by remember { mutableStateOf("") }
    var error by remember { mutableStateOf<String?>(null) }

    Column(Modifier.padding(16.dp)) {
        OutlinedTextField(
            value = email,
            onValueChange = { email = it },
            label = { Text("Email") },
            isError = error != null
        )
        error?.let { Text(it, color = MaterialTheme.colorScheme.error) }

        Button(onClick = {
            error = if (Patterns.EMAIL_ADDRESS.matcher(email).matches()) null
                    else "Enter a valid email"
        }) { Text("Login") }
    }
}

Configure NavHost with string route parameters and NavController.

Mobile App Development Solution
@Composable
fun AppNav() {
    val nav = rememberNavController()

    NavHost(navController = nav, startDestination = "home") {
        composable("home") {
            Button(onClick = { nav.navigate("details/42") }) { Text("Open item") }
        }
        composable("details/{id}") { entry ->
            Text("Item ${entry.arguments?.getString("id")}")
        }
    }
}

Expose state via StateFlow and observe with collectAsState.

Mobile App Development Solution
class CounterViewModel : ViewModel() {
    private val _count = MutableStateFlow(0)
    val count: StateFlow<Int> = _count.asStateFlow()

    fun increment() { _count.value++ }
}

@Composable
fun CounterScreen(vm: CounterViewModel = viewModel()) {
    val count by vm.count.collectAsState()
    Button(onClick = { vm.increment() }) { Text("Count: $count") }
}

Define suspension functions in Retrofit interface using Gson converter.

Mobile App Development Solution
data class Post(val id: Int, val title: String, val body: String)

interface ApiService {
    @GET("posts")
    suspend fun getPosts(): List<Post>
}

val api: ApiService = Retrofit.Builder()
    .baseUrl("https://jsonplaceholder.typicode.com/")
    .addConverterFactory(GsonConverterFactory.create())
    .build()
    .create(ApiService::class.java)

Launch network request in viewModelScope and publish error StateFlow upon failure.

Mobile App Development Solution
class PostsViewModel : ViewModel() {
    private val _posts = MutableStateFlow<List<Post>>(emptyList())
    val posts = _posts.asStateFlow()

    private val _error = MutableStateFlow<String?>(null)
    val error = _error.asStateFlow()

    init {
        viewModelScope.launch {
            try {
                _posts.value = api.getPosts()
            } catch (e: Exception) {
                _error.value = "Could not load posts"
            }
        }
    }
}

Implement Room persistence using Entity, Dao with Flow, and RoomDatabase.

Mobile App Development Solution
@Entity(tableName = "notes")
data class Note(
    @PrimaryKey(autoGenerate = true) val id: Int = 0,
    val text: String
)

@Dao
interface NoteDao {
    @Insert suspend fun add(note: Note)
    @Delete suspend fun remove(note: Note)

    @Query("SELECT * FROM notes ORDER BY id DESC")
    fun all(): Flow<List<Note>>
}

@Database(entities = [Note::class], version = 1)
abstract class AppDb : RoomDatabase() {
    abstract fun noteDao(): NoteDao
}

Use Intent with putExtra and retrieve with getStringExtra.

Mobile App Development Solution
// In first activity
val intent = Intent(this, DetailActivity::class.java).putExtra("name", "Asha")
startActivity(intent)

// In DetailActivity
val name = intent.getStringExtra("name")

Use Intent.ACTION_VIEW for URLs and Intent.ACTION_SEND for text sharing.

Mobile App Development Solution
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("https://example.com")))

val share = Intent(Intent.ACTION_SEND).apply {
    type = "text/plain"
    putExtra(Intent.EXTRA_TEXT, "Check out this app!")
}
startActivity(Intent.createChooser(share, "Share via"))

Use rememberLauncherForActivityResult with ActivityResultContracts.RequestPermission.

Mobile App Development Solution
@Composable
fun CameraPermissionButton() {
    var message by remember { mutableStateOf("") }

    val launcher = rememberLauncherForActivityResult(
        ActivityResultContracts.RequestPermission()
    ) { granted ->
        message = if (granted) "Permission granted" else "Permission denied"
    }

    Column {
        Button(onClick = { launcher.launch(Manifest.permission.CAMERA) }) {
            Text("Allow camera")
        }
        Text(message)
    }
}

Persist preference key-values using Jetpack Preferences DataStore Flow.

Mobile App Development Solution
val Context.dataStore by preferencesDataStore(name = "settings")
val DARK_MODE = booleanPreferencesKey("dark_mode")

suspend fun saveDarkMode(context: Context, value: Boolean) {
    context.dataStore.edit { it[DARK_MODE] = value }
}

fun darkModeFlow(context: Context): Flow<Boolean> =
    context.dataStore.data.map { it[DARK_MODE] ?: false }

Schedule background execution with PeriodicWorkRequestBuilder.

Mobile App Development Solution
class SyncWorker(ctx: Context, params: WorkerParameters) : CoroutineWorker(ctx, params) {
    override suspend fun doWork(): Result {
        // background sync work
        return Result.success()
    }
}

val request = PeriodicWorkRequestBuilder<SyncWorker>(15, TimeUnit.MINUTES).build()
WorkManager.getInstance(context).enqueueUniquePeriodicWork(
    "sync", ExistingPeriodicWorkPolicy.KEEP, request
)

Mutate local state property with @State inside SwiftUI Button action.

Mobile App Development Solution
struct CounterView: View {
    @State private var count = 0

    var body: some View {
        Button("Clicked \(count) times") {
            count += 1
        }
    }
}

Display collection using SwiftUI List with id: \.self.

Mobile App Development Solution
struct NameList: View {
    let names = ["Ravi", "Neha", "Amit"]

    var body: some View {
        List(names, id: \.self) { name in
            Text(name)
        }
    }
}

Bind TextField to state and validate email formatting upon submission.

Mobile App Development Solution
struct LoginView: View {
    @State private var email = ""
    @State private var error = ""

    var body: some View {
        VStack(spacing: 12) {
            TextField("Email", text: $email)
                .textFieldStyle(.roundedBorder)
                .keyboardType(.emailAddress)
                .textInputAutocapitalization(.never)

            Text(error).foregroundColor(.red)

            Button("Login") {
                error = (email.contains("@") && email.contains(".")) ? "" : "Enter a valid email"
            }
        }
        .padding()
    }
}

Use NavigationStack and NavigationLink to transition between screens.

Mobile App Development Solution
struct ItemsView: View {
    let items = ["Phone", "Laptop", "Watch"]

    var body: some View {
        NavigationStack {
            List(items, id: \.self) { item in
                NavigationLink(item) {
                    Text("Details for \(item)")
                }
            }
            .navigationTitle("Items")
        }
    }
}

Publish property changes with @Published and observe with @StateObject.

Mobile App Development Solution
@MainActor
class CounterViewModel: ObservableObject {
    @Published var count = 0
    func increment() { count += 1 }
}

struct CounterScreen: View {
    @StateObject private var vm = CounterViewModel()

    var body: some View {
        Button("Count: \(vm.count)") { vm.increment() }
    }
}

Conform struct to Codable and decode utf8 data with JSONDecoder.

Mobile App Development Solution
struct Post: Codable, Identifiable {
    let id: Int
    let title: String
    let body: String
}

let json = #"{"id":1,"title":"Hello","body":"World"}"#.data(using: .utf8)!
let post = try JSONDecoder().decode(Post.self, from: json)
print(post.title)

Asynchronously fetch data with URLSession.shared.data and bind to state inside .task modifier.

Mobile App Development Solution
func loadPosts() async throws -> [Post] {
    let url = URL(string: "https://jsonplaceholder.typicode.com/posts")!
    let (data, response) = try await URLSession.shared.data(from: url)

    guard let http = response as? HTTPURLResponse, http.statusCode == 200 else {
        throw URLError(.badServerResponse)
    }
    return try JSONDecoder().decode([Post].self, from: data)
}

struct PostsView: View {
    @State private var posts: [Post] = []

    var body: some View {
        List(posts) { Text($0.title) }
            .task { posts = (try? await loadPosts()) ?? [] }
    }
}

Unwrap optionals using guard let early exit, if let conditional binding, and nil-coalescing ??.

Mobile App Development Solution
func greet(_ name: String?) {
    guard let name = name else {
        print("No name given")
        return
    }
    print("Hello, \(name)")
}

let city: String? = nil
print(city ?? "Unknown")

if let c = city {
    print("City is \(c)")
}

Define class-bound protocol and mark delegate property weak to prevent retain cycles.

Mobile App Development Solution
protocol PaymentDelegate: AnyObject {
    func paymentDone(amount: Double)
}

class Checkout {
    weak var delegate: PaymentDelegate?   // weak prevents retain cycle

    func pay(_ amount: Double) {
        delegate?.paymentDone(amount: amount)
    }
}

class Screen: PaymentDelegate {
    func paymentDone(amount: Double) {
        print("Paid \(amount)")
    }
}

Synchronize settings using UserDefaults and @AppStorage property wrapper.

Mobile App Development Solution
UserDefaults.standard.set(true, forKey: "darkMode")
let isDark = UserDefaults.standard.bool(forKey: "darkMode")

struct SettingsView: View {
    @AppStorage("darkMode") private var darkMode = false

    var body: some View {
        Toggle("Dark mode", isOn: $darkMode)
    }
}

Annotate model with @Model and perform CRUD operations with @Query and @Environment(\.modelContext).

Mobile App Development Solution
@Model
class Note {
    var text: String
    init(text: String) { self.text = text }
}

struct NotesView: View {
    @Environment(\.modelContext) private var context
    @Query private var notes: [Note]

    var body: some View {
        VStack {
            List(notes) { Text($0.text) }
            Button("Add note") { context.insert(Note(text: "New note")) }
        }
    }
}

Request UNUserNotificationCenter authorization and schedule time interval notification request.

Mobile App Development Solution
import UserNotifications

UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound]) { granted, _ in
    guard granted else { return }

    let content = UNMutableNotificationContent()
    content.title = "Reminder"
    content.body = "Time to drink water"

    let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 60, repeats: false)
    let request = UNNotificationRequest(identifier: UUID().uuidString,
                                        content: content, trigger: trigger)
    UNUserNotificationCenter.current().add(request)
}

No Matching Questions Found

Try searching for keywords like "JWT", "Express", "useEffect", "PDO", "GIL", or "schema".

Technical Panel Preparation

Ready to Benchmark Your Technical Skills?

Connect with DigitalXNode expert interviewers for technical mock interviews, domain assessment, and enterprise job placement.

1