Bird
Raised Fist0
AWScloud~20 mins

Services and tasks in AWS - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Cloud & Infrastructure Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ service_behavior
intermediate
2:00remaining
Understanding AWS Lambda Execution Model
What happens when an AWS Lambda function is invoked multiple times concurrently?
AAWS Lambda creates multiple instances of the function to handle concurrent invocations.
BAWS Lambda queues the invocations and runs them one by one on a single instance.
CAWS Lambda runs all invocations on the same instance simultaneously using threads.
DAWS Lambda rejects concurrent invocations and returns an error.
Attempts:
2 left
💡 Hint
Think about how serverless functions scale with demand.
❓ Architecture
intermediate
2:00remaining
Choosing the Right AWS Storage Service
You need to store large amounts of unstructured data that must be accessed frequently and support high throughput. Which AWS service is best suited for this?
AAmazon S3
BAmazon EBS
CAmazon RDS
DAmazon DynamoDB
Attempts:
2 left
💡 Hint
Think about object storage designed for scalability and throughput.
❓ security
advanced
2:30remaining
IAM Role Permissions for EC2 Accessing S3
An EC2 instance needs to read objects from a specific S3 bucket. Which IAM policy snippet correctly grants this permission with least privilege?
A{"Effect": "Allow", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::*"}
B{"Effect": "Allow", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::example-bucket/*"}
C{"Effect": "Allow", "Action": "s3:ListBucket", "Resource": "arn:aws:s3:::example-bucket"}
D{"Effect": "Allow", "Action": "s3:*", "Resource": "*"}
Attempts:
2 left
💡 Hint
Least privilege means only allow what is necessary.
❓ Configuration
advanced
2:30remaining
Configuring Auto Scaling Group with Load Balancer
Which configuration ensures that an Auto Scaling group launches instances that are automatically registered with an Application Load Balancer?
AUse a Network Load Balancer instead of ALB.
BManually register instances to the ALB after launch.
CConfigure the ALB to use static IPs of instances.
DAttach the ALB target group to the Auto Scaling group during creation.
Attempts:
2 left
💡 Hint
Think about automation and integration between services.
✅ Best Practice
expert
3:00remaining
Designing Highly Available Multi-Region Architecture
You want to design a web application that remains available even if an entire AWS region goes down. Which architecture approach best achieves this?
ADeploy the application in multiple Availability Zones within a single region.
BDeploy the application in a single region and use CloudFront CDN for caching.
CDeploy the application in multiple regions with active-active traffic routing using Route 53 latency-based routing.
DDeploy the application in multiple regions but route all traffic to a primary region.
Attempts:
2 left
💡 Hint
Consider how to handle region-wide failures and traffic distribution.

Practice

(1/5)
1. What is the main role of a service in AWS when managing your app tasks?
easy
A. To define the resources and containers for the app
B. To keep the app tasks running and replace them if they fail
C. To store data for the app
D. To monitor network traffic

Solution

  1. Step 1: Understand what a service does

    A service manages running copies of your app tasks and ensures they stay running.
  2. Step 2: Compare with other options

    Defining resources and containers is the task's role, not the service's. Storing data and monitoring traffic are unrelated.
  3. Final Answer:

    To keep the app tasks running and replace them if they fail -> Option B
  4. Quick Check:

    Service manages tasks = B [OK]
Hint: Services keep tasks running and replace failed ones [OK]
Common Mistakes:
  • Confusing service with task definition
  • Thinking service stores data
  • Assuming service monitors network
2. Which of the following is the correct way to define a task in AWS ECS?
easy
A. A database schema for app data
B. A YAML file listing EC2 instances
C. A JSON file specifying containers, CPU, and memory
D. A script to launch EC2 instances

Solution

  1. Step 1: Identify task definition format

    A task in AWS ECS is defined by a JSON file that specifies containers, CPU, and memory requirements.
  2. Step 2: Eliminate incorrect options

    YAML listing EC2 instances is not a task definition. Scripts to launch EC2 or database schemas are unrelated.
  3. Final Answer:

    A JSON file specifying containers, CPU, and memory -> Option C
  4. Quick Check:

    Task definition = JSON file with containers [OK]
Hint: Task definitions use JSON to specify containers and resources [OK]
Common Mistakes:
  • Confusing task definition with instance listing
  • Using scripts instead of JSON for tasks
  • Mixing database schemas with task definitions
3. If you create a service with a desired count of 3 tasks, but one task fails, what will AWS ECS do?
medium
A. Replace the failed task to maintain 3 running tasks
B. Stop all tasks and alert the user
C. Ignore the failure and keep 2 tasks running
D. Scale down the service to 2 tasks

Solution

  1. Step 1: Understand service desired count behavior

    The service tries to keep the number of running tasks equal to the desired count.
  2. Step 2: What happens on task failure?

    If a task fails, the service replaces it to maintain the desired count of 3 tasks.
  3. Final Answer:

    Replace the failed task to maintain 3 running tasks -> Option A
  4. Quick Check:

    Service maintains desired count = A [OK]
Hint: Service replaces failed tasks to keep desired count [OK]
Common Mistakes:
  • Thinking service stops all tasks on failure
  • Assuming service ignores failures
  • Believing service scales down automatically
4. You defined a task with 512 MB memory but your service fails to start tasks due to insufficient resources. What is the likely problem?
medium
A. The container image is missing
B. The task definition JSON is invalid
C. The service desired count is set to zero
D. The cluster has no available memory to run the task

Solution

  1. Step 1: Analyze the error cause

    Insufficient resources usually mean the cluster lacks enough memory to run the task.
  2. Step 2: Check other options

    Invalid JSON or zero desired count would cause different errors. Missing image causes container start failure, not resource error.
  3. Final Answer:

    The cluster has no available memory to run the task -> Option D
  4. Quick Check:

    Insufficient resources = cluster memory shortage [OK]
Hint: Check cluster memory before blaming task definition [OK]
Common Mistakes:
  • Assuming JSON syntax error causes resource failure
  • Ignoring cluster resource limits
  • Confusing desired count zero with resource shortage
5. You want to run a web app that scales automatically based on CPU usage. Which combination should you use in AWS ECS?
hard
A. Create a service with a task definition and enable auto scaling on the service
B. Create only tasks without a service and manually start more tasks
C. Use EC2 instances without ECS to run containers
D. Create a service but disable task definitions

Solution

  1. Step 1: Identify components for scaling

    A service manages tasks and can be configured with auto scaling based on CPU.
  2. Step 2: Evaluate other options

    Running tasks without a service lacks auto scaling. Using EC2 alone misses ECS benefits. Disabling task definitions is invalid.
  3. Final Answer:

    Create a service with a task definition and enable auto scaling on the service -> Option A
  4. Quick Check:

    Service + task + auto scaling = C [OK]
Hint: Use service with auto scaling for CPU-based scaling [OK]
Common Mistakes:
  • Skipping service and expecting auto scaling
  • Confusing EC2 usage without ECS
  • Disabling task definitions breaks deployment
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard