Dev Skill Programme
Skills

Mobile

Frontend for mobile: native iOS (Swift, SwiftUI) and Android (Kotlin, Compose), from app lifecycle to store release.

Owner: Developer D2 guides24 checklist items18 Q&A questions1 sessions

Preparation Q&A

Mobile fundamentals · 4

  1. What are the main states of a mobile app lifecycle, and why do they matter?

    Basic · 1pt
    Expected answer

    Not running, foreground/active, background, suspended/stopped, terminated. The OS can pause or kill the app at any time, so save state and release resources when going to the background, and restore when coming back.

  2. Why must long-running work never run on the main (UI) thread?

    Basic · 1pt
    Expected answer

    The main thread draws the UI and handles touches. Blocking it freezes the app, and the OS may kill it (ANR on Android, watchdog on iOS). Do network, disk and heavy work in the background and update the UI back on the main thread.

  3. How do you handle an unreliable network in a mobile app?

    Intermediate · 2pt
    Expected answer

    Show loading, error and retry states; set timeouts; cache data locally so the app works offline; retry with backoff; queue writes and sync later; and handle a request finishing after the user has left the screen.

  4. How do you release a mobile app safely, given users update slowly?

    Advanced · 3pt
    Expected answer

    Beta testing (TestFlight / internal testing tracks), phased or staged rollout, crash and analytics monitoring, feature flags to switch features off remotely, and keep the backend compatible with old app versions — optionally a forced-update check for critical fixes.

iOS · 7

  1. What is an optional in Swift, and what are safe ways to unwrap it?

    Basic · 1pt
    Expected answer

    A value that may be nil (String?). Unwrap with if let / guard let, optional chaining (a?.b), or ?? for a default. Avoid force unwrapping ! because it crashes on nil.

  2. What is the difference between a struct and a class in Swift?

    Basic · 1pt
    Expected answer

    Structs are value types (copied on assignment, no inheritance); classes are reference types (shared instance, inheritance, deinit). Prefer structs for models; SwiftUI views are structs.

  3. Explain `@State`, `@Binding` and `@Observable` / `@StateObject` in SwiftUI.

    Intermediate · 2pt
    Expected answer

    @State is simple local state owned by a view. @Binding gives a child read-write access to a parent’s state. @Observable (or ObservableObject with @StateObject/@ObservedObject) holds reference-type model state shared across views; the view owning it creates it once.

  4. How do you make a network request with async/await and update the UI safely?

    Intermediate · 2pt
    Expected answer

    Use try await URLSession.shared.data(from:), decode with JSONDecoder into a Codable type, catch errors, and update UI state on the main actor (@MainActor). Start it from .task {} so it is cancelled when the view disappears.

  5. What is a retain cycle and how do you avoid one with closures?

    Intermediate · 2pt
    Expected answer

    Two objects hold strong references to each other, so neither is freed (memory leak). Common with closures capturing self. Break it with [weak self] (or unowned when the lifetime is guaranteed) and weak delegates.

  6. What problems do actors and `@MainActor` solve in Swift concurrency?

    Advanced · 3pt
    Expected answer

    Actors protect their mutable state so only one task touches it at a time, preventing data races. @MainActor guarantees code runs on the main thread, which UI updates require. The compiler enforces these rules (Sendable checking).

  7. Explain certificates, provisioning profiles and how an app gets onto TestFlight.

    Advanced · 3pt
    Expected answer

    A signing certificate proves the developer’s identity; a provisioning profile ties the app ID, certificate, devices and capabilities (entitlements) together. Archive with a distribution profile, upload to App Store Connect, then distribute to testers via TestFlight after processing (and beta review for external testers).

Android · 7

  1. How does Kotlin handle null safety?

    Basic · 1pt
    Expected answer

    Types are non-null by default; String? may be null. Use safe calls ?., the Elvis operator ?: for defaults, and let. !! throws if null and should be avoided.

  2. What happens to an Activity on a configuration change such as rotation, and how do you keep data?

    Basic · 1pt
    Expected answer

    The Activity is destroyed and recreated. Keep UI state in a ViewModel (survives configuration changes) and use SavedStateHandle / rememberSaveable for state that must survive process death.

  3. What is recomposition in Jetpack Compose, and why hoist state?

    Intermediate · 2pt
    Expected answer

    When state read by a composable changes, Compose re-runs that composable to update the UI. Hoisting moves state up to the caller so composables are stateless, reusable and testable, with one source of truth (state down, events up).

  4. Describe MVVM on Android: what belongs in the ViewModel and what in the repository?

    Intermediate · 2pt
    Expected answer

    The UI observes state from the ViewModel and sends it events; the ViewModel holds UI state (e.g. StateFlow) and logic, and survives configuration changes. The repository owns data access (network, Room database) and hides where data comes from.

  5. What is structured concurrency with coroutines, and why use `viewModelScope`?

    Intermediate · 2pt
    Expected answer

    Coroutines are started in a scope and are cancelled with it, so work never outlives its owner. viewModelScope cancels its coroutines when the ViewModel is cleared, preventing leaks and wasted work. Use Dispatchers.IO for blocking I/O.

  6. Explain cold vs hot flows, and the difference between `StateFlow` and `SharedFlow`.

    Advanced · 3pt
    Expected answer

    A cold Flow starts producing for each collector when collected; a hot flow emits regardless of collectors. StateFlow always has a current value and replays the latest to new collectors (UI state). SharedFlow can have no value and configurable replay (one-off events).

  7. How do you sign and release an app on Google Play, and how does a staged rollout help?

    Advanced · 3pt
    Expected answer

    Build an Android App Bundle (AAB) signed with the upload key (Play App Signing holds the app signing key), bump versionCode, upload to a testing track, then production. A staged rollout releases to a percentage of users first so crashes can be caught and the rollout halted.

Add a question