Asynchronous and Event-Driven Programming Questions

The programming model of a single asynchronous runtime: callbacks, promises and futures, async/await, event loops and task/microtask scheduling (including microtask starvation and where rendering fits), reactive streams and back-pressure, and how ordering, cancellation, timeouts, retries and error propagation behave across JavaScript, Node.js, mobile coroutine or async runtimes, and a comparison with Python asyncio and Java futures. Includes the async mechanics of a data fetch such as parallel versus sequential requests, partial failure, stale or out-of-order responses, abort, debounced live search, single-flight token refresh, and bounded concurrency; wrapping callback APIs as promises, streaming work through async consumers, moving heavy work off the main thread and back, and diagnosing unhandled rejections, race conditions and leaked subscriptions. Excludes message-queue and pub/sub system design, server throughput and thread-pool tuning, per-language threading and memory models, rebuilding standard APIs from scratch, and fetch caching or state architecture.

EasyTechnical
55 practiced

A screen freezes whenever a heavy piece of work runs on the main thread. How would you fix that on the web, Android and iOS, and how does the result get back onto the UI safely on each platform?

MediumTechnical
90 practiced

A phone streams sensor readings at a high rate. You must transform them off the main thread, keep memory bounded when processing falls behind, and hand finished batches to the UI with low latency. Build this as a reactive pipeline in RxSwift, RxKotlin or Flow and explain what you chose at each stage and why.

MediumTechnical
51 practiced

A mobile search field fires a network request as the user types. Using Swift concurrency or Kotlin coroutines, how do you wait for a pause in typing, make sure an older in-flight search cannot overwrite a newer one, and update the UI only on the main thread? Show the code.

HardSystem Design
47 practiced

A mobile app has data sources that produce events faster than the UI can use them. Design how reactive streams (RxSwift/RxJava or Kotlin Flow) move that data: which work runs on background threads, how results reach the main thread, what you do when the producer outruns the consumer, and how errors and long-running operations are handled.

That is every published Asynchronous and Event-Driven Programming question for Mobile Developer so far. Browse the other topics in this category, or practice this one interactively.