Medium👤 3-5 years👤 8-15 years 1 min read

Why use an ExecutorService instead of new Thread(), and which pool type do you pick?

Asked inAmazonMicrosoftCognizantWipro
#executorservice#thread pool#executors#newfixedthreadpool
Report issue

⚡ Short Answer

Pools reuse threads (creating threads is expensive), bound concurrency, and decouple task submission from execution. Pick fixed pools for CPU-bound work (size ≈ cores), bounded pools for I/O — and avoid Executors.newCachedThreadPool / newFixedThreadPool defaults in prod due to unbounded queues/threads.

Coffee Chat Question

Concept Made Simple

Why use an ExecutorService instead of new Thread(), and which pool type do you pick?

🧠Mind Map Answer

Remember It Faster

fixedCPU-bound, size ≈ #cores
cachedunbounded threads — risky
singleserialize tasks
Preferexplicit ThreadPoolExecutor

🔥What If?

Think Beyond the Expected

Why do many teams ban Executors.newFixedThreadPool / newCachedThreadPool in production?

newFixedThreadPool uses an UNBOUNDED LinkedBlockingQueue (tasks pile up → OOM), and newCachedThreadPool can spawn unbounded threads under load. Teams build a ThreadPoolExecutor with an explicit bounded queue and rejection policy instead.

😂Real World

Almost every service uses a configured ThreadPoolExecutor (or framework-managed pool) with bounded queues so a traffic spike degrades gracefully (rejections) instead of OOM-ing.

🎯Interviewer's Expectation

Keywords they're listening for:

thread reusebounded concurrencyfixed for CPU / pool sizingunbounded-queue OOM riskexplicit ThreadPoolExecutor

⚠️Common Mistakes

  • Using new Thread() per task
  • newFixedThreadPool with unbounded queue in prod
  • Never calling shutdown()

Best Practices

  • Configure ThreadPoolExecutor with a bounded queue
  • Size pools to workload (CPU vs I/O)
  • shutdown()/awaitTermination on stop

🔁Follow-up Questions

  • 1How do you size a pool for I/O-bound vs CPU-bound work?
  • 2What queue + rejection policy do you choose?
  • 3How do you shut a pool down cleanly?

🧩Related Technologies

ThreadPoolExecutorExecutorsBlockingQueue

Continue Learning with AI

Take this question deeper with your favourite AI assistant. Pick a depth, copy the prompt, or open it directly — AI is your learning companion, not a shortcut.

Plain-language foundations

I'm preparing for a software engineering interview and want to understand this from scratch, as a beginner.

Topic: Threads & Pools (Multithreading)
Interview question: "Why use an ExecutorService instead of new Thread(), and which pool type do you pick?"

Please:
1. Explain the core idea in simple, plain language, using an everyday analogy.
2. Define any technical terms you use.
3. Walk through one small, concrete example.
4. Finish with a single sentence I can easily remember.

Keep the tone friendly and assume I'm new to this topic.
Open inChatGPTGeminiClaude

Was this answer helpful?

Support our platform by exploring our recommended products.

As an Amazon affiliate, purchases through these links may earn us a small commission — at no extra cost to you. It helps keep Full Stack Interview Guru free.

Related Questions