AWS Developer Interview Questions and Answers: Lambda, API Gateway, DynamoDB, S3, IAM and Messaging

AWS Developer Associate 50 min min read Updated: Nov 17, 2026 Intermediate
AWS Developer Interview Questions and Answers: Lambda, API Gateway, DynamoDB, S3, IAM and Messaging
Intermediate Topic 1 of 3

How to Answer

  • Give a one-line definition, a typical use, and one trade-off or limit
  • Add a short real example from a project when you can
  • If you do not know, explain how you would find out (docs, tests, metrics)

Lambda

Q1. What is a Lambda cold start and how do you reduce it?

A cold start is the extra time to create a new execution environment: download code, start the runtime and run initialization code. Reduce it with smaller packages, lazy imports, more memory (more CPU), arm64 and recent runtimes, SnapStart for supported runtimes, and provisioned concurrency for latency-critical paths. Do heavy initialization outside the handler so warm invocations reuse it.

Q2. Explain reserved and provisioned concurrency.

Reserved concurrency sets a guaranteed and maximum number of concurrent executions for one function. It protects other functions and downstream systems, and setting it to zero stops the function. Provisioned concurrency keeps pre-initialized environments ready for a version or alias to remove cold starts, and it costs extra.

Q3. How does Lambda handle failures for different invocation types?

Synchronous callers receive the error and decide to retry. Asynchronous invocations are retried up to two more times and then go to a dead-letter queue or on-failure destination. For SQS the batch returns to the queue after the visibility timeout (use partial batch responses and a DLQ on the queue). For Kinesis and DynamoDB Streams the shard is blocked and retried until success or expiry, so use bisect, max retries and an on-failure destination.

Q4. What are the key Lambda limits?

Timeout 15 minutes, memory 128 MB to 10,240 MB, 6 MB synchronous payload, 1,000 default concurrent executions per Region (soft limit), 5 layers, 250 MB unzipped package, 10 GB container image, /tmp up to 10 GB, and 4 KB total environment variables.

Q5. Versions and aliases: why use them?

A published version is an immutable snapshot of code and configuration. An alias is a named pointer to a version, used by callers and event sources. You deploy by moving the alias, split traffic between two versions for canary releases, and roll back by moving it back.

Q6. How do you give Lambda access to other AWS services, and others access to Lambda?

Outbound: the function's execution role. Inbound: the function's resource-based policy, which allows services like API Gateway or S3, or another account, to invoke it.

Q7. How do you connect Lambda to a relational database safely?

Put the function in the VPC with a security group, use RDS Proxy to pool connections, keep credentials in Secrets Manager or use IAM database authentication, reuse the connection outside the handler, and provide a NAT or VPC endpoints for AWS API access.

API Gateway

Q1. REST API vs HTTP API?

HTTP API is cheaper and faster with JWT authorizers, Lambda proxy and simple CORS. REST API offers more features: API keys and usage plans, caching, request validation, mapping templates, WAF integration, canary releases and private endpoints.

Q2. What does a 502 vs a 504 mean?

502 Bad Gateway usually means the Lambda response was malformed for proxy integration or the function crashed. 504 means the integration did not respond within the timeout (29 seconds by default). Use an asynchronous pattern for long work.

Q3. How do you secure an API?

Use IAM (SigV4), Cognito or JWT authorizers, or a Lambda authorizer. Add WAF, throttling and usage plans, resource policies, HTTPS with a custom domain and certificate, request validation, and least-privilege backend roles. API keys identify clients but are not authentication.

Q4. What are stage variables and canary releases?

Stage variables are per-stage settings, for example pointing to a Lambda alias. A canary release sends a percentage of stage traffic to a new deployment before full promotion.

DynamoDB

Q1. How do you choose a partition key?

Choose a high-cardinality attribute whose access is spread evenly, so no partition becomes hot. Design from access patterns, add a sort key for ranges and one-to-many relations, and use GSIs for other queries.

Q2. GSI vs LSI?

A GSI has its own partition and sort key, its own capacity, can be added any time and is eventually consistent. An LSI uses the same partition key with a different sort key, must be created with the table, shares table capacity, allows strong consistency, and limits each item collection to 10 GB.

Q3. How do you calculate RCU and WCU?

One WCU is one write per second of up to 1 KB. One RCU is one strongly consistent read per second of up to 4 KB, or two eventually consistent reads. Transactions cost double. Round item size up to the next unit and multiply by the operations per second.

Q4. Query vs Scan?

Query reads items for one partition key value with an optional sort key condition, so it is efficient. Scan reads the whole table and filters afterwards, so it is slow and costly. A filter expression does not reduce the capacity consumed.

Q5. How do you handle throttling?

SDKs retry with exponential backoff. Fix the cause: use on-demand mode or more capacity, improve the key to avoid hot partitions, cache with DAX, buffer writes with SQS, and review GSI capacity.

Q6. How do you prevent lost updates?

Use conditional writes with a version attribute (optimistic locking), atomic counters with update expressions, or transactions for multi-item consistency.

Q7. What are DynamoDB Streams and TTL used for?

Streams give an ordered 24-hour log of item changes that Lambda can process for auditing, replication and notifications. TTL deletes expired items in the background at no write cost, using an epoch-seconds attribute.

S3 and Storage

Q1. What is a presigned URL?

A temporary URL signed with the creator's credentials that allows one action on one object, such as uploading or downloading, without sharing credentials. It stops working at expiry or when the signing credentials become invalid.

Q2. When do you use multipart upload?

For objects above about 100 MB and required above 5 GB. It uploads parts in parallel, lets you retry failed parts, and should be paired with a lifecycle rule that aborts incomplete uploads.

Q3. How do you secure S3 data?

Block Public Access, least-privilege IAM and bucket policies, encryption (SSE-S3 or SSE-KMS), HTTPS-only policy, versioning and Object Lock where needed, logging with CloudTrail data events, and VPC endpoints.

Q4. EBS vs EFS vs S3?

EBS is single-AZ block storage for one instance, EFS is shared NFS file storage for Linux across AZs, and S3 is object storage accessed through an API with very high durability.

IAM and Security

Q1. Role vs user?

A user has long-term credentials for a person or application. A role is assumed to get temporary credentials and is the right choice for AWS services, cross-account access and federation.

Q2. How does IAM evaluate permissions?

Default deny. An explicit deny always wins. SCPs, permission boundaries and session policies must allow as well, and then an allow in an identity or resource policy grants access. Cross-account needs allows on both sides.

Q3. Task role vs task execution role in ECS?

The execution role is used by the ECS agent to pull images, write logs and fetch secrets. The task role is used by your application code to call AWS APIs.

Q4. Explain envelope encryption.

KMS encrypts a small data key. You ask KMS for a data key with GenerateDataKey, encrypt the data locally with the plaintext key, discard it, and store the encrypted data key next to the encrypted data. To decrypt, call KMS Decrypt on the encrypted key and decrypt locally. It avoids the 4 KB limit of direct Encrypt.

Q5. Secrets Manager vs Parameter Store?

Secrets Manager rotates secrets automatically and costs per secret. Parameter Store has a free standard tier for configuration and simple secrets and has no built-in rotation.

Q6. Cognito user pool vs identity pool?

A user pool authenticates users and issues JWT tokens. An identity pool exchanges tokens from user pools or other providers for temporary AWS credentials with IAM roles.

Messaging and Integration

Q1. What is the SQS visibility timeout?

After a consumer receives a message it is hidden for the visibility timeout. If it is not deleted in time it becomes visible again and is processed again. Set it longer than processing time, and for Lambda at least six times the function timeout.

Q2. Standard vs FIFO queues?

Standard queues have nearly unlimited throughput, at-least-once delivery and best-effort ordering. FIFO queues give strict order within a message group and exactly-once processing with deduplication, at lower throughput.

Q3. SNS vs SQS vs EventBridge vs Kinesis?

SQS is a pull queue for one consumer per message. SNS is push pub/sub. EventBridge routes events by content from AWS services, SaaS and your apps. Kinesis is an ordered, replayable stream for real-time processing with multiple consumers.

Q4. What is the fan-out pattern?

Publish once to an SNS topic and subscribe several SQS queues or Lambdas. Each consumer has its own queue and DLQ, so they scale and fail independently. Filter policies deliver only matching messages.

Q5. When do you choose Step Functions?

When you need orchestrated multi-step workflows with retries, branching, parallel work, waits, human approval and a visual history, instead of chaining Lambda functions in code.

Infrastructure and Delivery

Q1. CloudFormation vs SAM vs CDK?

CloudFormation is the declarative engine. SAM is a serverless-focused shorthand extension with a CLI for local testing. CDK uses programming languages and synthesizes to CloudFormation. All deploy through CloudFormation stacks.

Q2. What is a change set?

A preview of the changes CloudFormation will make to a stack, showing additions, modifications, replacements and deletions, so you can review before executing.

Q3. What does a failed stack update do?

CloudFormation automatically rolls back to the last working state. A failed creation rolls back and deletes the created resources unless rollback is disabled.

Q4. In-place vs blue/green deployment?

In-place updates existing instances, usually in batches, with reduced capacity during the release. Blue/green creates a new environment, shifts traffic, and keeps the old one for fast rollback at a temporary extra cost.

Practice

  1. Answer ten questions aloud in under a minute each
  2. For each service prepare one example from a real or practice project
  3. Be ready for follow-ups: what are the limits, what fails, how do you monitor and secure it
  4. Review the project lessons and prepare a three-minute story for each

Conclusion

Answer with a definition, a use case and a trade-off. Know Lambda concurrency and failure behavior, API Gateway errors, DynamoDB keys, indexes and capacity math, S3 presigned URLs and multipart, IAM evaluation and roles, KMS envelope encryption, SQS visibility timeout and fan-out, and the differences between CloudFormation, SAM and CDK.

Quick Summary: approach; Lambda; API Gateway; DynamoDB; S3/storage; IAM/security; messaging; delivery; practice.

Get Newsletter

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