Both are serverless compute, but they suit different workloads, and the exam tests the choice based on runtime shape and packaging.

Functions vs containers

Lambda runs short, event-driven functions (max 15 minutes), scaling instantly to zero — great for sporadic tasks and event processing. Fargate runs containers that can run continuously and use any runtime, with no 15-minute cap — great for long-running services or existing containerized apps. Event-driven short tasks → Lambda; long-running containers → Fargate.

Test yourself

Practice question

A containerized web service must run continuously and handle long-lived connections, with no servers to manage. Which serverless option fits?

  1. AWS Lambda
  2. AWS Fargate
  3. Amazon EC2
  4. AWS Batch
👉 Click to reveal the answer & explanation

Correct answer: B. Fargate runs containers serverlessly with no runtime cap — ideal for continuous, long-running services. Lambda (A) caps at 15 minutes and is event-driven; EC2 (C) means managing servers; Batch (D) is for batch jobs.

Related topics

AWS Lambda · Fargate vs EC2 · ECS vs EKS vs Fargate

CloudExamPro Premium

Ready to pass your AWS exam?

Stop guessing whether you’re ready. Our full-length, exam-realistic practice exams put you through the exact question style you’ll face — with a detailed explanation behind every answer, so you learn why, not just what.

  • ✓  6 full-length practice exams
  • ✓  A detailed explanation for every single question
  • ✓  Realistic, scenario-based questions — not memory dumps
  • ✓  Lifetime access, kept current for 2026

See the Practice Exam Packs →

Limited-time offer · ends in --Days:--Hrs:--Min:--Sec
Get Instant Access