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
A containerized web service must run continuously and handle long-lived connections, with no servers to manage. Which serverless option fits?
- AWS Lambda
- AWS Fargate
- Amazon EC2
- 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
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