Threads, Executors & Thread Pools

KOTLIN › JVM Concurrency

What coroutines run on: thread cost, ExecutorService, pool sizing, and why Future.get blocking drove everything since.

Coroutines multiplex onto thread pools rather than replacing them, so interviewers who have been doing this a while probe the layer underneath. Expect to explain what a thread actually costs, how to size a pool for CPU-bound versus IO-bound work, and why ThreadPoolExecutor queues before it grows, which makes maximumPoolSize dead configuration with an unbounded queue. Strong answers connect the formulas to why Dispatchers.Default caps at the core count and IO at 64, and can trace the line from Future.get blocking through CompletableFuture to coroutines.

What this covers

Study this topic

Further reading