AWS Developer Scenario Based Interview Questions: Design, Debugging, Security and Optimization

AWS Developer Associate 55 min min read Updated: Nov 17, 2026 Advanced
AWS Developer Scenario Based Interview Questions: Design, Debugging, Security and Optimization
Advanced Topic 2 of 3

Method for Scenario Questions

  1. Restate the goal and ask about scale, latency, consistency, security and budget
  2. Draw the flow (client, edge, compute, data, events)
  3. Choose services and say why
  4. Address failure, security, monitoring and cost
  5. Mention testing and deployment

Design Scenarios

Q1. Users upload photos and you must create thumbnails. How do you design it?

The client asks the API for a presigned POST URL (with size and type limits) and uploads straight to S3. An S3 event notification goes to SQS (or EventBridge) and a Lambda function reads the original, creates the thumbnail and writes it to another bucket or prefix, with metadata in DynamoDB. Use a different prefix or bucket for outputs to avoid recursion, a DLQ for failures, and CloudFront to deliver images.

Q2. Design a REST API for a mobile app with 50,000 users that scales automatically.

Cognito for sign-in, API Gateway (HTTP API) with a JWT authorizer, Lambda for logic, DynamoDB on-demand for data, S3 for media, and CloudWatch with X-Ray for observability. Add WAF and throttling, validate input, use idempotency keys for creates, and deploy with SAM through a pipeline using canary releases.

Q3. A checkout needs payment, stock and shipping steps that can fail. How do you keep data consistent?

Use a Step Functions workflow with retries for transient errors and Catch states that run compensating steps (refund, release stock). Make each step idempotent with the order id. Write the order and an outbox record in one DynamoDB transaction so no event is lost.

Q4. How would you send real-time notifications to thousands of web clients?

Use AppSync subscriptions or API Gateway WebSocket APIs, backed by events from EventBridge, SNS or DynamoDB Streams. Authenticate with Cognito and filter messages per user. For mobile push use SNS mobile push.

Q5. You need a search feature over product data stored in DynamoDB.

DynamoDB is not a search engine. Stream changes with DynamoDB Streams (or EventBridge Pipes) to OpenSearch, query OpenSearch from the API, and keep DynamoDB as the source of truth. Handle retries and reindexing.

Q6. Build a feature that answers employee questions from company documents.

Use a Bedrock Knowledge Base over documents in S3, Cognito groups mapped to metadata filters for access control, the Converse API with Guardrails and a grounded prompt that treats retrieved text as data, citations, per-user limits, and logging that excludes sensitive text.

Messaging and Reliability Scenarios

Q1. The same order is processed twice. Why, and how do you prevent it?

SQS and event sources are at-least-once, and a visibility timeout shorter than processing time also causes redelivery. Make the consumer idempotent with a conditional write (insert a record keyed by the message or order id, skip if it exists), use FIFO deduplication where ordering and dedup matter, and set the visibility timeout above processing time.

Q2. A poison message keeps failing and blocks the stream. What do you do?

For queues set a DLQ with maxReceiveCount and alarm on it. For Kinesis and DynamoDB Streams use bisect on error, a maximum retry count and record age, and an on-failure destination so one bad record cannot stall the shard. Fix the bug, then redrive from the DLQ.

Q3. Lambda is throttled during a traffic spike. Options?

Check account and reserved concurrency, request a quota increase, put SQS between producers and the function to smooth bursts and control maximum concurrency, add provisioned concurrency for latency-critical paths, and make downstream calls faster or cached.

Q4. A downstream API is slow and fails sometimes. How do you protect your system?

Set client timeouts, retry with exponential backoff and jitter, use a queue to decouple, add a circuit breaker or fallback, cache responses where valid, and limit concurrency to avoid overload.

Debugging Scenarios

Q1. Lambda fails with AccessDenied when writing to S3. Steps?

Check the function's execution role for the exact action and bucket ARN (the bucket and the object ARN are different resources). Check the bucket policy for explicit denies, Block Public Access, SCPs, and KMS permissions (kms:GenerateDataKey and kms:Decrypt) if the bucket uses SSE-KMS. Use CloudTrail to see the denied call and the identity.

Q2. API Gateway returns 502 although the Lambda succeeds in the console. Why?

With proxy integration the function must return an object with statusCode, headers and a string body. Returning plain text or a missing statusCode produces 502. Check the logs for the response shape.

Q3. DynamoDB is throttling although total consumed capacity is below the table limit.

A hot partition: a few keys receive most traffic. Redesign the key, shard write keys, use on-demand mode, cache hot reads with DAX, and check if a GSI is under-provisioned and blocking writes.

Q4. Your Lambda in a VPC cannot call DynamoDB and times out.

The private subnet has no route to the internet or AWS APIs. Add a DynamoDB gateway endpoint (free) or a NAT gateway, and confirm security group and route table rules.

Q5. ECS tasks keep restarting after deployment.

Check the stopped task reason and container logs. Common causes: failing ALB health check (path, port, security group, startup grace period), out-of-memory exit code 137, a missing secret or image pull errors because the execution role or network is wrong. The deployment circuit breaker can roll back automatically.

Q6. A CloudFormation update fails and rolls back. How do you find out why?

Read the stack events and find the first failed resource and its status reason. Fix the template or the dependency, review a change set before retrying, and use drift detection if someone changed resources manually.

Security Scenarios

Q1. An access key was committed to a public repository.

Deactivate and delete the key immediately, review CloudTrail for its activity, revoke sessions and remove anything unauthorized, rotate related secrets, then replace keys with roles or SSO and add secret scanning and pre-commit hooks.

Q2. How do you let users upload directly to S3 safely?

Create presigned POST URLs after authenticating the user, restrict content type and size in the policy conditions, use a per-user prefix, scan uploads (for example with Macie or antivirus Lambda), and keep the bucket private.

Q3. How do you restrict each user to their own data in DynamoDB and S3 from a mobile app?

Use a Cognito identity pool with IAM policy variables, such as the identity id in the S3 prefix and dynamodb:LeadingKeys for the partition key. For business rules use an API with a JWT authorizer and take the user id from the verified token.

Q4. How do you protect an AI feature against prompt injection?

Treat user text and retrieved documents as untrusted data, separate and harden system instructions, use Bedrock Guardrails including prompt attack filters, never execute model output directly, give tools least-privilege roles with argument validation and human approval for risky actions, and avoid logging sensitive prompts.

Cost and Performance Scenarios

Q1. The monthly bill rose sharply. Where do you look?

Cost Explorer by service, account, Region and tag, plus Cost Anomaly Detection. Typical culprits are NAT gateway data processing, CloudWatch Logs ingestion, S3 event loops, unbounded Lambda retries, large DynamoDB Scans, idle resources and cross-AZ or internet transfer. Fix the cause and add budgets and alarms.

Q2. How do you make a Lambda function faster and cheaper?

Tune memory with power tuning, use arm64, initialize clients outside the handler, shrink the package, batch operations, cache config, avoid synchronous chains, use direct service integrations, reduce logging, and set sensible timeouts.

Q3. A DynamoDB table is expensive. How do you reduce cost?

Use on-demand for spiky load and provisioned with auto scaling for steady load, remove Scans, project fewer attributes, keep items small, drop unused GSIs, use TTL, use the Standard-IA table class for cold data, and cache hot reads.

Delivery Scenarios

Q1. How do you deploy a new Lambda version with no downtime and fast rollback?

Publish a version, shift an alias gradually using CodeDeploy canary or linear deployment preferences in SAM, watch CloudWatch alarms, and rely on automatic rollback if they fire.

Q2. How do you change a database schema without downtime?

Use expand and contract: add backward-compatible columns first, deploy code that works with old and new schema, migrate data, and remove old structures in a later release. Run migrations as a controlled separate step with a backup.

Q3. How do you test a serverless application?

Unit test pure logic and handlers with mocks or moto, run functions locally with SAM, deploy an ephemeral stack and run integration tests against real services, test idempotency and failures, load test critical paths, and always clean up the test stacks.

Mock Interview Plan

  1. Pick one scenario a day and answer in five minutes with a sketch
  2. Record yourself and check that you mentioned failure, security, monitoring and cost
  3. Ask a friend to add a twist: traffic grows 10 times, a Region fails, the budget is cut
  4. Practise explaining your own project from the course

Conclusion

In scenario answers clarify requirements, sketch the flow, justify services, then cover failure handling and idempotency, security and least privilege, monitoring and cost, and how you test and deploy. Practise upload pipelines, messaging reliability, debugging AccessDenied and throttling, and safe AI design.

Quick Summary: method; design; messaging; debugging; security; cost; delivery; mock plan.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators