Mobile Tech Lead

Practice 40 mobile technical leadership scenarios covering code reviews, architecture, releases, reliability, privacy, accessibility, and team ownership with worked answers.

~1 hr 36 min reading~2 hr practice estimate
Suggest content

Mobile Tech Lead Questionnaire

🟪 Syntax · 🟦 Types/APIs · 🟩 Correct pattern · 🟥 Bug · 🟨 Gotcha · 🧠 Explanation

Quick Recap

This is an independently authored, open-response practice bank for mobile technical leadership. Its 40 questions combine Swift/Kotlin code review with decisions spanning iOS, Android, backend contracts, production incidents, and team ownership. A strong response explains the invariant, owner, failure flow, test, and tradeoff; naming an architecture pattern is only a starting point.

Review the concepts in Architecture and SOLID, Swift Types, Protocols, and Generics, Mobile Systems and Engineering Leadership, and Mobile Tech Lead and Architecture. These questions ask you to apply those concepts rather than memorize their definitions.

🟨 All snippets are illustrative review exercises, not production libraries. Swift examples assume a Swift 6 language mode and Foundation where imported; Kotlin coroutine examples require kotlinx.coroutines. No snippet is claimed to have been compiled or executed. Intentionally problematic code is labeled 🟥. Platform/library availability and project isolation settings still need checking in a real application.

A 60-minute practice session

The following is a suggested practice agenda, not a calculated reading time or a replica of an employer's interview format. Select a subset; do not try to answer all 40 questions in one hour. In later sessions, substitute scenarios from MTL-21–MTL-40 to practice release, reliability, product, and organizational decisions.

MinutesActivityEvidence to produce
0–5Clarify one product scenario and its constraintsBusiness invariant, user journey, platform/lifecycle assumptions
5–20Review two code exercises from MTL-01–MTL-07Exact execution sequence, correction, deterministic regression test
20–35Design one scenario from MTL-08–MTL-13Boundaries, contract, rejected alternative, migration/rollback
35–45Respond to one incident from MTL-14–MTL-17Impact, containment, evidence, owners, next update
45–55Discuss MTL-18, MTL-19, or MTL-20Decision process, actionable feedback, delivery negotiation
55–60Compare with the answer keyOne missed risk and one concrete follow-up practice task

Use this rubric for self-assessment. Record Unanswered, Needs work, Explained with support, or Defended under follow-up for each dimension. These are learning observations, not hiring predictions, an official score, or a probability of passing.

DimensionEvidence of a defensible response
CorrectnessNames the invariant and gives a plausible counterexample; separates data races from logical ordering bugs
ContractsDefines success, error, cancellation, ownership, and compatibility across boundaries
TradeoffsCompares feasible alternatives against the actual constraints
ValidationProposes controlled tests and meaningful production measurements
Delivery and leadershipAssigns owners, sequences a safe change, and communicates uncertainty and user impact

Questions — answer before opening the key

MTL-01 — Does clamping a computed total make the basket valid?

The team claims that this computed total guarantees a valid checkout basket, even when callers directly change the discount.

SWIFT
struct Basket {
    var subtotalCents: Int
    var discountCents: Int
​
    var totalCents: Int {
        max(0, subtotalCents - discountCents)
    }
}
​
var basket = Basket(subtotalCents: 1_000, discountCents: 200)
basket.discountCents = 50_000
Optional follow-up questions
  • Which construction and mutation rules should enforce valid amounts, currency, and discount bounds?
  • How would you test invalid drafts, arithmetic limits, and the server-authoritative payment boundary?

MTL-02 — Why do concrete and base-typed calls choose different routing behavior?

The Swift and Kotlin examples call the same router object through a concrete reference and a base-typed reference.

SWIFT
class PaymentRouter {
    func route(_ value: Any) -> String { "base-any" }
}
​
final class CardRouter: PaymentRouter {
    override func route(_ value: Any) -> String { "card-any" }
    func route(_ value: String) -> String { "card-string" }
}
​
let concrete = CardRouter()
let abstraction: PaymentRouter = concrete
print(concrete.route("checkout"))
print(abstraction.route("checkout"))
KOTLIN
open class PaymentRouter {
    open fun route(value: Any): String = "base-any"
}
​
class CardRouter : PaymentRouter() {
    override fun route(value: Any): String = "card-any"
    fun route(value: String): String = "card-string"
}
​
fun main() {
    val concrete = CardRouter()
    val abstraction: PaymentRouter = concrete
    println(concrete.route("checkout"))
    println(abstraction.route("checkout"))
}
Optional follow-up questions
  • How do overload selection and overriding differ in each language?
  • Could adding an overload change recompiled callers, and how would a typed destination make the API clearer?

MTL-03 — Why does calling analytics through a protocol use the default behavior?

An iOS team starts using a Screen protocol as a dependency and unexpectedly gets the default analytics name.

SWIFT
protocol Screen {
    func title() -> String
}
​
extension Screen {
    func analyticsName() -> String { "default" }
}
​
struct CheckoutScreen: Screen {
    func title() -> String { "Checkout" }
    func analyticsName() -> String { "checkout" }
}
​
let concrete = CheckoutScreen()
let screen: any Screen = concrete
print(concrete.analyticsName())
print(screen.analyticsName())
print(screen.title())
Optional follow-up questions
  • Which results do the concrete and protocol-typed calls produce?
  • How do Kotlin interface members differ from extension functions, and which public-boundary tests would catch the change?

MTL-04 — Can a cached repository replace one that promises current authenticated data?

The existing repository promises a current authenticated profile or a meaningful failure. A proposed replacement returns any cached profile and turns authentication failures into an empty profile.

Optional follow-up questions
  • How should the result expose account identity, freshness, and unavailable data?
  • Would composed cache policies or separate capabilities fit better than forcing all implementations into one interface?

MTL-05 — Can an actor oversell a seat while waiting for payment?

One seat remains and two tasks call reserve. Both payment calls can succeed, and charge suspends.

SWIFT
import Foundation
​
protocol Charging: Sendable {
    func charge() async throws -> UUID
}
​
enum BookingError: Error {
    case soldOut
}
​
actor SeatInventory {
    private var available = 1
​
    func reserve(using charger: any Charging) async throws -> UUID {
        guard available > 0 else { throw BookingError.soldOut }
        let receipt = try await charger.charge()
        available -= 1
        return receipt
    }
}
Optional follow-up questions
  • How should held, confirmed, rejected, and unknown outcomes behave after cancellation or a timeout?
  • How would a controlled two-caller test expose the interleaving without sleeps?

MTL-06 — Should cancellation be reported as an empty order list?

Android currently converts any exception into an empty order list, while iOS reports cancellation separately.

KOTLIN
data class Order(val id: String)
​
interface OrdersApi {
    suspend fun fetch(): List<Order>
}
​
class OrdersRepository(private val api: OrdersApi) {
    suspend fun load(): List<Order> {
        return try {
            api.fetch()
        } catch (error: Exception) {
            emptyList()
        }
    }
}
Optional follow-up questions
  • Which results should both platforms expose for timeout, authentication failure, stale cache, and a genuinely empty history?
  • Who should own the lifetime of search, purchase submission, and a durable upload?

MTL-07 — How can an old account’s search response appear after switching accounts?

A request starts for account A, the app switches to account B, B’s request completes, and A’s request completes last.

SWIFT
protocol SearchAPI: Sendable {
    func search(accountID: String, query: String) async throws -> [String]
}
​
@MainActor
final class SearchModel {
    private let api: any SearchAPI
    var accountID = "account-a"
    private(set) var results: [String] = []
​
    init(api: any SearchAPI) {
        self.api = api
    }
​
    func search(_ query: String) async throws {
        results = try await api.search(accountID: accountID, query: query)
    }
}
Optional follow-up questions
  • What work should cancellation stop, and why must publication guards remain?
  • How would controlled completion order and sign-out tests verify the same privacy boundary on both platforms?

MTL-08 — How should a team choose its first module extraction?

Four teams share slow builds and changes that cross unrelated features. A proposed Core module would collect almost every shared model, client, and view model.

Optional follow-up questions
  • How would a vertical feature boundary compare with a shared infrastructure extraction?
  • Which owners, compatibility seams, and before-and-after measures would justify continuing or stopping the migration?

MTL-09 — Does a global dependency registry define a safe session lifetime?

A shared registry supplies a caching profile repository to presenters, but its initialization, concurrency, and logout behavior are unspecified.

KOTLIN
interface ProfileApi {
    suspend fun loadName(): String
}
​
class ProfileRepository(private val api: ProfileApi) {
    private var cachedName: String? = null
​
    suspend fun loadName(): String {
        val cached = cachedName
        if (cached != null) return cached
        return api.loadName().also { cachedName = it }
    }
}
​
object Dependencies {
    lateinit var profiles: ProfileRepository
}
​
class ProfilePresenter {
    suspend fun title(): String = Dependencies.profiles.loadName()
}
Optional follow-up questions
  • Which objects should live for the app, session, and feature, and how would tests construct independent graphs?
  • What happens to an old presenter’s pending call after the session changes, regardless of the DI framework?

MTL-10 — How can a checkout API evolve while older clients still work?

Checkout now needs currency and a stable retry key, but older apps remain installed and external teams implement the existing interfaces.

Optional follow-up questions
  • How do source, binary, and behavioral compatibility differ?
  • Which shared fixtures should verify retries, cancellation, unknown values, and eventual removal of the old contract?

MTL-11 — Who should own checkout state when a screen is recreated?

A checkout loses drafts during navigation, submits again when its UI is recreated, and shows inaccessible progress. The proposed fix puts all state in a singleton.

Optional follow-up questions
  • How should session identity, pending operation IDs, validation, and submission states be represented?
  • Which reusable-control and UI tests cover late results, rapid taps, process recreation, screen readers, and large text?

MTL-12 — How can retrying a timed-out purchase avoid creating another purchase?

The app restarts after a submission times out. The user retries, and both deliveries may have reached the server.

Optional follow-up questions
  • How should operation identity, payload, account, retention, authorization, and retry limits be bound together?
  • Why are a disabled button, a local actor or Mutex, and a new key on each retry insufficient?

MTL-13 — How should you decide which parts of a mobile app to share?

Leadership wants one codebase to halve delivery time. The app depends on camera capture, background sync, secure authentication, and accessible forms.

Optional follow-up questions
  • Which options, owner, decision criteria, consequences, and revisit trigger belong in the architecture decision record?
  • What measured result from a representative prototype would reverse the initial recommendation?

MTL-14 — How should a lead respond to possible cross-account data exposure?

Support reports that users sometimes see another account’s saved addresses briefly after switching accounts. A proposed fix simply moves all work to the main thread.

Optional follow-up questions
  • Which cache keys, stale responses, persistence, and backend checks belong in the hypothesis tree?
  • How would synthetic-account tests, privacy-safe telemetry, and clear update times verify containment and support communication?

MTL-15 — Can reverting an app release undo a destructive local migration?

A staged release drops a table containing unsynced drafts. Error rates rise, and the team proposes reverting the commit and asking users to downgrade.

Optional follow-up questions
  • Which behavior can the remote flag actually disable, and which data requires recovery?
  • How would you test expand-migrate-contract steps, interrupted startup, low disk space, old clients, and unsynced intent before resuming rollout?

MTL-16 — Which measurements should guide a mobile performance fix?

Overall startup looks faster, but low-end devices hitch in transaction history and memory rises after repeated visits. The proposed fix caches every response and moves parsing into detached tasks.

Optional follow-up questions
  • Which platform diagnostics distinguish retained closures or tasks, cache growth, repeated subscriptions, and main-thread CPU work?
  • Which representative journeys, timing distributions, memory limits, cancellation rules, and regression budgets would justify the change?

MTL-17 — Which checkout defects should block a release?

The release candidate logs request bodies, trusts an isAdmin deep-link parameter, and has an unlabeled confirmation icon that fails at large text sizes.

Optional follow-up questions
  • What are the smallest verifiable fixes for logging, route validation, server authorization, and accessible status or error recovery?
  • How should impact, affected users, and verified mitigations be communicated for the release decision?

MTL-18 — How can a concurrency review teach safe ownership without blaming the author?

A deadline-driven patch adds unchecked Sendable declarations on iOS and GlobalScope work on Android. The junior author of the original feature feels blamed.

Optional follow-up questions
  • What blocking concern, ownership question, and smaller fix or test path would you write in the review?
  • What evidence could justify an unsafe escape hatch, and how would mentoring and a second reviewer support follow-up?

MTL-19 — How can a team resolve an architecture disagreement under a deadline?

A new payment experiment is due in three weeks. One team wants a rewrite, another wants duplication, and security requires a new server-side validation step.

Optional follow-up questions
  • Which uncertainty needs a time-boxed experiment, and who makes the decision?
  • How would an incremental boundary, a debt record, and a revisit trigger make scope and date consequences clear to product and engineers?

MTL-20 — What should a new lead accomplish in the first month across both mobile teams?

The iOS and Android teams have different architectures, unreliable tests, slow releases, and no shared incident owner. Feature delivery must continue.

Optional follow-up questions
  • Which contracts need cross-platform parity, and which implementation choices should remain local?
  • What delivery, reliability, accessibility, and user-outcome measures, mentoring, handoffs, and review cadence would support the plan?

MTL-21 — When is a staged rollout safe to expand?

A new checkout build reaches a small release cohort. Overall crash-free sessions improve, but support reports failed confirmations on older devices. The dashboard mixes both platforms and includes users who never opened checkout. Product wants to expand before the weekend.

Define the eligible population, comparison cohorts, user outcomes, and minimum evidence needed for expansion. Separate a release halt, a remotely controlled feature disable, and a forward fix. Specify who can act, what happens when telemetry is delayed, and how you account for pending transactions. Which result would stop expansion even if the aggregate dashboard remains green?

MTL-22 — How do you evaluate a third-party SDK request?

Marketing requests an SDK that promises better attribution. Its sample initializes at app launch, reads device information, and retries requests in the background. No team currently owns upgrades, data handling, or removal. The vendor demonstration measures only a fresh install on one device.

Design an intake and experiment that evaluates product value, data collection, consent behavior, startup and energy cost, failure isolation, licensing/security review, and ongoing maintenance. Where should the adapter and configuration live? Explain how to prove the SDK stays inactive when disallowed, how to remove it, and when a smaller server-side or first-party integration is preferable.

MTL-23 — What makes a flaky UI test usable release evidence?

A checkout UI test fails intermittently because it sometimes observes an empty receipt screen. Engineers add a longer sleep and allow three reruns; the dashboard reports the final attempt only. The same symptom has appeared once in production.

Separate possible product ordering bugs, unstable fixtures, environment failures, and test synchronization mistakes. Propose observable synchronization points, controlled response ordering, and a smaller contract test. How do you preserve first-attempt evidence, handle temporary quarantine, and decide whether the release gate is trustworthy? Explain why a passing rerun does not establish that the first failure was harmless.

MTL-24 — How should notification navigation survive authentication and process restart?

A user taps an order notification while signed out. After authentication, the app opens the wrong account's previous order screen. A second callback then pushes another copy of the destination. Sometimes the process is recreated during sign-in.

Design a validated navigation intent with an appropriate lifetime. Define who owns the pending destination, account binding, consumption, and expiry. Distinguish deduplicating one delivery from preventing the user from deliberately reopening an order. Include unavailable/deleted orders, authorization failure, cancellation, process restart, and predictable back navigation. Which data is safe to persist and which must be fetched only after authorization?

MTL-25 — How do you paginate a list that changes while the user reads?

An activity feed uses page numbers. New records arrive between requests, so users see duplicates and miss records; a refresh can also replace a newer page with an older response. A proposal removes duplicates by comparing visible titles.

Define item identity, ordering, cursor or snapshot semantics, and what freshness the product actually promises. Separate initial load, refresh, append, and their error states. Explain when a generation check is needed, how to handle deleted/updated items and expired cursors, and whether scroll position should survive reconciliation. Name deterministic client/server contract cases and the tradeoff between a stable reading snapshot and immediate freshness.

MTL-26 — What should happen when two devices edit the same draft offline?

Two devices edit the same inspection draft while offline. One changes a safety status and the other changes notes; both later upload complete objects. A last-arriving request silently restores an older safety status. The team suggests choosing the greatest client timestamp.

Design a versioned synchronization contract that preserves local unsynced intent and exposes conflicts. Decide which fields can merge, which require user confirmation or domain validation, and who owns the resolution UI. Explain retries, deletes, authorization expiry, restart, and bounded pending state. How do you validate convergence without trusting device clocks or claiming that every field can use the same conflict rule?

MTL-27 — Which time should an appointment store and display?

A travel app stores an appointment as a formatted local string. The user changes time zone, the device clock is wrong, and a daylight-saving transition makes a chosen wall-clock time ambiguous or nonexistent. Reminders and the booking server disagree.

Separate a confirmed instant from a recurring local-time rule, a calendar date, a time zone, and display formatting. Identify which system is authoritative for booking and expiry. Define ambiguity handling, reminder reconciliation, and behavior after a zone change. Describe deterministic tests using injected clocks and explicit zones. What should the UI explain before converting a user's local-time intent into an authoritative booking?

MTL-28 — How can a large upload resume without corrupting its business record?

A field technician records a large inspection video on an unreliable connection. The app uploads the file again after every restart. Storage fills, the account changes, and a timeout occurs after the server receives the last chunk but before the report is marked complete.

Design the local upload record, upload-session contract, integrity checks, finalization, and reconciliation. State file ownership and cleanup rules, concurrency/energy budgets, authorization boundaries, and cancellation semantics. Distinguish transport progress from a confirmed report attachment. What happens if the file disappears, the upload session expires, or the backend has committed finalization but the acknowledgment is lost?

MTL-29 — How do you run a mobile experiment without misleading results?

An onboarding experiment assigns a variant on each screen load. Anonymous users receive another variant after sign-in, and an “exposure” event fires before the experiment UI renders. Conversion appears higher, but accessibility complaints and network errors also increase.

Define an assignment unit, stable exposure boundary, eligible population, primary outcome, and guardrails before interpreting the result. Explain anonymous-to-account transitions, offline events, duplicate delivery, privacy minimization, and app-version differences. Who owns experiment validity and who can stop it? Describe a validation plan that distinguishes assignment, actual exposure, and business completion rather than treating every analytics event as ground truth.

MTL-30 — What does account deletion mean for an offline mobile client?

A user requests account deletion. The app immediately displays “Deleted,” but the server request times out. Local drafts and queued analytics remain, another device is offline, and a later retry may recreate data. Support asks for a universal promise that every copy disappears instantly.

Define request acceptance, pending processing, confirmed completion, and any explicitly retained data. Assign product, backend, mobile, and privacy owners without inventing a legal retention period. Explain session revocation, pending queues, local cleanup, offline devices, retries, and restore/reinstall limits. Which evidence can confirm each stage, and how should the UI communicate an ambiguous result without exposing deleted content in logs?

MTL-31 — How do you preserve accessibility through asynchronous form errors?

A long checkout form works with touch on a large screen. With a screen reader or external keyboard, an address-validation error appears above the current field without announcement; focus jumps to the top after every response. At large text sizes, the correction button leaves the visible area.

Define logical focus order, error identification and recovery, status announcements, and the owner of focus changes. Distinguish a user-requested submit from background validation and stale responses. Design representative screen-reader, keyboard, zoom/text-size, and interruption checks on both platforms. How do you make errors discoverable without moving focus on every keystroke or announcing the same message repeatedly?

MTL-32 — How do you localize a transaction flow without changing its meaning?

An app concatenates translated words around amounts, parses a displayed balance back into a number, and mirrors every icon for right-to-left languages. A translated refund message reverses the meaning of who owes whom, and longer text hides the confirmation action.

Define the boundary between business values and localized presentation. Cover currency/rounding ownership, pluralized messages, bidirectional text, semantic icon direction, accessible names, and layout growth. How should translators receive domain context and how should engineering validate critical messages? Explain what pseudolocalization can reveal, what requires human review, and why screenshots alone cannot prove that financial meaning is correct.

MTL-33 — How should the app behave when a dependency is overloaded?

A recommendation service slows down. Each screen retries three times, the networking layer retries again, and users repeatedly pull to refresh. Checkout shares the same request pool and becomes unusable even though its backend is healthy.

Map the end-to-end deadline and retry amplification. Assign one layer to retry, classify failures and operation safety, and define bounded concurrency, backoff, cancellation, and isolation for critical traffic. Choose an honest degraded recommendation experience. Which user-journey indicators and backend signals should drive containment and recovery? Explain the limitations of per-device circuit breaking when many devices may retry together.

MTL-34 — How do you keep remote configuration from becoming remote failure?

A remotely edited configuration sets a negative cache limit and references a payment route an older app cannot understand. One client applies individual fields as they arrive; another discards all cached configuration whenever fetching fails. The result is an inconsistent startup state.

Design a typed, versioned configuration envelope with field and cross-field validation, capability targeting, atomic activation, and last-known-good behavior. Distinguish expired, unavailable, malformed, and valid-but-unsupported configurations. Identify decisions that require conservative defaults versus feature-specific stale values. Who reviews and can revoke a configuration, and how do you test it against supported client versions before activation?

MTL-35 — When does a platform team help instead of becoming a queue?

Six feature teams depend on a mobile platform team for build tooling, navigation, networking, and every new screen component. Tickets wait weeks. The platform team reports a high number of completed requests, while feature teams fork shared code to meet delivery dates.

Define which capabilities need central ownership, which should be self-service, and where contribution rights or local implementations are appropriate. Propose a service contract, support boundary, adoption/migration plan, and path for urgent issues. Which measures reveal reduced cognitive load and waiting rather than central-team output alone? Explain how to avoid creating either a mandatory approval gate or an abandoned collection of “shared” libraries.

MTL-36 — What evidence lets you retire a legacy architecture path?

A new navigation coordinator replaces an old router, but both remain active behind adapters. Analytics events fire twice, support links still enter through the old router, and a team wants to delete it because the new path has more unit tests.

Define the inventory of entry points, ownership of each side effect, and a migration seam that prevents double handling. Decide which behaviors require parity and which differences are intentional product changes. Plan staged routing, compatibility, fallback, and retirement criteria. How do you prove that the legacy path is unused without logging private URLs, and how do you avoid interpreting missing telemetry as evidence of no traffic?

MTL-37 — What belongs in an on-device cache on a shared device?

A healthcare app caches documents for offline access. After logout, the visible list is empty, but files, thumbnails, search indexes, and a preview task remain. Another person uses the same device. A proposed fix encrypts the main database while leaving cache ownership unchanged.

Build a data inventory and threat model before selecting controls. Define account-scoped access, key and file lifetimes, logout/revocation behavior, background task invalidation, and offline-unlock policy. Distinguish removing an index entry, denying access, and deleting data. Explain which limits must be disclosed for backups and already exported files, and propose synthetic-data tests that examine every derived representation.

MTL-38 — How do concurrent requests share credential refresh safely?

Ten requests receive an expired-credential response together. Each refreshes independently; the backend rotates the credential, so later refreshes fail. Meanwhile the user signs out and signs in as another account. An old refresh completes and overwrites the new session.

Design a session-owned refresh coordinator, explicit result types, and bounded request replay. Specify the refresh key, publication checks, cancellation policy for individual waiters, and logout invalidation. Which failures end the session and which may be transient? Explain why a single refresh task alone does not prevent stale publication, and why replaying every failed write requires a separate business-operation contract.

MTL-39 — How do you know the reviewed build is the one being released?

The release job rebuilds the app after QA approval using floating dependencies and an environment-specific script. The released artifact has different behavior, and nobody can map it to the exact reviewed source/configuration. Signing credentials are available to every job.

Design a chain from source revision and resolved dependencies to a versioned build artifact, test evidence, approval, signing, and publication. Separate artifact identity from a marketing version label. Define permissions, environment inputs, retained evidence, and recovery if provenance breaks. What does reproducibility prove, what does it not prove, and how would you verify release identity when platform packaging or signing legitimately transforms an artifact?

MTL-40 — Which boundaries protect a mobile AI assistant?

A mobile assistant summarizes account documents and can create support requests. The prototype embeds a provider credential in the app, sends whole documents by default, and treats retrieved document text as permission to call tools. A canceled screen can still publish a late answer into another account's session.

Design the mobile/backend/provider boundaries, data-minimization policy, tool authorization, typed results, and session-owned UI state. Include deadlines, cancellation, cost/usage limits, uncertain output, and audit evidence without raw private content. Explain how to evaluate answer quality and harmful actions separately. Which operations require a fresh user decision, and what useful fallback remains when the model or provider is unavailable?

Answer key — reasoning and assessment signals

These are model assessment signals, not scripts to recite or the only acceptable designs. Follow-up questions should test the candidate's assumptions. A justified alternative can be stronger than a matching vocabulary list.

MTL-01 — Answer

Short answer: No. Showing zero for an invalid total hides the problem while leaving invalid stored values unchanged. Validate the basket when it is created and changed, and keep editable drafts separate from valid checkout requests. The server must still confirm prices, discounts, currency, and the final charge.

Detailed explanation:

Illustrative validated basket: construction and mutation preserve nonnegative bounded subtraction. The explicit sample currency type is not a complete payments/currency model.

SWIFT
enum Currency: Sendable { case usd, eur }
enum BasketError: Error { case invalidAmount }
struct Basket {
    let currency: Currency
    let subtotalCents: Int
    private(set) var discountCents = 0
    var totalCents: Int { subtotalCents - discountCents }
    init(subtotalCents: Int, currency: Currency) throws {
        guard subtotalCents >= 0 else { throw BasketError.invalidAmount }
        self.subtotalCents = subtotalCents
        self.currency = currency
    }
    mutating func applyDiscount(_ cents: Int) throws {
        guard (0...subtotalCents).contains(cents) else { throw BasketError.invalidAmount }
        discountCents = cents
    }
}

The server still confirms price, eligible discounts, currency, and the final charge; invalid editable text belongs in a separate draft.

🧠 Clamping the displayed total hides an invalid discount; it does not enforce the basket's rules. Decide whether a draft may hold invalid user input, then convert it into a validated checkout request. Keep domain storage private and expose validated operations such as applying a discount. Validate construction as well as later mutation. Specify nonnegative amounts, a currency, permitted discount bounds, and overflow handling rather than assuming every Int is safe. A read-only computed total derives from the stored values each time it is read; it is not automatically memoized or asynchronously refreshed.

🟩 Strong signal: separates editable draft, validated domain value, and server-authoritative price; proposes boundary tests including currency mismatch and out-of-range arithmetic. 🟥 Red flag: “Make every property private” without an allowed mutation path, or trusting a local total as payment authority. Compare the responsibility and invariant boundaries in Architecture and SOLID.

MTL-02 — Answer

Short answer: The declared types determine which overload is available, while an override supplies the runtime implementation of the selected member. Both examples therefore print card-string for the concrete call and card-any for the base-typed call. A clearer typed routing contract can avoid relying on that subtle distinction.

Detailed explanation:

Illustrative typed routing removes Any overload ambiguity while retaining polymorphism through a deliberate member contract.

KOTLIN
sealed interface PaymentDestination {
    data class CardCheckout(val orderId: String) : PaymentDestination
    data object PaymentHistory : PaymentDestination
}
interface PaymentRouting {
    fun route(destination: PaymentDestination)
}
fun openOrder(router: PaymentRouting, orderId: String) {
    router.route(PaymentDestination.CardCheckout(orderId))
}

Both examples print card-string, then card-any. The concrete call sees the more specific String overload. The base-typed call selects the Any signature, then invokes its subclass override. An overload changes the available signatures; an override replaces behavior for an inherited overridable signature. Kotlin classes and members require the applicable open/override declarations. Swift also checks overrides against superclass declarations. Swift inheritance, Kotlin inheritance.

🟩 Strong signal: distinguishes signature selection from runtime dispatch and notes that new overloads can affect recompiled call sites without changing existing binaries. Prefers a typed destination or deliberately named operations over Any. 🟥 Red flag: predicts runtime argument inspection will select the string overload through the base type, or describes overloading and overriding as interchangeable.

MTL-03 — Answer

Short answer: Screen does not declare analyticsName as a requirement, so calls through the protocol use the extension helper. A same-named concrete method does not replace that helper for those calls. Declare varying behavior in the protocol contract, or inject the analytics policy separately when it has a different reason to change.

Detailed explanation:

Illustrative correction: declare variable behavior as a requirement and test the existential boundary, not only the concrete value.

SWIFT
protocol Screen {
    func analyticsName() -> String
}
extension Screen {
    func analyticsName() -> String { "default" }
}
struct CheckoutScreen: Screen {
    func analyticsName() -> String { "checkout" }
}
let screen: any Screen = CheckoutScreen()
assert(screen.analyticsName() == "checkout")

The results are checkout, default, and Checkout. title() is a protocol requirement with a conformance implementation. analyticsName() exists only in the extension, so the existential call does not dynamically select the concrete same-named method. If variation is part of the contract, declare a requirement; an extension may then provide its default implementation. If analytics policy varies independently of screen behavior, composition can be the clearer boundary. Swift protocol requirements and defaults.

Kotlin extensions likewise resolve from the declared receiver type; they do not add overridable interface members. A declared interface member establishes a different contract. Kotlin extensions.

🟩 Strong signal: tests via any Screen/the interface, not just CheckoutScreen, and checks privacy/allowed event names. 🟥 Red flag: assuming all extension methods participate in dynamic polymorphism. See the related type/abstraction distinctions in Swift Types, Protocols, and Generics.

MTL-04 — Answer

Short answer: Only if it preserves the same behavior contract, not merely the same method signature. A cached profile must belong to the correct account and clearly report whether it is stale or unavailable. Returning another account’s data or disguising an authorization failure as an empty success breaks that contract.

Detailed explanation:

Illustrative result contract distinguishes freshness and authorization instead of returning an empty success. Profile is an app domain type.

KOTLIN
enum class Freshness { CURRENT, STALE }
sealed interface ProfileResult {
    data class Available(
        val accountId: String,
        val profile: Profile,
        val freshness: Freshness
    ) : ProfileResult
    data object Unauthorized : ProfileResult
    data object Unavailable : ProfileResult
}

Consumers explicitly decide whether STALE is acceptable; the repository must still reject another account's cached profile.

The signature matches but freshness, identity, and failure semantics do not. A cached result needs account-scoped ownership and an explicit freshness/source contract; “no data,” “unauthorized,” and “stale but usable” must not collapse into a successful empty profile. Narrow the abstraction if current authenticated data and offline previews serve different clients. Composition can separate fetch, cache, and freshness policy without subclassing a repository that promises stronger guarantees.

🟩 Strong signal: writes the contract first, invalidates account data on session change, and runs the same contract scenarios against real adapters and fakes. 🟥 Red flag: weakening guarantees until every implementation technically conforms, or making tests pass by teaching a fake different error semantics. Apply LSP/ISP from Architecture and SOLID rather than requiring inheritance for code reuse.

Compare the worked LSP scenario and client-specific ISP interfaces for concrete broken/improved code and acceptance checks.

MTL-05 — Answer

Short answer: Yes. One task can check availability and pause for payment, allowing another task to pass the same check before either reserves the seat. Reserve local capacity before waiting and track the operation’s outcome explicitly. The backend must still enforce authoritative inventory and prevent duplicate payment effects.

Detailed explanation:

Illustrative local hold state machine: claim capacity in a synchronous actor segment and preserve an ambiguous external outcome for reconciliation.

SWIFT
actor SeatHolds {
    enum State { case held, confirmed, unknown }
    private var available = 1
    private var holds: [UUID: State] = [:]
    func hold() throws -> UUID {
        guard available > 0 else { throw BookingError.soldOut }
        let id = UUID()
        available -= 1
        holds[id] = .held
        return id
    }
    func markUnknown(_ id: UUID) {
        guard holds[id] != nil else { return }
        holds[id] = .unknown
    }
}

This fragment is not authoritative inventory; after a timeout it deliberately avoids blindly returning capacity while a charge may exist.

Caller A checks one seat and suspends; B checks the same seat and suspends; both charge and decrement, potentially reaching negative availability. Actor isolation protects individual accesses; suspension permits interleaving and does not make a multi-step transaction atomic. Apple's actor reentrancy explanation.

Reserve local capacity synchronously before suspension and track a reservation identity/state. Release it only under an explicit failure policy; an ambiguous charge needs reconciliation, not a blind retry or unconditional rollback. Authoritative shared inventory and an idempotent payment contract belong on the backend. Cancellation after a successful charge cannot undo money movement. Use a controlled charger with gates to suspend both attempts at known points, then assert capacity and state transitions.

🟩 Strong signal: separates reserved, confirmed, rejected, and unknown outcomes with recovery owners. 🟥 Red flag: “actors prevent every race,” adding a lock across await, or treating cancellation as a compensating financial transaction.

MTL-06 — Answer

Short answer: No. An empty result means the request completed and found no orders; cancellation means the requested work was stopped. Propagate cancellation before handling ordinary failures so callers can tell those outcomes apart. Cancelling a client task does not reverse a server operation that already completed.

Detailed explanation:

CancellationException is caught by the broad exception branch. Propagate it before handling actual failures; do not report cancellation as a valid empty order history. Kotlin cancellation guidance.

🟩 Minimal illustrative correction:

KOTLIN
import kotlinx.coroutines.CancellationException
​
class OrdersRepository(private val api: OrdersApi) {
    suspend fun load(): List<Order> {
        return try {
            api.fetch()
        } catch (cancelled: CancellationException) {
            throw cancelled
        } catch (failure: Exception) {
            throw failure
        }
    }
}

The second catch is intentionally redundant to show ordering; production code can omit the entire catch or map only known domain failures. Define parity for observable results, not identical platform error classes. Search usually follows UI/feature lifetime; a confirmed purchase requires reconciliation; durable uploads need durable scheduling/ownership rather than a screen-only task. Android lifecycle scopes cancel work according to their owner. Android lifecycle-aware coroutines.

🟥 Red flag: swallowing all exceptions or promising cancellation reverses server effects.

MTL-07 — Answer

Short answer: An older request can finish after the account changes and overwrite the current screen, even when every update runs on the main actor. Capture the session and request identity before waiting, then verify both before publishing. Account changes and sign-out must invalidate outstanding results as well as visible state.

Detailed explanation:

Illustrative replacement method inside the MainActor state holder; generation and sessionID are owner-controlled and account changes invalidate both state and outstanding requests.

SWIFT
func search(_ query: String) async throws {
    generation += 1
    let requestedGeneration = generation
    let requestedSession = sessionID
    let requestedAccount = accountID
    let rows = try await api.search(accountID: requestedAccount, query: query)
    try Task.checkCancellation()
    guard generation == requestedGeneration,
          sessionID == requestedSession,
          accountID == requestedAccount else { return }
    results = rows
}

No suspension occurs between the guards and publication. The session identifier changes even when the same account signs out and back in.

A may overwrite B after resuming, displaying the old account's results. @MainActor serializes publication but does not order responses by user intent. Capture an immutable account/session identity and a monotonically advancing request generation before suspension. After completion, publish only if both are still current; invalidation must happen on account change as well as on a new query. Cancel superseded tasks to reduce wasted work, then retain publication guards because cancellation is cooperative and completion can race with cancellation. The equivalent Android state holder needs the same ownership and publication rules. Swift concurrency and cancellation.

🟩 Strong signal: a fake API controls A/B completion; tests assert B remains visible and logout clears/invalidates old data even without another search. 🟥 Red flag: cancellation-only fixes, checking only query text, or using a global unscoped cache. The incident response consequences recur in MTL-14.

MTL-08 — Answer

Short answer: Start with a measured source of coupling and extract one bounded area behind a clear public API. Give the boundary an owner and enforce its dependency direction in the build graph. Compare delivery and build costs before expanding, because more modules can increase coordination and build overhead instead of reducing them.

Detailed explanation:

Illustrative Android checkout-module dependency boundary; equivalent iOS package/target dependencies should enforce the same ownership direction.

KOTLIN
// feature/checkout/build.gradle.kts
dependencies {
    implementation(project(":domain:checkout"))
    implementation(project(":platform:session-contract"))
    implementation(project(":designsystem"))
}

There is no dependency on another feature's internal ViewModel. The app composition root connects feature entry points; this is a proposed boundary, not a measured build improvement.

Pick a measured source of coupling and extract a bounded pilot, such as checkout behind a small feature API. The composition root wires implementations; features depend on stable domain/data capabilities and a deliberate navigation contract rather than importing another feature's internals. Keep account identity/session contracts explicit. A shared infrastructure extraction can help if duplicated unstable transport is the bottleneck; it can also create a giant coordination hub. Enforce the selected direction in the build graph and review public API changes. Android modularization patterns.

🟩 Strong signal: compares build/test time and cross-team change scope before and after, assigns API owners, and stops expanding if dependency or integration cost rises. 🟥 Red flag: measuring success only by module count or moving all mutable state into Core. Use the incremental migration guidance in Mobile Systems and Engineering Leadership.

MTL-09 — Answer

Short answer: No. A registry hides where dependencies come from and does not say when account-scoped caches or in-flight work become invalid. Construct an explicit dependency graph for each intended scope and pass dependencies into consumers. On session change, invalidate old results and sensitive state rather than only replacing a global reference.

Detailed explanation:

Illustrative constructor injection: create a fresh repository/presenter graph for each authenticated session, passing the session-bound API explicitly.

KOTLIN
class ProfilePresenter(private val profiles: ProfileRepository) {
    suspend fun title(): String = profiles.loadName()
}
data class SessionGraph(val presenter: ProfilePresenter)
​
fun buildSessionGraph(sessionApi: ProfileApi): SessionGraph {
    val repository = ProfileRepository(sessionApi)
    return SessionGraph(ProfilePresenter(repository))
}

The session owner cancels/invalidates the old graph on logout and prevents obsolete publication; building a new graph alone does not supply that cancellation policy.

The presenter hides its dependency and can observe a registry replacement midway through an object's lifetime. Repository caching is not account-keyed; the snippet supplies no concurrency policy. lateinit also permits use before initialization. A composition root should construct an immutable dependency graph per scope and inject the appropriate repository into the presenter. A session transition invalidates the old graph, cancels applicable work, clears sensitive caches, and prevents old completions from publishing. Merely replacing the global reference does not do this.

🟩 Strong signal: shows which objects survive logout and how deterministic tests construct independent graphs. A DI framework may automate construction, but lifecycle and thread-safety guarantees still need design. 🟥 Red flag: “Singleton equals thread-safe,” or replacing a global dependency from concurrent tests. Compare composition-root ownership in Mobile Tech Lead and Architecture.

The worked DIP scenario separates source dependency direction from constructor injection and shows assembly plus a controlled consumer check.

MTL-10 — Answer

Short answer: Add an explicit new contract and keep the old one available during a planned migration. An adapter is safe only when it can preserve the old operation’s meaning; it must not guess a currency or generate a new retry identity. Remove the old API only after compatibility and adoption evidence supports doing so.

Detailed explanation:

Illustrative additive V2 contract; the existing V1 protocol remains available during migration rather than acquiring a semantically unsafe default.

SWIFT
struct CheckoutRequestV2: Sendable {
    let operationID: UUID
    let amountMinorUnits: Int64
    let currencyCode: String
}
protocol CheckoutV2: Sendable {
    func submit(_ request: CheckoutRequestV2) async throws -> CheckoutReceipt
}

CheckoutReceipt is an app domain result. Validate currency/amount and persist the operation identity before calling; an adapter may only fill values it actually knows.

Version the behavioral contract, add an explicit new entry point, and retain a documented adapter only where its semantics can be correct. Do not default an unknown currency or invent a fresh retry key inside an adapter. Adding an abstract requirement can break conformers; a default that compiles but violates payment semantics is worse. Source compatibility concerns recompilation, binary compatibility concerns existing compiled clients, and behavioral compatibility concerns meaning. State the distribution/toolchain assumptions rather than promising one universal ABI guarantee.

🟩 Strong signal: proposes shared contract fixtures for success, ambiguous completion, retry identity, cancellation, and unsupported values; observes adoption before removing an old endpoint. 🟥 Red flag: “Add a default implementation and there is no breaking change,” or requiring synchronized app-store upgrades. See the API evolution discussion in Mobile Systems and Engineering Leadership.

MTL-11 — Answer

Short answer: Give each kind of state an owner that matches how long it must live. A view can own a temporary toggle, a feature can own the draft, and durable storage can own a pending purchase. Recreating the UI should display that state, not accidentally start the purchase again.

Detailed explanation:

Illustrative reusable SwiftUI control: it renders owner-supplied state and emits an intent; the feature owns validation and the stable operation ID.

SWIFT
struct SubmitOrderButton: View {
    let isSubmitting: Bool
    let canSubmit: Bool
    let onSubmit: () -> Void
    var body: some View {
        Button(action: onSubmit) {
            Text(isSubmitting ? "Submitting order…" : "Submit order")
        }
        .disabled(isSubmitting || !canSubmit)
        .accessibilityValue(isSubmitting ? "In progress" : "Ready")
    }
}

The caller supplies localized strings in production and preserves submission state beyond view reconstruction as the business lifetime requires.

A single source of truth owns each state lifetime: local presentation toggles, a feature-owned draft, session-owned identity, and durable pending business intent have different owners. A recreated view renders that state; it must not implicitly authorize another purchase. Submission receives a stable operation identity and has explicit idle/submitting/pending/confirmed/failed states. The reusable control renders a label, enabled state, progress, and accessibility semantics; it does not own the business transaction.

🟩 Strong signal: distinguishes view/composition lifetime from visibility, session lifetime, and process survival; tests recreation, late results, large text, focus, and error recovery. Android's LaunchedEffect is composition-scoped, so merely being composed does not prove the screen is visible. Android composition and lifecycle scopes.

🟥 Red flag: a singleton for every field, submitting from a render/body calculation, or treating a disabled button as server deduplication.

MTL-12 — Answer

Short answer: Store one operation identity and its validated payload before sending the purchase, then reuse both when retrying that same operation. The server must atomically recognize duplicates and return the recorded outcome. A timeout can mean the result is unknown, so reconcile it instead of assuming the purchase failed.

Detailed explanation:

Illustrative persisted-operation contract: retry transmits the stored ID and original payload, rather than creating another logical purchase.

KOTLIN
data class PendingPurchase(
    val operationId: String,
    val accountId: String,
    val payload: PurchasePayload,
    val payloadHash: String
)
suspend fun sendPending(pending: PendingPurchase, api: PurchaseApi): Receipt =
    api.submit(idempotencyKey = pending.operationId, payload = pending.payload)

App-specific types/DAO are omitted. The authenticated backend binds key, account, and validated payload atomically; a client-provided hash alone cannot enforce that binding.

Persist the logical operation identity and validated payload before dispatch; retries of that operation reuse its key. Define server-side payload/key binding, atomic deduplication and result storage, authorization, retention, and how clients reconcile an unknown result. A changed logical purchase receives a different identity. Account-scoped durable state must survive process death without leaking into another session. Bound attempts and queue size; back off with jitter and stop retrying permanent failures. Display pending/unknown honestly rather than telling the user the purchase failed while it may already exist.

🟩 Strong signal: tests timeout-after-commit, crash before acknowledgment, concurrent duplicate delivery, expiration of server deduplication history, and logout. Explains that a bounded idempotency contract is not universal exactly-once delivery. 🟥 Red flag: a new UUID for each network retry, replaying unauthorized requests indefinitely, or offering offline operations whose authoritative constraints cannot be reconciled. Extend Mobile Systems and Engineering Leadership.

MTL-13 — Answer

Short answer: Compare shared business logic and shared UI as different choices with different integration and ownership costs. Test the riskiest capability on both platforms before committing to a framework. Shared code can reduce duplication, but it does not automatically halve delivery work or preserve accessibility and platform behavior.

Detailed explanation:

Illustrative ADR experiment contract: agree the capability and rejection conditions before choosing a cross-platform implementation.

YAML
decision: checkout implementation boundary
owner: mobile architecture group
options: [native_apps, shared_domain_native_ui, shared_ui]
provisional_choice: shared_domain_native_ui
prototype: accessible camera-authentication flow on both platforms
must_preserve: [screen_reader_flow, cancellation, secure_key_use]
measure: [journey_latency, integration_effort, release_ownership]
reject_if: required_platform_behavior_or_accessibility_cannot_be_preserved
revisit: after_prototype_review_before_product_migration

These are proposed decision criteria, not reported experiment results; attach measured evidence and any accepted tradeoffs to the final ADR.

An ADR records the problem, constraints, options, decision owner, evidence, consequences, migration, and revisit trigger. Shared domain logic can reduce duplicated business rules while preserving native UI ownership; a shared UI can change staffing and integration costs, but neither guarantees half the work. Prototype the highest-risk capability, such as accessible camera-plus-authentication flow or background sync, across representative OS/device conditions. Compare equivalent user outcomes and operating costs rather than lines of shared code.

🟩 Strong signal: defines the measurement and failure threshold before a spike, includes interop/cancellation/resource ownership, and preserves a staged escape path. 🟥 Red flag: a framework choice based on popularity, a demo on one flagship device, or dismissing accessibility/platform behavior as later cleanup. Apply ADR tradeoffs from Mobile Tech Lead and Architecture.

MTL-14 — Answer

Short answer: Treat possible exposure as a security and privacy incident even if no crash occurred. Assign an incident owner, contain the affected path, and preserve evidence without logging sensitive data. Investigate both authorization and client state ownership, then prove that old account data cannot appear after a session change.

Detailed explanation:

Illustrative synthetic-account regression contract and privacy-safe evidence plan; this is a test/incident artifact, not live incident telemetry.

YAML
scenario: account_switch_with_late_address_response
sequence: [start_A, switch_to_B, complete_B, complete_A]
assertions:
  - only_current_session_addresses_can_render
  - sign_out_clears_visible_sensitive_state
allowed_telemetry: [opaque_request_id, generation, accepted_or_rejected]
forbidden_telemetry: [raw_address, token, request_body]
owners: [mobile_incident_lead, backend_authorization, security_privacy]

Treat possible cross-account exposure as a security/privacy incident even without a crash. Name an incident owner and involve the appropriate security/privacy responders. Contain the affected path or caching feature where feasible, verify the containment, and preserve evidence without reproducing sensitive payloads in logs. Investigate both authorization and client state: scoped keys, session generations, in-flight publication, persistence cleanup, and server checks. Add correlation IDs and coarse transitions according to a reviewed telemetry policy.

🟩 Strong signal: reproduces switch/start/complete ordering with synthetic accounts, tests old requests after logout, checks both platforms and backend, and communicates known impact and next update time without overstating certainty. 🟥 Red flag: moving all work to the main thread, assuming no crash means no incident, or logging raw address/token data. The state invariant in MTL-07 supplies one concrete diagnostic hypothesis.

MTL-15 — Answer

Short answer: No. Reverting source code or disabling a feature cannot restore data already deleted on users’ devices. Limit further exposure and plan a safe recovery release if necessary. Future migrations should preserve old data until conversion is validated and use restart-safe steps before any destructive cleanup.

Detailed explanation:

Illustrative SQLite expand/copy stage for a hypothetical schema: the old drafts remain available until validation and a later contraction decision.

SQL
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS drafts_v2 (
    id TEXT PRIMARY KEY,
    body TEXT NOT NULL,
    synced INTEGER NOT NULL
);
INSERT OR IGNORE INTO drafts_v2 (id, body, synced)
SELECT id, body, synced FROM drafts_v1;
COMMIT;

This is not a complete migration runner. Define the version/checkpoint transaction, validation, competing-write policy, and recovery before eventual deletion; do not mark migration complete merely because the table exists.

Pause exposure and disable the affected behavior if the flag actually controls it; a flag cannot restore deleted drafts or reverse a migration already executed at startup. A client-store release may require a forward recovery release. Preserve old data until conversion is validated; use versioned, restart-safe migration steps and delay destructive contraction until compatibility and recovery criteria are met. Backends must keep supporting clients that do not update immediately.

🟩 Strong signal: tests termination at migration checkpoints, low-space failures, pending outbox preservation, fresh installs, upgrades, and old-client interaction; defines recovery and data-loss indicators before resuming. 🟥 Red flag: promising that reverting source code undoes on-device state or that users can instantly downgrade. Use the release and rollback framing in Mobile Tech Lead and Architecture.

MTL-16 — Answer

Short answer: Measure the user journey and device group that actually regressed, rather than relying on an overall average. Separate slow frames, retained objects, temporary allocation peaks, and network delay because they need different fixes. Make cache limits and task ownership explicit, then verify that the chosen change improves both responsiveness and memory behavior.

Detailed explanation:

Illustrative cache factory uses a product-configured cost target and explicit session cleanup. NSCache cost limits are advisory, so measure footprint rather than claiming a hard memory ceiling.

SWIFT
func makeImageCache(costTargetBytes: Int) -> NSCache<NSString, UIImage> {
    precondition(costTargetBytes > 0)
    let cache = NSCache<NSString, UIImage>()
    cache.totalCostLimit = costTargetBytes
    return cache
}
​
let imageCache = makeImageCache(costTargetBytes: configuredImageCacheBytes)
// At the account/session teardown boundary:
imageCache.removeAllObjects()

UIKit/Foundation imports and the configuration owner are omitted. Other owners may still retain images; compare steady-state and peak memory after cleanup.

Measure the journey and cohort that regressed; an average startup metric cannot explain transaction-history hitches. Time profiling, frame diagnostics, allocation analysis, and ownership graphs answer different questions. A retained task/closure cycle differs from a bounded cache or a transient decode spike. Make cache limits, invalidation, task owners, and cancellation explicit. Moving CPU work requires an isolation/data-transfer plan; an arbitrary detached task is not a lifecycle or performance strategy.

🟩 Strong signal: defines p95/p99 or another justified distribution measure, representative hardware/data, repeated navigation/backgrounding, and both time and peak-memory budgets. Uses an experiment to choose a fix, then verifies user-visible improvement. 🟥 Red flag: weak references everywhere, unbounded caches, or counting successful background dispatches as performance evidence. Revisit the diagnostics guidance in Mobile Systems and Engineering Leadership.

MTL-17 — Answer

Short answer: Sensitive request logging, client-controlled privilege, and an unusable confirmation action create concrete release risks even when the happy path works. Assign owners and verify a mitigation for each before accepting the risk. Server authorization, safe telemetry, and accessible interaction protect different parts of the same checkout journey.

Detailed explanation:

Illustrative accessible action replacement: use a semantic, text-scalable control and owner-provided pending state rather than a tiny unlabeled image tap.

SWIFT
struct ConfirmPayment: View {
    let isPending: Bool
    let onConfirm: () -> Void
    var body: some View {
        Button(isPending ? "Confirming payment…" : "Confirm payment",
               action: onConfirm)
            .buttonStyle(.borderedProminent)
            .disabled(isPending)
    }
}

Localize and test the whole journey at large text. The action still calls a server-authorized operation; accessible UI and backend authorization solve different parts of this release risk.

Do not trust a deep-link flag for privilege: validate the destination/input, authenticate the user, and enforce authorization on the server. Stop sensitive request-body logging and review existing exposure with the right owner. Restore a meaningful accessible action label, usable layout and target, and understandable status/error behavior; validate with screen readers and large text on both platforms. Make release decisions from impact, exploitability, affected users, and verified mitigation, not from one happy-path run.

🟩 Strong signal: gives owners and concrete verification for each risk, distinguishes immediate containment from durable fixes, and explains how the release gate protects actual user tasks. 🟥 Red flag: calling accessibility cosmetic, treating hidden UI as authorization, or retaining unredacted logs “just for support.” Threat modeling and quality gates apply across architecture choices.

MTL-18 — Answer

Short answer: Name the invariant the patch must protect, identify who owns the work and mutable state, and request a small regression test that exposes the failure. Suppressing compiler checks or detaching work does not establish that ownership. Offer a bounded fix and share review responsibility so future changes do not depend on one lead’s approval.

Detailed explanation:

Illustrative smaller concurrency fix: an actor owns the mutable cache, removing the need to silence checking on a shared mutable class.

SWIFT
actor ProfileCache {
    private var namesByAccount: [String: String] = [:]
    func name(accountID: String) -> String? { namesByAccount[accountID] }
    func store(_ name: String, accountID: String) {
        namesByAccount[accountID] = name
    }
    func clear() { namesByAccount.removeAll() }
}

Account/session invalidation and stale-request guards remain separate requirements. Pair this ownership change with the two-caller test instead of treating actor syntax as the entire review.

A useful blocking comment names an invariant: “This suppresses compiler checking without showing who synchronizes the shared mutable cache; please make ownership explicit and add the two-caller regression before merging.” Ask which lifecycle owns the job and what happens after logout. Propose a bounded fix, such as one actor/state owner or an injected lifecycle scope, rather than asking the author to rewrite everything. An unsafe conformance needs a documented synchronization/immutability argument and an accountable reviewer; a deadline is not that argument.

🟩 Strong signal: discusses the code and system conditions without blame, pairs for a focused reproduction, delegates review ownership, and turns the learning into a short checklist and shared example. 🟥 Red flag: silent approval, public shaming, banning concurrency, or making the lead the only reviewer able to merge. Link the review to the contract and test, not the author's seniority.

MTL-19 — Answer

Short answer: Agree on the required safety rules and the smallest useful delivery outcome before comparing implementations. Prefer a decision supported by risk, reversibility, and evidence rather than the loudest preference. If temporary duplication is chosen, give it an owner, a removal condition, and tests so the shortcut remains visible and manageable.

Detailed explanation:

Illustrative decision/debt record gives limited duplication an accountable exit rather than leaving a vague cleanup promise.

YAML
decision: introduce_payment_adapter_for_three_week_experiment
owner: payments_feature_team
required: server_side_validation_before_confirmation
scope: one_payment_method_behind_existing_checkout_contract
debt: temporary_adapter_duplicates_request_mapping
verification: shared_success_retry_and_authorization_contract_tests
revisit_trigger: experiment_decision_or_second_consumer_whichever_first
next_step: consolidate_mapping_if_contract_remains_shared
fallback: reduce_experiment_scope_if_validation_spike_fails

This is a proposed plan; stakeholder agreement and actual spike evidence determine the final scope/date commitment.

Start with payment/security invariants and the experiment's smallest useful outcome. Compare change risk, reversibility, integration effort, and time to evidence. An incremental seam often enables the experiment without a rewrite; limited duplication may be defensible with an owner, removal condition, and tests, but not as invisible debt. Time-box the uncertainty most likely to invalidate delivery. Name a decision owner and communicate any scope/date consequences when evidence changes.

🟩 Strong signal: a debt item states the concrete cost/risk, owner, trigger, and feasible next step; the ADR records rejected options and revisit conditions. Product receives impact and options, while engineers receive boundaries and validation. 🟥 Red flag: endless consensus, authority-only decisions, or a rewrite promise without migration capacity. Practice the disagreement process in Mobile Tech Lead and Architecture.

MTL-20 — Answer

Short answer: Understand one real user journey, its failures, and the people who own it before standardizing frameworks. Agree on shared behavior contracts, establish a baseline, and deliver one bounded improvement with owners on both platforms and the backend. Distribute knowledge and incident responsibility so the improvement lasts beyond the lead’s direct involvement.

Detailed explanation:

Illustrative first-month work contract ties platform ownership to one shared user outcome; it does not prescribe a framework migration.

YAML
journey: checkout_after_session_change
week_1: map_owners_failures_and_existing_release_evidence
week_2: reproduce_late_response_and_duplicate_submit_with_fakes
week_3: ship_bounded_fix_with_android_ios_backend_owners
week_4: review_journey_reliability_and_distribute_follow_up_reviews
shared_contracts: [session_identity, operation_id, cancellation, accessibility]
baseline: collect_before_change_on_representative_devices
review_rotation: primary_and_secondary_owner_per_platform

Record actual findings and measured outcomes as the month progresses; the checklist itself is not evidence of improvement.

Map a real journey, dependency/release flow, incidents, team ownership, and current constraints before mandating patterns. Agree shared contracts for identity, payment outcomes, error/cancellation semantics, analytics privacy, and accessibility outcomes; leave implementation choices local where platform differences justify them. Choose one bounded improvement with an owner on each platform and a backend partner. Establish reproducible baseline measures and a short review cadence, then distribute ownership through pairing, review rotation, and documented release/incident handoffs.

🟩 Strong signal: measures a user outcome alongside delivery/reliability, investigates flaky tests before treating them as release evidence, and defers a broad framework migration until the highest-risk assumptions are tested. 🟥 Red flag: standardizing every class name before understanding the system or measuring leadership by the lead's personal coding volume.

MTL-21 — Answer

Pause expansion until checkout-specific evidence explains the older-device failures; aggregate crash-free sessions cannot establish successful confirmation for exposed users.

Illustrative rollout contract; thresholds must be agreed from the actual product baseline rather than treated as universal safe values.

YAML
journey: checkout_confirmation
owners: [mobile_release_lead, payments_backend, support]
compare_by: [platform, app_version, device_cohort, checkout_exposure]
guardrails: [confirmed_outcome_rate, pending_age, duplicate_orders]
hold_if: unexplained_material_regression_or_missing_evidence
containment: halt_expansion_then_disable_affected_path_if_supported
resume_requires: verified_fix_and_reconciled_pending_operations

Use the population that attempted the journey, with comparable prior/control cohorts and enough observation for delayed outcomes. Track explicit errors, ambiguous pending results, and affected denominators; a small cohort or missing events makes the conclusion uncertain. App version, OS, device capability, and geography may identify a concentrated regression that averages hide. Support reports are evidence to investigate, not noise to discard because a dashboard is green.

The release owner can halt distribution; a feature owner can disable a controlled path only if the installed build supports that switch. Neither action repairs transactions already pending, so a backend owner must reconcile them. A forward release may still be needed. Define the next review time, fallback behavior, and expansion authority before resuming.

🟩 Strong signal: compares exposed cohorts, verifies containment, and treats delayed telemetry conservatively. 🟥 Red flag: choosing an arbitrary rollout percentage as proof of safety or promising a feature flag can undo every installed change.

MTL-22 — Answer

Treat an SDK as an ongoing product, data, and operational dependency with an accountable owner; a successful vendor demo does not justify unrestricted initialization.

Illustrative dependency intake record; review findings and measured results must replace the proposed criteria before adoption.

YAML
dependency: attribution_adapter
owner: mobile_growth_team
activate_only_after: approved_data_policy_and_required_user_choice
evaluate: [incremental_value, outbound_data, startup, energy, failure_modes]
boundary: app_owned_adapter_with_explicit_lifecycle
maintenance: named_upgrade_and_security_review_owner
exit: remove_adapter_and_verify_no_remaining_network_or_storage_use

Inventory collected identifiers, endpoints, retention, subprocessors, local persistence, permissions, and behavior before initialization. Include the relevant privacy/security and commercial owners; do not invent regulatory or licensing conclusions. Test disallowed, allowed, withdrawn, offline, malformed-response, and upgrade paths using synthetic data and observable network/storage behavior. Verify that “disabled” prevents prohibited collection rather than merely hiding an interface.

Keep vendor types out of feature contracts and isolate startup, callbacks, configuration, and teardown in an adapter. Measure the app journey on representative devices, including failure and background behavior, against a baseline without the SDK. Compare the expected incremental product value with maintenance, binary size, energy, accessibility, and removal costs. A server-side integration may reduce client impact but still requires a valid data contract.

🟩 Strong signal: assigns upgrade/removal ownership and tests inactivity. 🟥 Red flag: embedding vendor calls throughout features or assuming consent exists because the app can initialize the library.

MTL-23 — Answer

Keep the first failure visible and synchronize tests on meaningful observable state; longer sleeps and hidden reruns can conceal a real ordering defect.

Illustrative deterministic regression scenario; the fake explicitly controls completion rather than relying on wall-clock delays.

YAML
scenario: receipt_waits_for_confirmed_order
given: submission_response_is_held_by_fake
when: user_submits_then_response_is_released
assert_before_release: accessible_pending_state_without_receipt
assert_after_release: receipt_matches_confirmed_operation
record: [first_attempt_result, rerun_result, failure_category]
quarantine_requires: named_owner_and_review_date

Capture the transition sequence and synthetic fixture identity, then separate app-state publication from server availability, device setup, and test harness failures. The receipt should be observable only after the required domain result; a test can await a labeled screen state or controlled dependency event instead of guessing a duration. Add a smaller state-machine/contract test with response order, cancellation, and failure cases, while retaining a representative end-to-end check.

Reruns help classify intermittency but must not erase its frequency. If temporary quarantine is necessary, document the uncovered risk, owner, expiry/review point, and replacement evidence for release. A production report of the same symptom raises the priority of reproducing the product sequence. Balance a small reliable release suite with broader asynchronous coverage; test count alone is not confidence.

🟩 Strong signal: distinguishes a race from an environment failure with controlled evidence. 🟥 Red flag: labeling every intermittent failure “test flake” after one passing rerun.

MTL-24 — Answer

Model a notification tap as a validated navigation intent, then resolve its destination under the authenticated session before publishing UI state.

Illustrative intent contract; identifiers refer to resources, not authorization grants or cached private order contents.

YAML
intent_type: open_order
fields: [delivery_id, order_id, received_at, expires_at]
owner: app_navigation_coordinator
states: [pending_authentication, resolving, consumed, rejected]
resolve_requires: current_session_and_server_authorization
publication_guard: matching_session_generation_and_active_intent
persist: minimal_pending_intent_only_if_restart_recovery_is_required

Validate the destination kind and resource identifier at ingress. Keep authentication and authorization distinct: signing in does not establish access to the referenced order. After authentication, fetch through the current account's authorized API and handle deleted, unavailable, or forbidden destinations with a useful recovery path. Do not render a previous account's cached order while resolving.

Deduplicate duplicate delivery callbacks within a bounded scope, while allowing a new deliberate tap to reopen the same resource. A consumed destination should not automatically replay after restoration. Persist only the minimum pending intent with expiry and explicit account/session policy; revalidate after restart. Canceling sign-in can discard or retain it according to an explained product rule. The coordinator owns navigation history so authentication does not leave duplicate screens behind.

🟩 Strong signal: tests cold start, duplicate callbacks, account mismatch, and restart during sign-in. 🟥 Red flag: persisting a fully constructed private screen or using an order ID as proof of access.

MTL-25 — Answer

Agree stable identity and server pagination semantics before fixing display duplicates; comparing titles cannot repair missing records or an unstable ordering contract.

Illustrative page contract for a stable snapshot; a live feed may choose a different documented consistency model.

YAML
request_fields: [cursor, snapshot_id, limit]
response_fields: [items, next_cursor, snapshot_id]
item_identity: immutable_server_id
ordering: server_defined_total_order_with_stable_tie_breaker
refresh: new_generation_and_new_snapshot
expired_cursor: explicit_restart_required_result
append_publish_guard: matching_generation_and_expected_cursor

A cursor should encode the server's continuation semantics, not merely rename a page offset. A stable snapshot can preserve a reading session, while refresh deliberately requests a newer view. Stable IDs permit reconciliation of updates and duplicates; they do not recover an item skipped by an inconsistent server boundary. Define treatment of deletions, tombstones, and access changes without claiming the client can infer them.

Give initial load, refresh, and append separate state and failure behavior. A failed append should preserve readable items; a stale response must not overwrite a newer generation or advance the wrong cursor. Preserve scroll position by item identity where feasible, and explain when a reset is necessary. Validate inserts/deletes around page boundaries, equal sort values, cursor expiry, overlapping requests, and refresh completing before an old append.

🟩 Strong signal: makes freshness versus stable reading an explicit product choice. 🟥 Red flag: calling client deduplication a consistency guarantee.

MTL-26 — Answer

Use server-validated revisions and domain-specific conflict rules; device timestamps and whole-object last-write-wins cannot protect a safety-critical field.

Illustrative optimistic-concurrency contract; the server must check the base revision atomically with accepting the change.

YAML
mutation_fields: [operation_id, draft_id, base_revision, changed_fields]
accepted_result: new_server_revision
conflict_result: current_revision_and_permitted_resolution_context
local_owner: account_scoped_draft_and_pending_changes
merge_rules: {notes: domain_review_required, safety_status: explicit_resolution}
retry: reuse_operation_identity_and_original_mutation
delete: versioned_domain_operation_with_conflict_policy

Store the user's unsynced edits and the revision they were based on before sending. The server validates authorization, business rules, and the expected revision; a conflict is a distinct result, not an empty success. Preserve local edits while showing the current permitted server state. Even notes may require review: concatenating text can corrupt meaning or expose information. Independently editable fields may merge only if their invariants permit it.

The feature team owns a comprehensible resolution UI; backend and mobile share the mutation and deletion contract. Bound retries and pending storage, stop on expired authorization, and retain a recoverable draft according to privacy policy. Test two-device interleavings, retry-after-commit, deletion against edits, restart during conflict resolution, and convergence after an explicit resolution. Explain additional complexity before selecting a more elaborate collaborative algorithm.

🟩 Strong signal: preserves intent and makes conflicts visible. 🟥 Red flag: trusting the latest client clock as business authority.

MTL-27 — Answer

Store a confirmed appointment as an authoritative instant plus the domain context needed to explain it; formatted text is presentation and cannot safely carry scheduling meaning.

Illustrative temporal-domain contract; a recurring local rule remains different from an already confirmed appointment.

YAML
confirmed_appointment: [server_id, instant, appointment_time_zone]
recurring_intent: [local_date_time_rule, time_zone_id, ambiguity_policy]
date_only_value: calendar_date_without_invented_time_of_day
authority: booking_server_validates_availability_and_final_instant
ui: show_zone_and_confirm_resolution_of_ambiguous_input
tests: [injected_clock, explicit_zone, transition_boundary, zone_change]
reminder: reconcile_against_confirmed_server_booking

A local date and wall-clock time can map to no instant or more than one during clock transitions. Require an explicit product policy and user clarification where necessary instead of silently shifting a booking. A recurring “local morning” rule and an elapsed-duration deadline need different models; converting both into one string loses intent. Do not use a device wall clock as authoritative evidence of a server-side expiry.

The scheduling owner defines conversion and reminder policy, the backend confirms availability, and the UI formats for the user's locale while identifying the appointment's relevant zone. After travel or a zone change, distinguish a changed display from a changed booking. Tests should use fixed instants and explicit zone rules, including ambiguous/nonexistent input and changed reminders. Avoid asserting that local notification scheduling guarantees delivery at an exact instant.

🟩 Strong signal: asks whether the domain means an instant, date, or recurring rule. 🟥 Red flag: parsing a localized label back into the canonical booking.

MTL-28 — Answer

Persist upload intent and reconcile a server-owned upload session before retransmitting; bytes sent are not proof that the report attachment was finalized.

Illustrative upload record and protocol outline; exact transport and background mechanisms depend on platform requirements.

YAML
local_record: [operation_id, account_id, report_id, file_reference, digest]
server_session: [upload_id, accepted_parts, expiry, expected_integrity]
states: [queued, uploading, finalizing, confirmed, blocked, canceled]
finalize: authenticated_idempotent_operation_binding_file_to_report
unknown_result: query_session_and_attachment_status
cleanup: remove_local_file_only_under_documented_retention_policy
budget: bounded_concurrency_storage_and_retry_attempts

One durable owner manages the file reference, immutable content identity, progress checkpoints, and cancellation. The backend validates account/report authorization, accepted chunks, final integrity, and finalization atomically enough to avoid a false completed attachment. If acknowledgment is lost, query authoritative status with the same operation identity. Do not assume canceling transport reverses finalization.

The file must remain available while retry is allowed. A missing file becomes a recoverable blocked state; an expired session requires a defined restart/reuse policy, not an endless retry. Logout invalidates access and prevents cross-account publication; decide whether retained encrypted local work may later resume under the same authorized account. Limit simultaneous transfers, disk consumption, and retry energy. Validate process interruption after each stage, chunk mismatch, low disk space, credential expiry, cancellation, and timeout after finalization using synthetic media.

🟩 Strong signal: distinguishes local progress, accepted bytes, and confirmed business completion. 🟥 Red flag: deleting the only source file when the progress bar reaches 100%.

MTL-29 — Answer

Stabilize assignment and measure actual exposure before interpreting conversion; a variant reassigned on every render does not define a coherent experiment.

Illustrative experiment contract; this describes a proposed measurement plan, not reported results.

YAML
assignment_unit: documented_stable_eligible_subject
assignment: persisted_with_experiment_version
exposure: eligible_variant_ui_successfully_presented
primary_outcome: verified_onboarding_completion
guardrails: [accessibility_completion, errors, latency, abandonment]
identity_transition: predefined_policy_without_silent_reassignment
stop_owner: experiment_owner_with_mobile_quality_partner

Specify eligibility, assignment unit, version, allocation, primary outcome, and decision criteria before launch. Anonymous-to-account transitions require a deliberate continuity or exclusion policy; silently switching variants changes both experience and interpretation. Exposure should reflect the agreed visible capability, not construction of an unused screen model. Deduplicate queued events with bounded retention, while preserving occurrence and delivery distinctions; missing offline events can still bias evidence.

Minimize identifiers and payloads, honor the applicable data policy, and use synthetic accounts to validate assignment, rendering, and completion independently. Segment by app/version and capability where implementation differs; confirm that exposure denominators align with the actual outcome population. A product improvement must be weighed against reliability and accessibility guardrails. The experiment owner interprets evidence with engineering/data partners, while an identified quality owner can stop harmful behavior.

🟩 Strong signal: tests identity transitions and reconciles analytics with domain outcomes. 🟥 Red flag: treating a favorable dashboard as causal proof despite unstable assignment or broken guardrails.

MTL-30 — Answer

Expose deletion as an explicit lifecycle with verified stages; a timed-out request cannot honestly become a claim of globally completed deletion.

Illustrative deletion workflow contract; retention and access requirements need the organization's responsible privacy/legal owners.

YAML
states: [requested, accepted, processing, completed, action_required]
request: authenticated_idempotent_deletion_operation
status: server_authoritative_deletion_receipt
mobile_containment: revoke_local_access_and_stop_pending_writes
queues: discard_or_block_account_work_under_reviewed_policy
retention: documented_categories_purposes_and_owners
evidence: opaque_operation_id_and_stage_without_content_payloads

The backend owns authoritative deletion processing and status; mobile owns local access, derived caches, session teardown, and stopping uploads or queued work that could reintroduce data. Privacy/product owners define the user promise, retained categories, exceptions, and communication. Distinguish revoking immediate access from physically removing every representation, including backups. Do not invent a universal retention deadline or guarantee control over independently exported copies.

If acceptance is ambiguous, reconcile by operation ID rather than issuing unrelated requests or claiming success. An offline device cannot receive an immediate command; local expiry/re-authentication policy and server rejection of revoked sessions bound its behavior. On reconnection it must clear or quarantine obsolete work before sync. Validate timeout-after-acceptance, queued writes, multiple devices, logout/reinstall, and partial processing with synthetic accounts. Give the user a safe status/recovery path without restoring private content just to display it.

🟩 Strong signal: separates access revocation, processing, retention, and confirmed completion. 🟥 Red flag: using a local cache wipe as proof of server-wide deletion.

MTL-31 — Answer

Make validation errors discoverable while preserving the user's interaction context; asynchronous responses must not seize focus or announce obsolete errors.

Illustrative accessibility interaction contract; verify actual platform behavior with assistive technology rather than assuming the record implements it.

YAML
submit_failure: error_summary_with_links_to_invalid_fields
field_error: programmatic_label_and_error_association
background_validation: announce_relevant_change_without_forced_focus
stale_result: reject_if_input_or_request_generation_changed
focus_owner: feature_interaction_state
repeat_announcement: suppress_unchanged_message
coverage: [screen_reader, external_keyboard, large_text, interrupted_request]

Keep logical reading and keyboard order aligned with the task. After an explicit failed submit, place or guide focus to a useful summary/first invalid field according to the platform's interaction conventions, while preserving entered values. Background checks should associate errors with the field and announce a meaningful status only when relevant; they should not reset focus on each response. A corrected field must not regain an old error because an earlier request finishes late.

The feature owns focus intent, request generation, and error identity. Reusable controls supply semantics and layout support without independently competing for focus. Test completing and correcting the whole journey with a screen reader, keyboard, large text, and a small viewport. Include pending state, repeated errors, navigation away, and a late result. Human checks must examine comprehension and recovery, not just the presence of labels.

🟩 Strong signal: validates focus continuity and nonvisual recovery. 🟥 Red flag: considering accessibility complete because every view has an accessibility label.

MTL-32 — Answer

Keep canonical amounts and domain meaning separate from localized presentation; translated display strings must never become the source of financial calculations.

Illustrative localization review contract; locale-specific resources and formatter behavior still require implementation and native-language review.

YAML
business_value: amount_with_currency_and_documented_precision
presentation: locale_aware_formatter_and_complete_message_resource
parsing: dedicated_validated_input_path_not_display_round_trip
message_context: actor_action_direction_and_domain_examples
layout_checks: [long_text, right_to_left, mixed_direction_identifiers]
critical_review: native_language_financial_meaning_and_accessibility
icon_mirroring: semantic_direction_review_per_symbol

The domain/backend contract owns currency, permitted precision, rounding points, and authoritative totals; the UI formats those values for reading. Avoid binary floating-point assumptions for money and do not silently infer currency from locale. Use complete parameterized messages and plural rules rather than concatenated fragments so word order and grammatical context can change safely. Describe who pays, receives, refunds, or owes in translator context and reviewed examples.

Right-to-left support requires semantic ordering and correct handling of mixed-direction identifiers; not every icon has a direction that should mirror. Validate long strings, wrapping, truncation, accessible names, and action reachability. Pseudolocalization helps expose expansion and hard-coded text but cannot prove a refund message is correct. Combine automated resource checks with native-language/domain review and interaction tests. Share stable semantic contracts across platforms while allowing their presentation implementations to differ.

🟩 Strong signal: tests meaning, values, and usability together. 🟥 Red flag: using screenshot parity as evidence that translated monetary behavior is safe.

MTL-33 — Answer

Bound recommendation work and protect checkout capacity; multiplying independent retries can turn one slow dependency into a broader user-journey outage.

Illustrative reliability policy; budgets and thresholds must be chosen from measured service and product constraints.

YAML
dependency: recommendations
retry_owner: one_designated_network_or_domain_layer
limits: [end_to_end_deadline, concurrency, attempt_budget, queue_size]
retry_only: transient_failure_and_safe_operation_with_remaining_budget
backoff: bounded_with_jitter_and_server_guidance
isolation: preserve_capacity_for_checkout
fallback: cached_or_unavailable_recommendations_with_honest_freshness

Calculate the effective attempt count across layers and user actions. Propagate a journey deadline so nested calls cannot each consume a fresh full timeout. Cancel work when its owner ends, avoid retrying permanent authorization/validation failures, and reuse business operation identity where a write is retryable. A transport failure alone does not prove an operation was uncommitted.

The networking/service owners agree admission and retry policies; the feature owner defines an optional degraded experience that does not block checkout. Consider separate concurrency budgets and priority-aware scheduling, while validating actual shared-resource behavior. Observe journey completion, queue delay, pending age, retry volume, and dependency saturation. A per-device circuit breaker can reduce repeated local work but cannot coordinate a global retry storm; server protection and staggered recovery remain necessary. Test slow responses, overload guidance, cancellation, and recovery under bounded concurrent load.

🟩 Strong signal: counts amplification and isolates critical work. 🟥 Red flag: increasing timeouts and retries everywhere without an end-to-end budget.

MTL-34 — Answer

Activate only a fully validated configuration supported by the current client; fetch failure should not turn unrelated safe settings into a partial or empty state.

Illustrative configuration envelope and acceptance policy; the application must implement strict decoding and cross-field checks.

YAML
envelope_fields: [schema_version, revision, targeting, expires_at, settings]
validation: [types, bounds, allowed_routes, cross_field_invariants]
activation: atomic_after_complete_validation
unsupported_schema: retain_compatible_last_known_good_or_safe_default
fetch_failure: preserve_policy_per_setting_without_partial_activation
audit: [author, reviewer, revision, activation, revocation]
preflight: representative_supported_client_capabilities

Separate retrieval, decoding, validation, staging, and activation. A negative resource budget or unsupported payment route must fail before use. Define whether unknown fields are safely ignorable or indicate an incompatible schema. Capability targeting helps avoid invalid deliveries, but each client still validates its own input. Persist an accepted revision atomically and keep a compatible last-known-good value.

Staleness is domain-specific: a cosmetic setting may tolerate old values while an expired authorization-related decision must fail conservatively and still depend on server enforcement. Define offline behavior and recovery rather than treating all configuration as one immortal blob. A configuration owner and reviewer control activation/revocation, with traceable revisions and access limits. Test malformed types, oversized values, unsupported routes, clock uncertainty around expiry, interrupted persistence, and rapid revision changes.

🟩 Strong signal: validates combinations and tests older capabilities. 🟥 Red flag: assuming remote configuration is trusted executable authority because its editor is internal.

MTL-35 — Answer

Give the platform team a bounded product mission with self-service consumers and contribution paths; routing every feature change through it creates coordination cost rather than shared value.

Illustrative platform capability contract; review targets against observed team needs rather than adopting them as a universal organization chart.

YAML
capability: mobile_build_and_release_foundation
owner: platform_team
consumer_contract: documented_inputs_outputs_versions_and_support_boundary
self_service: templates_diagnostics_and_supported_upgrade_path
contributions: feature_team_changes_with_named_maintainer_review
measure: [consumer_wait_time, task_success, adoption, maintenance_cost]
review: retire_or_revise_capabilities_without_clear_consumer_value

Centralize foundations where shared reliability, security, or specialist maintenance creates value; keep product-specific behavior with the team that owns its outcomes. Distinguish a supported platform API from an internal implementation and a reusable example. Establish response expectations for incidents versus routine changes, maintain backward-compatible adoption paths, and give consumers useful diagnostics. Optional local implementations may be reasonable where the shared abstraction no longer fits, with explicit consequences.

Measure waiting, successful self-service completion, onboarding friction, change failure, and time spent maintaining the platform alongside adoption. High adoption forced by policy is not proof of usefulness. Use consumer feedback and a limited pilot to choose investments. Spread maintenance and review knowledge through contributions and secondary owners without requiring the platform team to approve every product decision.

🟩 Strong signal: evaluates consumer outcomes and removes unnecessary gates. 🟥 Red flag: measuring success only by tickets closed or number of shared modules created.

MTL-36 — Answer

Retire the old router only after every supported entry point and side effect has an explicit owner and verified replacement; more unit tests do not establish migration completeness.

Illustrative retirement contract; attach the actual entry-point inventory and evidence before making the deletion decision.

YAML
migration: legacy_router_to_coordinator
inventory: [notification, deep_link, restored_state, in_app_navigation, support_link]
dispatch: one_selected_handler_per_intent
side_effect_owner: new_coordinator_after_route_cutover
observe: coarse_route_kind_and_handler_without_private_url_payload
retire_requires: contract_coverage_and_verified_supported_entry_cutover
fallback: bounded_compatible_path_with_explicit_removal_trigger

Put a single routing seam before either implementation so only one handler owns navigation and analytics for a given intent. Catalog old links, restoration formats, redirects, and callers outside the current feature code. Maintain required compatibility and document deliberate behavior changes separately; preserving a bug is not automatically a parity requirement, but changing it still needs an owner and validation.

Use shared contract fixtures for authentication, back behavior, unsupported destinations, cancellation, and analytics. Compare controlled outcomes, then stage routing changes with a bounded fallback. Telemetry should identify handler usage without recording private URLs; verify collection and coverage using synthetic traffic before interpreting an absence of events. Define an observation window and supported-client/entry-point criteria. Remove adapters, flags, documentation, and obsolete tests together once evidence supports retirement.

🟩 Strong signal: tests overlooked external entry points and prevents double handling by construction. 🟥 Red flag: deleting legacy code because its traffic chart is empty while the tracking path is unverified.

MTL-37 — Answer

Protect every representation through account-scoped ownership and access revocation; encrypting one database does not secure orphaned files, derived indexes, or late preview results.

Illustrative local-data inventory and teardown contract; protection mechanisms depend on the reviewed device and application threat model.

YAML
representations: [document, thumbnail, search_index, temporary_preview, queued_export]
owner: authenticated_account_storage_scope
access: explicit_offline_unlock_and_session_policy
logout: invalidate_generation_then_revoke_access_and_apply_cleanup
derived_work: cancel_and_reject_late_publication
keys: documented_creation_access_rotation_and_retirement
verification: synthetic_account_switch_and_storage_inventory

Identify who can access an unlocked device, what offline use the product permits, and which data must remain available. Design key/file lifetimes, protection classes or equivalent controls, temporary-file handling, and cleanup under those constraints. Logical deletion of an index entry is different from denying file access or removing data. Key destruction may be useful under the chosen design, but it is not a universal claim about backups or exported copies.

Logout should immediately clear visible sensitive state, invalidate session generations, stop derived tasks, and prevent old work from publishing. Apply the documented retention/deletion policy to all representations and handle cleanup failure explicitly. Test synthetic documents across previews, backgrounding, interruption, account switching, locked/unavailable storage, and restart. Include supported backup/restore behavior and disclosure of copies the app does not control.

🟩 Strong signal: inventories derived data and verifies revocation before cosmetic cleanup. 🟥 Red flag: treating an empty list or encrypted primary store as proof that the account's data is inaccessible.

MTL-38 — Answer

Coalesce refresh within one session generation and guard publication against session replacement; a shared task prevents duplicate work but cannot alone prevent an old credential from taking over a new session.

Illustrative refresh coordination contract; storage and server rotation semantics must be specified by the authentication implementation.

YAML
refresh_key: session_generation_and_credential_revision
owner: authenticated_session_coordinator
waiters: share_one_refresh_result_for_that_key
publication: compare_session_and_revision_before_atomic_update
individual_cancellation: stop_waiting_without_canceling_other_waiters
logout: invalidate_generation_and_prevent_late_publication
replay: bounded_once_after_refresh_only_if_operation_contract_allows

Classify unauthenticated, forbidden, invalid refresh credentials, transient transport failure, and unavailable storage distinctly. Do not refresh on every authorization failure or create an infinite refresh/replay loop. The session owner decides when credentials are definitively invalid and clears state; a transient network failure may instead leave the user in a recoverable unavailable state. Protect credentials from logs and keep persistence updates consistent with rotation.

Requests capture their session identity and may publish only if it remains current. A waiter leaving one screen need not cancel refresh for unrelated requests; logout invalidates the shared owner regardless. Replaying a read differs from replaying a write that may already have committed, so business idempotency remains separate. Test simultaneous expiry, canceled waiters, logout/relogin, refresh failure, credential rotation, and an old refresh completing after a new session begins.

🟩 Strong signal: tests session replacement during refresh. 🟥 Red flag: using a process-global refresh promise with no account or revision guard.

MTL-39 — Answer

Bind release approval to a traceable artifact and its controlled transformations; rebuilding with floating inputs breaks the connection between QA evidence and the distributed application.

Illustrative release evidence record; signing and store-processing details require the project's actual distribution workflow.

YAML
build_identity: [source_revision, resolved_dependencies, toolchain, configuration]
artifact_identity: cryptographic_digest_of_retained_build_output
evidence: [test_results, review, dependency_record, build_logs]
promotion: same_approved_artifact_or_recorded_verified_transformation
signing: restricted_job_identity_and_scoped_secret_access
publication: approval_bound_to_release_record
failure: halt_and_reestablish_identity_before_distribution

Resolve and record inputs, keep sensitive environment values out of logs, and retain the approved output plus relevant evidence. Separate build, test, signing, and publication capabilities so ordinary jobs cannot impersonate a release. A version string is a label, not an integrity proof. Where signing or platform processing transforms bytes, retain a verified mapping between the input, transformation, and resulting identifiers instead of demanding an impossible identical final hash at every stage.

Reproducible builds can help detect unexplained input/output differences, but reproducibility alone does not establish safe source, trustworthy dependencies, or correct behavior. If provenance breaks, stop promotion, investigate the divergence, rebuild under controlled inputs if necessary, and repeat evidence tied to that output. Practice tracing an installed release back to its record and audit who could alter each step.

🟩 Strong signal: verifies artifact identity through legitimate transformations. 🟥 Red flag: equating a matching marketing version with the exact reviewed build.

MTL-40 — Answer

Keep provider credentials and tool authority on the backend, minimize transmitted account data, and treat model output and retrieved text as untrusted inputs.

Illustrative mobile AI request contract; this is a design boundary rather than a runnable provider integration.

YAML
mobile_request: [request_id, session_generation, user_intent, permitted_document_ids]
backend: authenticate_authorize_retrieve_minimize_and_enforce_budget
model_output: validated_typed_draft_without_authority
tool_execution: server_authorization_and_required_user_confirmation
limits: [deadline, input_size, output_size, calls, cost, concurrency]
publication: matching_current_session_and_request_generation
audit: opaque_ids_action_decision_and_usage_without_raw_document_text

Authorize each document and action server-side; a retrieved paragraph cannot grant permissions or override the user's intent. Send only required content under the approved data policy. Validate structured output against a schema and domain constraints before displaying or acting on it. A support-request draft can be reviewed locally; committing an external action requires the applicable current user authorization and an idempotent backend contract, not a model's claim that approval exists.

The session-owned feature controls streaming state, cancellation, and stale-result rejection. Backend deadlines and budgets still apply after a screen disappears; canceling UI work does not prove a server action was reversed. Evaluate grounding, uncertainty, and task usefulness separately from unauthorized-action prevention and privacy failures. Test injected document instructions, account switches, provider timeouts, invalid output, and duplicate submission. Offer normal document browsing or a conventional support form when unavailable.

🟩 Strong signal: separates generated advice from authorized effects. 🟥 Red flag: embedding credentials in the client or trusting retrieved text as a tool instruction.

Key Takeaways

  • Encapsulation protects meaningful invariants; a private property or computed getter alone does not establish them.
  • Overloading, overriding, protocol requirements, and extensions have different dispatch contracts. Review and test through the abstraction clients actually use.
  • Actors and main-thread/state-holder ownership can prevent data races while still allowing stale results and broken business sequences across suspension.
  • Cross-platform parity belongs in user outcomes and contracts, including errors, cancellation, identity, retries, accessibility, and privacy.
  • A mobile lead makes correctness, ownership, evidence, migration, and communication concrete while enabling others to own decisions.

Source and availability notes

Official primary documentation linked in the answer key was checked on 22 October 2026. Questions and assessment signals are independently authored. The links verify language dispatch, actor reentrancy, coroutine cancellation/lifetimes, and modularization semantics; the scenario-specific designs and rubric are study guidance. This bank does not assert a particular Swift 6.4 feature set, compiler result, interview format, or certification affiliation.