Q-001 · Architecture · hard
A bank VP says: put our loan-document website on AWS this quarter. They have not said who uploads, how many files, or what rules apply. What do you do in the first 10 minutes? What do you not draw yet?
BayLearn Weekend Interview Sprints
Prepare to Design, Scale, Secure, and Defend AWS Architectures.
Practice the decisions AWS architecture interviews actually test—requirements, scale, resilience, security, cost, and trade-offs.
Not sure if this is the right Sprint? Start with the assessment.
Refund terms are drafted and are not a current offer. Refund policy
Live 1:1 is $349. Introductory live 1:1 is $299 — a configured price, not a countdown.
Best fit: You have used AWS in production and need to defend design choices under interview pressure.
Not ideal: You have never used the AWS console or core services.
Hour 1
Core concepts and interview patterns
Hour 2
Architecture / coding scenarios
Hour 3
Hands-on interview challenges
Hour 4
Mock interview and feedback
Can you explain these confidently?
Himanshu Bhadra
Enterprise Architect | Cloud | AI | Distributed Systems | Technical Leadership
Learn by designing, building and explaining.
Private 1:1 · Book on request
Private 1:1 sessions are scheduled after you book. No public cohort dates are listed yet.
Formats: Group Sprint and Private 1:1 Sprint when scheduled.
Book a Free 15-Minute Interview Strategy CallProfessional Programs are 8–16 week paths with labs and capstones. Use a Sprint to get interview-ready, then a program if you need deeper mastery.
Explore Professional ProgramsDraft refund policy. Not a current offer.
28 short lessons. Read them in order. Each one explains one idea in plain language, then tells you what to say in the interview. Use search if you want to jump to a topic.
You will
Course overview5 min
Course overview
If the interview is Monday, spend this weekend on one story you can say out loud.
This is a four-hour practice sprint, not a full AWS course. You will learn one order for architecture answers, pick AWS services for a document platform, and practice saying the answer.
Use the weekend clock. Do not start with the 100-question bank.
Start here — this page and the weekend clock
Module 0 — How the quiz works, then the quiz
Module 1 — R-SCALE, a cheat sheet, a short check
Module 2 — Compute, storage, databases, messaging, networking, the 100k-files story, a short check
Module 3 — High availability, disaster recovery, security, observability, cost, a short check
Module 4 — Document platform design and the canvas
Module 5 — How to practice the question bank
Module 6 — Mock interview brief and the timed mock
Lab — What you will build, how each hop works, then deploy it
People who already use AWS a bit and have an architecture interview coming — or want one.
This is not a first AWS certification dump. If you are brand new to the cloud, use a longer BayLearn course first.
Go in order. Each lesson is a short note. Some have an extra page under them. Mark a lesson complete when you can explain the choice in your own words.
INTERVIEW TIP: Say answers out loud. Reading silently does not help on a whiteboard.
NOTE: You can take this on your own, in a small group, or live 1:1. Book on the sprint page. BayAreaLa8s sends the invoice after you request a time.
Weekend clock (4 hours)
Weekend clock (4 hours)
Do the blocks in this order. Do not open the 100-question bank first, and do not skip the lab.
If you booked a live mock, stop after the canvas. Let the instructor run Module 6.
INTERVIEW TIP: Four hours is enough to get fluent on one story — the document platform — and one failure story. You do not need every AWS service.
You will
How the assessment works5 min
How the assessment works
Module 0 is a short placement quiz. It is not the 100-question bank.
| Lesson | What it is | What you do |
|---|---|---|
| 1. How the assessment works | This page | Read it, then open lesson 2 |
| 2. Readiness Assessment | The 15-question quiz | Take it in Learn after you enroll |
This page does not score you. Lesson 2 does.
Compute · 1/15.- your overall percent and a band
- eight skill scores
If you are self-paced, the band tells you what to re-read. If you are live with an instructor, they see the same scores.
Two questions per skill, except Architecture, which has one.
| # | Skill | The story is about |
|---|---|---|
| 1 | Compute | A bursty image API — Lambda vs a server that stays on vs EKS |
| 2 | Compute | A 20-minute video job vs Lambda’s 15-minute limit |
| 3 | Storage | Keeping files for 7 years — why a disk volume is the wrong place |
| 4 | Storage | Files in S3, facts about the files in a database |
| 5 | Networking | Private compute reading S3 without a big NAT bill |
| 6 | Networking | What makes a subnet public (the route, not the name) |
| 7 | Database | Known access patterns — DynamoDB vs a warehouse |
| 8 | Database | A standby database in one Region is high availability, not disaster recovery |
| 9 | Security | Give a role only the folder and table it needs |
| 10 | Security | Where a Lambda password should live |
| 11 | Serverless | One upload fans out to scan, extract, and notify |
| 12 | Serverless | An API that cannot wait 2 minutes — return 202 (accepted, not finished) and a job id |
| 13 | Resiliency | Recover in 1 hour, lose at most 15 minutes of data |
| 14 | Resiliency | How long a queue hides a message vs how long work takes |
| 15 | Architecture | Ask what you need and how big it is *before* you pick Lambda or ECS |
The next lesson lists every prompt and the four choices. Correct answers show only after you submit in Learn.
| Score | Label | What to do with your four hours |
|---|---|---|
| 0–40% | Foundation | Go slowly on Modules 1 and 2. Do not skip the method. |
| 41–60% | Developing | Use your two weak skills as your practice filter. |
| 61–80% | Interview ready | Spend more time on the canvas and the mock. |
| 81–100% | Advanced | Use the follow-up questions as stretch. |
A Foundation score is not a fail. It tells you where the four hours should go. The score does not predict hiring.
INTERVIEW TIP: Interviewers care more about how you recover from a gap than a perfect first answer.
Readiness Assessment (15 questions)15 min
Readiness Assessment (15 questions)
This page is the quiz. Below are all 15 short stories. Each one is tagged with the skill it scores.
To get a score: enroll → open Learn → Module 0 → Readiness Assessment. You get the same 15 items one at a time. After the last click you see your band and eight skill scores.
On this public page you can read every prompt. Correct answers stay hidden so the scored take still means something.
Pick the *best default*. Do not pick every service that could work.
15 scenario questions. Each card is tagged with the skill it scores. Open a card to read the prompt and the four choices.
Scored take: enroll, open Learn, then this same lesson. One question at a time. After 15 you see your band and eight skill scores.
You will
R-SCALE20 min
R-SCALE
R Requirements · S Scale · C Components · A Availability · L Limitations · E Evolution
Later modules use this order. If you jump straight to “I would use EKS,” you skip the part the interviewer is grading.
The interviewer is not checking whether you memorized product names. They want to see if you can take a fuzzy problem, make it clear, add a few numbers, then pick tools.
R-SCALE is that order. Use it in this sprint so we can coach the same steps.
INTERVIEW TIP: “I will confirm what we need and sketch the size before I pick services. Please stop me if an assumption is wrong.”
That gives you time to think. A silent start looks like panic. A clear order looks like you have done this before.
Do not treat “build a document platform” as a full spec. Ask until you can fill this table:
| Ask | Why it changes the design |
|---|---|
| Who uses it? | A person in a browser is not the same as a partner sending files |
| What is one unit of work? | A file, an API call, a stream, or a nightly batch |
| What does success look like? | “Upload accepted” is not the same as “scan finished in 5 minutes” |
| What failure is not allowed? | Serving a bad file vs losing a file you already accepted |
| How sensitive is the data? | A public PDF is not patient data |
| What already exists? | A new account vs an old VPC and cluster |
| How fast must we recover? | Hours vs minutes |
Five questions that usually matter:
If they will not answer, say your assumptions out loud and write them down.
text
100,000 files/day ≈ 1.2 files per second on average
Peak 10× ≈ 12 files per second
1,000,000/day ≈ 12 files per second average, 120 at peakAlways turn the day count into per second. Then ask file size, reads vs writes, and peak vs average.
File size changes cost, Lambda time, and network. A count with no size is not enough.
Work the four examples in the Napkin math page under this module.
COMMON MISTAKE: Saying “this must scale to the internet” with no numbers, then picking DynamoDB because it “scales.”
ARCHITECTURE DECISION: If peak is about 20 times average, use a queue. Do not buy a server sized for the peak and leave it idle.
One worked example: 1 million files/day × 10 MB = 10 TB/day. Say “ten terabytes,” then pick storage and scan capacity.
Do not sprinkle logos. Draw in this order:
If a box does not serve a requirement or a number, remove it.
Read the High availability lesson later. For now, remember three ideas: more than one Availability Zone (one data-center group), no local disk that must survive, and a queue that can absorb a spike.
Every pick has a downside. Practice naming it.
| If you pick | You give up |
|---|---|
| Lambda | 15 minute max, small payload, small temp disk |
| DynamoDB | Easy ad-hoc SQL and cheap joins |
| Standard SQS | Strict first-in, first-out order |
| One Region | Surviving that Region going down |
| Scan during upload | Upload stays down if the scanner is down |
If you cannot name what you give up, you have not chosen. You have listed products.
Ask: “What breaks if we get ten times bigger?” Honest answers: scanner speed, Lambda time and concurrency, KMS calls, log volume, or a design that does upload and scan in one function. “We would rewrite everything” is a weak answer. If 10× needs a rewrite, ingest and processing are too tightly tied now.
You will not recite all fourteen in 45 minutes. You will walk R, S, C, A, L, E in order. Pull the rest when they ask.
Open the 100k scenario. Speak R-SCALE with a timer. Then take the knowledge check. The cheat sheet is a pocket card. It does not replace this page.
Napkin math workbook
Napkin math workbook
Turn a fuzzy prompt into per-second rate, bytes per day, and in-flight workers before you pick a service.
Interviews grade the method. List prices change. The arithmetic does not. If you skip size, you cannot explain why you picked Lambda or Fargate.
Write 86,400 on the board once (24 × 60 × 60). You will use it every time.
INTERVIEW TIP: “I am going to turn this into per-second and bytes, then pick compute. Please stop me if object size is not 2 MB.”
Round freely. 1.157 → 1.2. For peak, ask, or say “I will assume 10× unless you have a burst profile.”
Then pick Lambda vs Fargate vs a cluster.
Prompt: 100,000 files/day over HTTPS, scan, store metadata, notify. Future 1,000,000/day.
Step 1 — count. 100,000 files/day. Future 1,000,000.
Step 2 — average.
text
100,000 / 86,400 ≈ 1.157 → say 1.2 files/s
1,000,000 / 86,400 ≈ 11.57 → say 12 files/sStep 3 — peak. They did not give a peak. Assume 10× business hours.
text
100k peak ≈ 12 files/s
1M peak ≈ 120 files/sStep 4 — size. Ask. If they shrug, assume 2 MB and write it.
text
100,000 × 2 MB = 200,000 MB = 200 GB/day ingest
1,000,000 × 2 MB = 2,000 GB/day = 2 TB/dayIf they say 10 MB at 1M/day: 10 TB/day. Storage, scan time, and egress just moved more than request rate did.
Step 5 — concurrency. Ask scan time. Library scan ≈ 8 s. Appliance ≈ 90 s.
text
At 1M peak 120/s, 8 s scan: 120 × 8 = 960 in-flight
At 1M peak 120/s, 90 s scan: 120 × 90 = 10,800 in-flightWhat the numbers decide
| Signal | Decision |
|---|---|
| 1.2–12 files/s | Not Kinesis, not Kafka, not EKS “for scale” |
| 200 GB–2 TB/day at 2 MB | S3; watch lifecycle and versions, not EC2 size |
| 8 s × 12/s ≈ 96 workers | Lambda is honest |
| 90 s × 120/s ≈ 10,800 | Fargate (or a fleet). Lambda’s 15-minute timeout is fine; concurrency and /tmp are not |
| 10 TB/day | Scanner capacity and S3 PUT/storage matter more than compute type |
Say it: “Twelve files a second peak at 100k/day is a queue, not a cluster. I need object size before I pick Lambda.”
Prompt: 20,000 daily active users, about 40 API calls per user per day, p95 under 200 ms.
Step 1. 20,000 × 40 = 800,000 calls/day.
Step 2. 800,000 / 86,400 ≈ 9.3 requests/s average.
Step 3. Login or home spike. Assume 20× unless they give analytics.
text
Peak ≈ 9.3 × 20 ≈ 186 requests/sStep 4. JSON 5 KB. Bytes are small next to documents.
text
800,000 × 5 KB ≈ 4 GB/dayStep 5. Handler 50 ms = 0.05 s.
text
Concurrency ≈ 186 × 0.05 ≈ 9Decision: API Gateway + Lambda (or ALB + ECS if you already have that platform or need WebSockets). You do not need Kinesis. You do need auth, WAF, and safe POSTs. GB/day does not pick the database. Access patterns do.
Prompt: Partners drop 100,000 files by SFTP between 01:00 and 05:00.
Step 1. Still 100,000 files — but not over 24 hours.
Step 2–3. Window = 4 hours = 14,400 seconds.
text
100,000 / 14,400 ≈ 6.94 → say 7 files/s sustained for four hoursThere is no “1.2/s average” for the processor. The daily average hides a batch.
Step 4. Same size question. 2 MB × 100k = 200 GB in four hours.
Step 5. 7/s × 8 s scan ≈ 56 in-flight. Comfortable. 7/s × 90 s ≈ 630.
Decision: AWS Transfer Family into the same landing bucket. Same EventBridge → SQS → processor. Size the queue and workers for 7/s, not 1.2/s. SQS exists so ingest and process can run at different speeds.
Say it: “I will not divide by 86,400 if they told me a four-hour window.”
Prompt: 10,000 videos/day, ~200 MB each, users stream a subset.
Step 1–2. 10,000 / 86,400 ≈ 0.12 files/s average. Peak 10× ≈ 1.2/s. Tiny request rate.
Step 4.
text
10,000 × 200 MB = 2,000,000 MB = 2 TB/day ingestStep 5. Transcode 4 minutes = 240 s.
text
Peak concurrency ≈ 1.2 × 240 ≈ 288 Fargate tasks (order of magnitude)Lambda: 200 MB object plus minutes of CPU → wrong model (timeout, /tmp, cost). Use S3 + Fargate or Batch + CloudFront.
Egress (the cost question). If 30% of objects are downloaded once:
text
0.30 × 2 TB = 600 GB/day outPoint at CloudFront + cache, not at EC2.
Say it: “This is not a request-rate problem. It is a bytes and duration problem. I will not pick Lambda because the file count looks small.”
DynamoDB writes. One ~1 KB item per file. 1 write/s ≈ 1 WCU for items ≤ 1 KB. 100k/day ≈ 1.2 writes/s. At 1M/day and 120/s peak with a 2 KB item, about 240 WCU at peak. Pick Aurora when they named a query DynamoDB keys cannot answer — not because “we might report someday.”
NAT vs endpoints. 10 TB/day through NAT is the bill. A gateway VPC endpoint for S3 keeps that traffic off NAT. Name the GB and the fix. You do not need the current list price.
Queue depth. If processors die for 10 minutes at 12 files/s: 12 × 600 = 7,200 messages on SQS. The queue is the shock absorber. Health means “I can accept upload,” not “scan is caught up.”
100,000 a day is 1.2 per second. I will assume 10× peak unless you have a window — call it 12 per second. I need object size: at 2 MB that is 200 GB/day. An 8-second scan is about 100 in-flight at that peak, so Lambda behind SQS. If you tell me 200 MB files or 90-second scans, I move the worker to Fargate and I keep the same S3 contract.
Napkin math pocket card
Napkin math pocket card
BayLearn · AWS Solutions Architect Interview Sprint
Seconds/day = 86,400 (24 × 60 × 60)
| Prompt | Avg | Peak (10× unless noted) | Bytes (example) | Default |
|---|---|---|---|---|
| 100k files/day | 1.2/s | 12/s | 2 MB → 200 GB/day | SQS + Lambda |
| 1M files/day | 12/s | 120/s | 2 MB → 2 TB/day | Same; watch scanner |
| 100k in 4 h SFTP | — | 7/s sustained | 2 MB → 200 GB in 4 h | Transfer + same processor |
| 20k DAU × 40 calls | 9.3/s | ~190/s at 20× | JSON → ignore GB | API GW + Lambda |
| 10k × 200 MB video | 0.12/s | 1.2/s | 2 TB/day | Fargate + CloudFront |
Do not divide by 86,400 if they gave you a window. Do not pick Kafka at 12/s. Do not pick Lambda for 200 MB files that take minutes.
R-SCALE cheat sheet5 min
R-SCALE cheat sheet
BayLearn Interview Sprints · AWS Solutions Architect
| Letter | Meaning | Say this |
|---|---|---|
| R | Requirements | Who uses it, what success is, what must not fail |
| S | Scale | Per second, file size, peak vs average |
| C | Components | Draw boxes only after R and S |
| A | Availability | More than one AZ (Availability Zone), health checks, how fast we recover |
| L | Limitations | What you give up, and why that is OK |
| E | Evolution | What breaks at 10× |
Clarify → size → APIs → data → compute → storage → network → async → security → watch it → recover → cost → trade-offs.
Downloadable cheat sheet
Downloadable cheat sheet
BayLearn · AWS Solutions Architect Interview Sprint
| Letter | Meaning | Say this |
|---|---|---|
| R | Requirements | Who uses it, what success is, what must not fail |
| S | Scale | Per second, file size, peak vs average |
| C | Components | Draw boxes only after R and S |
| A | Availability | More than one AZ, health checks, how fast we recover |
| L | Limitations | What you gave up, and why that is OK |
| E | Evolution | What breaks at 10× |
Clarify → size → APIs → data → compute → storage → network → async → security → watch it → recover → cost → trade-offs.
Napkin math workbook
Napkin math workbook
Turn a fuzzy prompt into per-second rate, bytes per day, and in-flight workers before you pick a service.
Interviews grade the method. List prices change. The arithmetic does not. If you skip size, you cannot explain why you picked Lambda or Fargate.
Write 86,400 on the board once (24 × 60 × 60). You will use it every time.
INTERVIEW TIP: “I am going to turn this into per-second and bytes, then pick compute. Please stop me if object size is not 2 MB.”
Round freely. 1.157 → 1.2. For peak, ask, or say “I will assume 10× unless you have a burst profile.”
Then pick Lambda vs Fargate vs a cluster.
Prompt: 100,000 files/day over HTTPS, scan, store metadata, notify. Future 1,000,000/day.
Step 1 — count. 100,000 files/day. Future 1,000,000.
Step 2 — average.
text
100,000 / 86,400 ≈ 1.157 → say 1.2 files/s
1,000,000 / 86,400 ≈ 11.57 → say 12 files/sStep 3 — peak. They did not give a peak. Assume 10× business hours.
text
100k peak ≈ 12 files/s
1M peak ≈ 120 files/sStep 4 — size. Ask. If they shrug, assume 2 MB and write it.
text
100,000 × 2 MB = 200,000 MB = 200 GB/day ingest
1,000,000 × 2 MB = 2,000 GB/day = 2 TB/dayIf they say 10 MB at 1M/day: 10 TB/day. Storage, scan time, and egress just moved more than request rate did.
Step 5 — concurrency. Ask scan time. Library scan ≈ 8 s. Appliance ≈ 90 s.
text
At 1M peak 120/s, 8 s scan: 120 × 8 = 960 in-flight
At 1M peak 120/s, 90 s scan: 120 × 90 = 10,800 in-flightWhat the numbers decide
| Signal | Decision |
|---|---|
| 1.2–12 files/s | Not Kinesis, not Kafka, not EKS “for scale” |
| 200 GB–2 TB/day at 2 MB | S3; watch lifecycle and versions, not EC2 size |
| 8 s × 12/s ≈ 96 workers | Lambda is honest |
| 90 s × 120/s ≈ 10,800 | Fargate (or a fleet). Lambda’s 15-minute timeout is fine; concurrency and /tmp are not |
| 10 TB/day | Scanner capacity and S3 PUT/storage matter more than compute type |
Say it: “Twelve files a second peak at 100k/day is a queue, not a cluster. I need object size before I pick Lambda.”
Prompt: 20,000 daily active users, about 40 API calls per user per day, p95 under 200 ms.
Step 1. 20,000 × 40 = 800,000 calls/day.
Step 2. 800,000 / 86,400 ≈ 9.3 requests/s average.
Step 3. Login or home spike. Assume 20× unless they give analytics.
text
Peak ≈ 9.3 × 20 ≈ 186 requests/sStep 4. JSON 5 KB. Bytes are small next to documents.
text
800,000 × 5 KB ≈ 4 GB/dayStep 5. Handler 50 ms = 0.05 s.
text
Concurrency ≈ 186 × 0.05 ≈ 9Decision: API Gateway + Lambda (or ALB + ECS if you already have that platform or need WebSockets). You do not need Kinesis. You do need auth, WAF, and safe POSTs. GB/day does not pick the database. Access patterns do.
Prompt: Partners drop 100,000 files by SFTP between 01:00 and 05:00.
Step 1. Still 100,000 files — but not over 24 hours.
Step 2–3. Window = 4 hours = 14,400 seconds.
text
100,000 / 14,400 ≈ 6.94 → say 7 files/s sustained for four hoursThere is no “1.2/s average” for the processor. The daily average hides a batch.
Step 4. Same size question. 2 MB × 100k = 200 GB in four hours.
Step 5. 7/s × 8 s scan ≈ 56 in-flight. Comfortable. 7/s × 90 s ≈ 630.
Decision: AWS Transfer Family into the same landing bucket. Same EventBridge → SQS → processor. Size the queue and workers for 7/s, not 1.2/s. SQS exists so ingest and process can run at different speeds.
Say it: “I will not divide by 86,400 if they told me a four-hour window.”
Prompt: 10,000 videos/day, ~200 MB each, users stream a subset.
Step 1–2. 10,000 / 86,400 ≈ 0.12 files/s average. Peak 10× ≈ 1.2/s. Tiny request rate.
Step 4.
text
10,000 × 200 MB = 2,000,000 MB = 2 TB/day ingestStep 5. Transcode 4 minutes = 240 s.
text
Peak concurrency ≈ 1.2 × 240 ≈ 288 Fargate tasks (order of magnitude)Lambda: 200 MB object plus minutes of CPU → wrong model (timeout, /tmp, cost). Use S3 + Fargate or Batch + CloudFront.
Egress (the cost question). If 30% of objects are downloaded once:
text
0.30 × 2 TB = 600 GB/day outPoint at CloudFront + cache, not at EC2.
Say it: “This is not a request-rate problem. It is a bytes and duration problem. I will not pick Lambda because the file count looks small.”
DynamoDB writes. One ~1 KB item per file. 1 write/s ≈ 1 WCU for items ≤ 1 KB. 100k/day ≈ 1.2 writes/s. At 1M/day and 120/s peak with a 2 KB item, about 240 WCU at peak. Pick Aurora when they named a query DynamoDB keys cannot answer — not because “we might report someday.”
NAT vs endpoints. 10 TB/day through NAT is the bill. A gateway VPC endpoint for S3 keeps that traffic off NAT. Name the GB and the fix. You do not need the current list price.
Queue depth. If processors die for 10 minutes at 12 files/s: 12 × 600 = 7,200 messages on SQS. The queue is the shock absorber. Health means “I can accept upload,” not “scan is caught up.”
100,000 a day is 1.2 per second. I will assume 10× peak unless you have a window — call it 12 per second. I need object size: at 2 MB that is 200 GB/day. An 8-second scan is about 100 in-flight at that peak, so Lambda behind SQS. If you tell me 200 MB files or 90-second scans, I move the worker to Fargate and I keep the same S3 contract.
Napkin math pocket card
Napkin math pocket card
BayLearn · AWS Solutions Architect Interview Sprint
Seconds/day = 86,400 (24 × 60 × 60)
| Prompt | Avg | Peak (10× unless noted) | Bytes (example) | Default |
|---|---|---|---|---|
| 100k files/day | 1.2/s | 12/s | 2 MB → 200 GB/day | SQS + Lambda |
| 1M files/day | 12/s | 120/s | 2 MB → 2 TB/day | Same; watch scanner |
| 100k in 4 h SFTP | — | 7/s sustained | 2 MB → 200 GB in 4 h | Transfer + same processor |
| 20k DAU × 40 calls | 9.3/s | ~190/s at 20× | JSON → ignore GB | API GW + Lambda |
| 10k × 200 MB video | 0.12/s | 1.2/s | 2 TB/day | Fargate + CloudFront |
Do not divide by 86,400 if they gave you a window. Do not pick Kafka at 12/s. Do not pick Lambda for 200 MB files that take minutes.
R-SCALE knowledge check5 min
R-SCALE knowledge check
R Requirements · S Scale · C Components · A Availability · L Limitations · E Evolution
Later modules use this order. If you jump straight to “I would use EKS,” you skip the part the interviewer is grading.
The interviewer is not checking whether you memorized product names. They want to see if you can take a fuzzy problem, make it clear, add a few numbers, then pick tools.
R-SCALE is that order. Use it in this sprint so we can coach the same steps.
INTERVIEW TIP: “I will confirm what we need and sketch the size before I pick services. Please stop me if an assumption is wrong.”
That gives you time to think. A silent start looks like panic. A clear order looks like you have done this before.
Do not treat “build a document platform” as a full spec. Ask until you can fill this table:
| Ask | Why it changes the design |
|---|---|
| Who uses it? | A person in a browser is not the same as a partner sending files |
| What is one unit of work? | A file, an API call, a stream, or a nightly batch |
| What does success look like? | “Upload accepted” is not the same as “scan finished in 5 minutes” |
| What failure is not allowed? | Serving a bad file vs losing a file you already accepted |
| How sensitive is the data? | A public PDF is not patient data |
| What already exists? | A new account vs an old VPC and cluster |
| How fast must we recover? | Hours vs minutes |
Five questions that usually matter:
If they will not answer, say your assumptions out loud and write them down.
text
100,000 files/day ≈ 1.2 files per second on average
Peak 10× ≈ 12 files per second
1,000,000/day ≈ 12 files per second average, 120 at peakAlways turn the day count into per second. Then ask file size, reads vs writes, and peak vs average.
File size changes cost, Lambda time, and network. A count with no size is not enough.
Work the four examples in the Napkin math page under this module.
COMMON MISTAKE: Saying “this must scale to the internet” with no numbers, then picking DynamoDB because it “scales.”
ARCHITECTURE DECISION: If peak is about 20 times average, use a queue. Do not buy a server sized for the peak and leave it idle.
One worked example: 1 million files/day × 10 MB = 10 TB/day. Say “ten terabytes,” then pick storage and scan capacity.
Do not sprinkle logos. Draw in this order:
If a box does not serve a requirement or a number, remove it.
Read the High availability lesson later. For now, remember three ideas: more than one Availability Zone (one data-center group), no local disk that must survive, and a queue that can absorb a spike.
Every pick has a downside. Practice naming it.
| If you pick | You give up |
|---|---|
| Lambda | 15 minute max, small payload, small temp disk |
| DynamoDB | Easy ad-hoc SQL and cheap joins |
| Standard SQS | Strict first-in, first-out order |
| One Region | Surviving that Region going down |
| Scan during upload | Upload stays down if the scanner is down |
If you cannot name what you give up, you have not chosen. You have listed products.
Ask: “What breaks if we get ten times bigger?” Honest answers: scanner speed, Lambda time and concurrency, KMS calls, log volume, or a design that does upload and scan in one function. “We would rewrite everything” is a weak answer. If 10× needs a rewrite, ingest and processing are too tightly tied now.
You will not recite all fourteen in 45 minutes. You will walk R, S, C, A, L, E in order. Pull the rest when they ask.
Open the 100k scenario. Speak R-SCALE with a timer. Then take the knowledge check. The cheat sheet is a pocket card. It does not replace this page.
You will
Compute selection10 min
Compute selection
Pick the compute that matches the job. Then name the limit that would make you switch.
Compute is where your code runs. The interviewer wants a reason, not a product list. How long the job lasts, how bursty it is, and what the team can run decide the pick. On this document platform that usually maps to Lambda, Fargate, EKS, or EC2.
This function writes S3 and DynamoDB, then returns 202. It does not scan the file.
python
# labs/aws-document-processing/lambda/ingest.py
def handler(event, _context):
payload = json.loads(event.get("body") or "{}")
job_id = str(uuid.uuid4())
key = f"landing/{job_id}/{payload.get('fileName') or 'upload.txt'}"
s3.put_object(
Bucket=BUCKET,
Key=key,
Body=base64.b64decode(payload.get("contentBase64") or ""),
ServerSideEncryption="aws:kms",
SSEKMSKeyId=os.environ["KMS_KEY_ARN"],
)
table.put_item(Item={"jobId": job_id, "s3Key": key, "status": "RECEIVED"})
return {"statusCode": 202, "body": json.dumps({"jobId": job_id, "s3Key": key})}Timeout and memory must fit the scan. The queue’s visibility timeout must be longer.
hcl
# Terraform: SQS-triggered processor (duration + visibility must fit)
resource "aws_lambda_function" "processor" {
function_name = "${var.name_prefix}-processor"
runtime = "python3.12"
handler = "processor.handler"
timeout = 30
memory_size = 256
environment {
variables = {
TABLE_NAME = aws_dynamodb_table.jobs.name
BUCKET_NAME = aws_s3_bucket.docs.bucket
TOPIC_ARN = aws_sns_topic.processed.arn
}
}
}Lambda is a function. You upload a zip or a small container. AWS runs it when an event arrives and bills you for time × memory. You do not patch a server.
You do own these limits:
/tmp) starts at 512 MB and can go to 10 GB. That is still not a file farmA cold start is a new environment spinning up. It can matter for a user-facing login API. It almost never matters for a file scanner behind a queue.
ARCHITECTURE DECISION: Burst document ingest belongs on Lambda or Fargate behind a queue. Do not buy a fixed EC2 box sized for the peak.
Fargate runs a container. You ship the image. AWS runs the task. You do not manage EC2.
You get a longer-lived process, more disk, and any language or binary. You pay while the task is running.
Use a service for an always-on API. Use tasks (or a scaling service) for workers that drain a queue.
Good when you need virus-scan libraries, a 20-minute job, or OCR that does not fit Lambda.
EKS is managed Kubernetes. You run a cluster of containers and own upgrades, networking, and on-call.
Pick EKS when the company already runs it well and this workload must join that platform.
It is not “more serious” than Fargate for one file worker.
INTERVIEW TIP: If the team cannot run a cluster, say so kindly. “EKS is great if we already have that platform team. I will not add a cluster just to process files.”
EC2 is a virtual machine you own. You pick the image, patches, instance type, and Spot vs On-Demand.
Use it for GPU, special kernel modules, licensed appliances, or steady high use where a reserved instance beats Fargate.
Autoscaling is not magic. Name the metric (CPU, request count, or SQS queue depth). Name the warm-up. Say what happens in a 10× spike before new boxes are healthy. That last part is why queues exist.
| Front door | Use when |
|---|---|
| API Gateway HTTP/REST | Request/response APIs, auth, throttling, Lambda proxy |
| ALB | HTTP to ECS or EC2, path routing, longer connections |
| NLB | Raw TCP, static IPs, TLS passthrough |
| CloudFront | Global edge, WAF (a web firewall), cache of clean downloads |
Do not send a 2 GB upload through API Gateway. It has a small payload limit. Have the API mint a presigned S3 PUT (a short-lived upload link) or use Transfer Family for SFTP.
| Constraint | What you do |
|---|---|
| Lambda 15 min | Large file scan → Fargate worker |
| Lambda 6 MB sync | Upload goes to S3, not in the JSON body |
/tmp | Stream to S3. Do not load a 500 MB PDF into memory |
| Burst 10× | Queue + more workers, not “a bigger box” |
| VPC Lambda and no endpoints | NAT Gateway becomes the design |
| If this is true | Start with |
|---|---|
| Bursty, short, event-driven | Lambda |
| Containers, little cluster work | ECS Fargate |
| Many services and the team already runs Kubernetes | EKS |
| Special kernel, GPU, steady high use | EC2 + Auto Scaling |
| Jobs longer than 15 minutes | Fargate or Batch |
| Batch that can wait and can be interrupted | Spot, with a drain plan (never the only ingest path) |
Ingest API. API Gateway plus a Lambda that only checks the caller and returns a presigned S3 PUT. Time on this function: milliseconds. Do not scan here.
Processor. SQS (a queue) triggers Lambda. A 5 MB PDF and a 2-second scan at 12 files/sec peak needs about 24 workers in flight (12 × 2). Easy.
If the scan is 4 minutes and peak is 12/sec, you need about 2,880 Lambdas at once — or you let the queue grow and scale Fargate on queue age. Say that out loud.
Not the first box: EKS, or an EC2 fleet sized for Monday peak that sits idle on Sunday.
“What happens when the processor falls behind?”
SQS age and depth grow. Alarm on age. Scale workers. Upload can still return 202. Users wait for CLEAN, not for the HTTP upload.
“How do you handle a 2 GB PDF?”
Presigned PUT to S3. Scan on Fargate. Do not use API Gateway as a file pipe.
“Why not one EKS cluster for everything?”
A cluster is a lot of ops for one pipeline. If EKS already exists, the processor can move later. S3 and the client contract stay the same.
Compute follows the shape of the work. Ingest is a short burst API, so I use Lambda. Processing sits behind SQS — Lambda first, Fargate if the scan is long or needs special libraries. I will not put this on EKS unless we already run EKS. If we grow 10×, the queue holds the spike and I scale workers, not a fixed box.
Compute selection guide
Compute selection guide
| Workload | First pick | Why |
|---|---|---|
| Short burst, event-driven | Lambda | You pay when it runs. Idle cost is near zero. |
| Container, little ops | ECS Fargate | You ship a container. You do not manage nodes. |
| Many services, and you already run Kubernetes | EKS | Use it when the team already operates it well. |
| Steady high use, or special hardware | EC2 | You control the machine. Price can be better at steady load. |
| Jobs longer than 15 minutes | Fargate or Batch | Lambda stops at 15 minutes. |
| Batch that can be interrupted | Spot, then drain | Do not use Spot as the only upload path. |
Storage selection8 min
Storage selection
Put file bytes in S3. Keep the landing bucket hostile. Serve files only after a scan.
Storage is not one product. Object, block, and file storage solve different jobs. If you mix them, the design breaks. The interviewer wants to see landing vs clean, encryption, and who pays for old versions.
Block public access on the bucket. Encrypt new objects with KMS, which is AWS key management.
hcl
resource "aws_s3_bucket_public_access_block" "docs" {
bucket = aws_s3_bucket.docs.id
block_public_acls = true
block_public_policy = true
ignore_public_acls = true
restrict_public_buckets = true
}
resource "aws_s3_bucket_server_side_encryption_configuration" "docs" {
bucket = aws_s3_bucket.docs.id
rule {
apply_server_side_encryption_by_default {
sse_algorithm = "aws:kms"
kms_master_key_id = aws_kms_key.lab.arn
}
bucket_key_enabled = true
}
}Deny uploads that are not HTTPS.
json
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "DenyInsecureTransport",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": ["arn:aws:s3:::docs-bucket", "arn:aws:s3:::docs-bucket/*"],
"Condition": { "Bool": { "aws:SecureTransport": "false" } }
}]
}Object, block, and file storage do different jobs. Here is how those jobs map on AWS.
S3 (object storage). An HTTP API for files. It scales a long way. You pay per request. A new PUT of a new key is readable right away. Customer documents live here. The unit is an object: a key, the bytes, and some metadata. It is not a disk.
EBS (block storage). A volume attached to one instance. Think boot disk, a database you run yourself, or scratch space. Multi-Attach exists, but you must have a reason. EBS is not a shared document archive.
EFS (file storage). A shared POSIX file system. Many containers can open() the same files. Use it when you need file-system behavior. Do not use EFS as cheaper S3.
ARCHITECTURE DECISION: Customer documents go on S3 with KMS. Never use EBS as the system of record for files.
S3 Standard is designed for 11 nines of durability across Availability Zones. That means “we try very hard not to lose the object.” It does not mean the Region cannot fail. Durability is not disaster recovery. Replication and backups are still a talk.
Decrypt. Default for customer documents. You can allow GetObject but deny kms:Decrypt.status=CLEAN.| Feature | Say this or do not turn it on |
|---|---|
| Versioning | Recovers overwrite or delete. Set noncurrent expiration or you pay forever |
| Replication | Copy to another Region. Lag is the RPO unless you buy RTC. Replica keys and IAM must work |
| Intelligent-Tiering | Good when access is unknown. Watch the monitoring charge |
| Glacier | Name restore time vs the product promise. Instant Retrieval is not Deep Archive |
COMMON MISTAKE: Turning on every S3 feature on the diagram. Pick versioning, or explain why you skipped it.
S3 can send events to EventBridge (many rules, plus archive) or to SQS, SNS, or Lambda. At 1 million objects a day, LIST as the control plane is slow and costly. Drive the processor with events. Store the key in DynamoDB.
A presigned URL is a time-boxed link for one verb (PUT or GET). A locked-down Lambda should mint it. This is not “make the bucket public for a minute.” Log use. Expire the link. Do not print the query string in debug logs.
| Data | Default | Not the default |
|---|---|---|
| Customer documents | S3 + customer-managed KMS key | EBS volume as the archive |
| Boot / instance disk | EBS gp3 (io2 if you can justify IOPS) | S3 mounted as a disk |
| Shared POSIX across tasks | EFS | One EBS volume with many writers |
| Cold / audit copies | Lifecycle to IA or Glacier, with restore time named | Standard forever “just in case” |
| Scratch | /tmp or ephemeral disk | A second public landing bucket |
“A user uploaded malware. Where is it?”
Landing or quarantine. The scanner role can read it. Product CloudFront cannot. Metadata says REJECTED. Treat landing as hostile even if you use an AWS malware feature.
“1 million objects a day — do we LIST the bucket?”
No. Save the key at ingest time. Use S3 Inventory for later audit, not the hot path.
“Why not EFS so Lambdas can share files?”
Customer files are objects you ingest over HTTP. S3 plus events scale for that. EFS is for shared scratch or older apps that need a real file system.
Documents are objects. S3 holds the bytes, encrypted with a key we manage. Landing is hostile — we scan, then copy to clean, and downloads never point at landing. EBS is for boot disks, not the archive. I turn on versioning or replication only if I can name the recovery goal and who pays for old copies.
Database selection8 min
Database selection
Draw the queries and keys first. Then pick DynamoDB or Aurora.
A database is where facts live. File bytes stay in S3. Status, owner, and keys stay in a database. Name the query first. If you name an engine before you name a query, the interviewer will push back.
INTERVIEW TIP: “I will draw the queries before I pick the engine. If I cannot name the partition key, I will not pick DynamoDB.”
On-demand billing fits bursty ingest. The key is jobId.
hcl
resource "aws_dynamodb_table" "jobs" {
name = "${var.name_prefix}-jobs"
billing_mode = "PAY_PER_REQUEST"
hash_key = "jobId"
attribute {
name = "jobId"
type = "S"
}
server_side_encryption {
enabled = true
kms_key_arn = aws_kms_key.lab.arn
}
}The item is metadata. The PDF is not in the item.
json
{
"jobId": "FILE#c0ffee",
"customerId": "acme",
"s3Key": "landing/c0ffee/contract.pdf",
"status": "RECEIVED",
"sha256": "ab…",
"createdAt": "2026-09-10T06:00:00Z"
}Only move status if it is still RECEIVED. That keeps a retry from writing twice.
python
table.update_item(
Key={"jobId": job_id},
UpdateExpression="SET #s = :s, processedAt = :t",
ConditionExpression="#s = :expected",
ExpressionAttributeNames={"#s": "status"},
ExpressionAttributeValues={
":s": "PROCESSED",
":expected": "RECEIVED",
":t": now,
},
)“DynamoDB because it scales,” with no keys, is a weak answer. “I am not using DynamoDB because I cannot name the keys” is a strong one.
DynamoDB is a key-value database. You model items and keys (a partition key, and maybe a sort key). You do not model a spreadsheet.
customerId can soak all writes. Split with customerId#shard, or pick a better key.checksum. Say the extra write cost.TransactWriteItems across items. Not SQL joins.Write order with S3: PUT the object first (or finish multipart). Then write metadata with a condition (attribute_not_exists or a version). If metadata is first and S3 fails, you have a ghost file. If S3 works and metadata fails, a sweeper or an “unknown object” metric cleans up. Name that path.
Aurora and RDS are relational databases. You get SQL, joins, and transactions that match invoices and entities.
Use Aurora when they add invoices, multi-row transactions, or reporting that GSIs cannot do.
ElastiCache (Redis or Memcached) is for sessions, hot keys, and flags. If Redis dies, DynamoDB or Aurora still tells the truth.
OpenSearch is full-text search and logs. Do not make it the only copy of file status. You can copy metadata into search. Keep the source of truth in DynamoDB or Aurora.
| Pattern | Default | Watch-outs |
|---|---|---|
| Known key, high scale, small item | DynamoDB | Hot keys; 400 KB; GSI consistency |
| Relational, joins, reporting | Aurora / RDS | Connections; failover; replica lag |
| Hot keys / session | ElastiCache | Not the source of truth |
| Full-text search | OpenSearch | Not money, not the legal record |
| Analytics / “all files with virus X in 90 days” | Warehouse, or S3 + Athena | Not a DynamoDB SCAN on the API path |
COMMON MISTAKE: Bytes in DynamoDB, metadata in S3. Flip it: bytes in S3, metadata in a database.
Access patterns (write these on the board first):
fileIdcustomerId + createdAt)status (LANDING → SCANNING → CLEAN or REJECTED)Item (DynamoDB):
FILE#<fileId>CUSTOMER#<customerId> and SK FILE#<timestamp>#<fileId> if list-by-customer is the hot path. Then add a GSI on FILE#<fileId> for point getss3LandingKey, s3CleanKey, status, contentType, sizeBytes, sha256, createdAt, updatedAtWhat you do not store: the file bytes, extra PII, or a huge nested scan report. Put details in an S3 sidecar or a short summary.
If they add “billing per file” with invoices and tax, that bounded part can be Aurora. That is not a reason to move the whole file catalog.
“How do you list a customer’s last 50 files?”
Sort key on time. Query plus Limit plus newest first. Not Scan.
“Why not Aurora for everything so we can use SQL?”
Lambda bursts open many connections. We do not need joins for the file catalog. I will add Aurora if the domain is relational. I will not refuse it out of habit.
“Can I read CLEAN right after the scan?”
Read the base table with strong consistency for that GetItem. Do not trust a GSI for that moment.
Access patterns first. I need get-by-id and list-by-customer, so DynamoDB with a key I can write in one minute. The PDF stays in S3. The item is metadata under 400 KB. I am not using DynamoDB as SQL. If they need joins and invoices, Aurora for that part. OpenSearch is search, not the system of record.
Database selection guide
Database selection guide
| Access pattern | First pick | Do not |
|---|---|---|
| Get by key, or list by tenant and day | DynamoDB | Do not SCAN the table as your API. |
| Relational data and transactions | Aurora or RDS | Do not force DynamoDB to act like SQL. |
| Hot keys or a cache | ElastiCache | Do not treat cache as the source of truth. |
| Full text or logs | OpenSearch | Do not use search as the system of record. |
| Analytics | Warehouse or a data lake | Do not put RDS on the request path for this. |
Messaging and workflow8 min
Messaging and workflow
After upload, a queue holds the work. Workers compete for it. A retry must be safe to run twice.
Upload is the easy part. The hard part is what happens next: scan, update status, notify. Messaging is how that work moves. Pick a buffer, not a stream, unless you truly need a stream.
Start from the job: do you need a buffer, a fan-out, a stream you can replay, or a long workflow? Then pick the tool.
| Need | Tool | What it is |
|---|---|---|
| Many workers, a buffer, retries | SQS | A queue. Each message goes to one worker (standard). |
| Fan-out “this happened” | SNS | Pub/sub. One publish, many subscribers. |
| Filter, archive, many AWS sources | EventBridge | A bus plus rules. You can replay from an archive. |
| Ordered high-volume stream, replay by shard | Kinesis | A partitioned log. You manage shards. |
| A long branching workflow you can audit | Step Functions | A state machine. Wait, catch, undo. |
ARCHITECTURE DECISION: Ingest → S3 → EventBridge → SQS → processor is the default document path. Add Step Functions when the flow has branches you must audit, like scan → wait for a vendor → notify → undo.
Visibility timeout must be longer than a slow scan. After 3 failed receives, the message goes to a DLQ (dead-letter queue).
hcl
resource "aws_sqs_queue" "process" {
name = "${var.name_prefix}-process"
visibility_timeout_seconds = 60
redrive_policy = jsonencode({
deadLetterTargetArn = aws_sqs_queue.dlq.arn
maxReceiveCount = 3
})
}
resource "aws_cloudwatch_event_rule" "created" {
event_pattern = jsonencode({
source = ["aws.s3"]
"detail-type" = ["Object Created"]
detail = { bucket = { name = [aws_s3_bucket.docs.bucket] } }
})
}The processor reads the S3 key from the EventBridge payload inside SQS, then updates status and publishes.
python
# processor.py — SQS batch of EventBridge envelopes
def handler(event, _context):
for record in event.get("Records", []):
detail = json.loads(record["body"]).get("detail") or {}
key = (detail.get("object") or {}).get("key")
job_id = key.split("/")[1]
table.update_item(Key={"jobId": job_id}, UpdateExpression="SET #s = :s",
ExpressionAttributeNames={"#s": "status"},
ExpressionAttributeValues={":s": "PROCESSED"})
sns.publish(TopicArn=TOPIC, Message=json.dumps({"jobId": job_id, "s3Key": key}))customerId). Other groups still run in parallel. Do not pick FIFO “just in case.”ChangeMessageVisibility.maxReceiveCount, poison messages leave the main queue. Alarm on DLQ depth. A silent DLQ does not help.COMMON MISTAKE: Kinesis at a 12 files/sec peak. SQS is enough until you need per-key order or replay by shard.
A direct S3→Lambda hook ties storage to compute. Retries and scaling get harder, and a failure hits more of the system. EventBridge (or S3 → SQS) keeps them apart. Archive plus replay answers “reprocess last Tuesday.”
EventBridge Pipes can filter SQS→Lambda. That is fine. Do not stack Pipes, a custom bus, *and* Step Functions for a three-step line.
Use SNS for “file CLEAN” to email, a webhook, a search indexer, or a data lake. Filter so not every subscriber sees every event. HTTPS subscribers must be safe to run twice.
Use it for high-volume telemetry, clickstreams, or “replay from this sequence number.” You own shard count, hot shards, and iterator age. 12 files/sec of PDFs is not a stream problem.
Do not wrap “one Lambda that calls two AWS APIs” in a state machine to look fancy.
Standard vs Express: Standard for long, audited flows (up to a year). Express for high-volume short flows (minutes) with cheaper history. A 4-minute scan is usually Standard if you use Step Functions at all — or skip them and use SQS.
Processors will run twice. Use fileId and a DynamoDB condition so status only moves LANDING → SCANNING → CLEAN. SNS subscribers must tolerate duplicates. Prefer at-least-once plus safe writes over promising “exactly once.”
Object Created on the landing prefix.FileReady.Reprocess Tuesday: replay the EventBridge archive, or query DynamoDB by createdAt and re-enqueue. Do not “replay SQS.” SQS is not a log.
“Notify works, but the metadata write fails?”
Write CLEAN first, then notify. If notify fails, retry from a “pending notify” status. Downstream must ignore a second fileId.
“Why not Lambda calling Lambda?”
Coupled timeouts, no buffer, weak DLQ story. Put a queue between the two sides.
“FIFO because files must stay in order per customer?”
Only if the product needs in-order work per customer. Independent PDFs usually do not. If yes: FIFO plus MessageGroupId=customerId. Otherwise standard SQS.
S3 is the source of truth for bytes. EventBridge sends the create event into SQS so workers can compete and retry. After metadata is CLEAN, SNS tells downstream systems. I page on the DLQ. I am not using Kinesis at 12 files/sec. I add Step Functions if scan becomes a long callback with undo steps, not for a straight line.
Messaging selection guide
Messaging selection guide
| Need | First pick |
|---|---|
| Many workers, a buffer, retries | SQS |
| Tell many subscribers one thing happened | SNS |
| Many AWS sources, plus filter or archive | EventBridge |
| Ordered high-volume stream | Kinesis |
| A workflow you can see and audit | Step Functions |
| User is waiting for a reply | Keep that path sync. Queue the rest. |
Networking8 min
Networking
Users reach the edge. Data stays private. S3 and DynamoDB use gateway endpoints — a private path that skips NAT (the box that gives private subnets internet).
Networking is where boxes sit and how they talk. A messy drawing looks like a product dump. A clean drawing shows edge, compute, and data. Cost lives on the arrows: NAT, cross-AZ, and egress.
INTERVIEW TIP: Most production APIs look like this: CloudFront + WAF → API Gateway or a public ALB → private compute → private data.
Do not start with twenty services. Draw planes. Say each step.
10.0.0.0/16. Draw two Availability Zones or you have not drawn high availability.If your picture has S3 inside a private subnet like an EC2 box, erase it and start at step 8.
INTERVIEW TIP: “API Gateway and S3 are not in my VPC. The VPC exists for the worker and for any database I actually run.”
A gateway endpoint adds a route so private subnets reach S3 and DynamoDB without NAT.
hcl
resource "aws_vpc_endpoint" "s3" {
vpc_id = aws_vpc.main.id
service_name = "com.amazonaws.${var.region}.s3"
vpc_endpoint_type = "Gateway"
route_table_ids = aws_route_table.private[*].id
}
resource "aws_vpc_endpoint" "dynamodb" {
vpc_id = aws_vpc.main.id
service_name = "com.amazonaws.${var.region}.dynamodb"
vpc_endpoint_type = "Gateway"
route_table_ids = aws_route_table.private[*].id
}Walk this until it is easy:
COMMON MISTAKE: NAT Gateway for all S3 and DynamoDB traffic. That is cost and a dependency you did not need.
0.0.0.0/0 on data stores.If ingest Lambda only talks to S3 and DynamoDB public APIs, it often should not be in a VPC.
If the processor must reach a private scanner in the VPC, attach the VPC and add gateway endpoints for S3 and DynamoDB. Forgetting endpoints is how NAT costs more than compute.
| Arrow | Why it hurts | Fix |
|---|---|---|
| NAT for S3/DynamoDB | Per-GB + hourly | Gateway endpoints |
| Cross-AZ chatty traffic | Data transfer | Keep the processor path tight. You still need Multi-AZ for HA of NAT or ALB |
| Egress / CloudFront to the internet | Downloads dominate | Cache clean objects. Do not serve landing |
| Interface endpoints everywhere | Hourly + per-GB | Only where needed |
“The processor cannot reach S3. Walk the route.”
If it is in a VPC: subnet route to the S3 prefix list through the gateway endpoint, security group egress allowed, bucket policy aws:SourceVpce if you locked it. If you see 0.0.0.0/0 → NAT, that is the bug.
“Why is NAT so expensive?”
S3 and DynamoDB bytes are going through NAT. Use endpoints.
“Two VPCs?”
Only if the platform standard says so. Then Transit Gateway or PrivateLink to the scanner. Do not peer everything for fun.
Users never reach data stores. The edge is CloudFront plus WAF. Ingest is API Gateway. File bytes go to S3. If compute sits in a VPC, S3 and DynamoDB use gateway endpoints, not NAT. Security groups are the firewall. I will point at NAT, cross-AZ, and egress as the expensive arrows.
Deployment posture — where each service lives
Deployment posture — where each service lives
Put each box on one of four planes so you stop drawing S3 inside a subnet.
Posture means “what did you deploy, and what does AWS already run?” If you draw S3 like an EC2 box in a private subnet, the rest of the design will drift.
Ask where the box actually runs before you draw it. Then park it on one of these four planes.
| Plane | What lives here | What does not |
|---|---|---|
| 1. Global edge | Route 53, CloudFront, WAF, Shield | Your Lambda, your database |
| 2. Regional managed | API Gateway, default Lambda, S3, DynamoDB, SQS, SNS, EventBridge, KMS, CloudWatch | Things that need your network card (ENI) |
| 3. VPC public subnets | Internet Gateway, NAT Gateway, public ALB | Data stores, processors |
| 4. VPC private subnets | Fargate/EC2, Lambda-in-VPC, Aurora, interface VPC endpoints | S3 “instances,” SQS “instances” |
Rule: If AWS did not give you a subnet id on the resource, it is plane 1 or 2. You connect with IAM, DNS, and maybe a VPC endpoint. You do not “put S3 in private.”
Walk this in the interview. Do not skip.
- Scan is a Lambda layer, a container on a public AWS API, or a SaaS HTTPS API → Mode A. Processor stays plane 2 (Lambda, no VPC).
- Scan is an appliance in *your* VPC, or a host that only accepts private IPs → Mode B. Processor in private subnets. Gateway endpoints for S3 and DynamoDB. NAT only for that vendor URL.
0.0.0.0/0 on data.Mode A — serverless default (this sprint’s lab)
text
Users → API Gateway → Lambda ingest (no VPC) → S3
S3 → EventBridge → SQS → Lambda processor (no VPC) → DynamoDB → SNS
CloudFront + OAC → clean bucket onlyUse when the scanner is a library in the function, or a SaaS you call on AWS’s network. Zero NAT. This is the right default at 1.2 files/s.
Mode B — private worker
text
Users → API Gateway → Lambda ingest (still often no VPC) → S3
S3 → EventBridge → SQS → Fargate (or Lambda-in-VPC) in private subnets
→ gateway endpoints to S3/DynamoDB
→ NAT only to vendor scanner HTTPS
CloudFront + OAC → clean bucket onlyUse when the scanner cannot be reached without a VPC. Forgetting the gateway endpoints is how NAT costs more than compute.
Lambda not in a VPC (Mode A). There is no vpc_config. That is a posture choice.
hcl
resource "aws_lambda_function" "processor" {
function_name = "${var.name}-processor"
runtime = "python3.12"
handler = "processor.handler"
timeout = 60
filename = "processor.zip"
role = aws_iam_role.processor.arn
# no vpc_config — talks to S3/DDB/SQS on the AWS public API
}Mode B — private Fargate plus gateway endpoints (NAT left out on purpose):
hcl
resource "aws_subnet" "private_a" {
vpc_id = aws_vpc.main.id
cidr_block = "10.0.10.0/24"
availability_zone = "${var.region}a"
}
resource "aws_subnet" "private_b" {
vpc_id = aws_vpc.main.id
cidr_block = "10.0.11.0/24"
availability_zone = "${var.region}b"
}
resource "aws_vpc_endpoint" "s3" {
vpc_id = aws_vpc.main.id
service_name = "com.amazonaws.${var.region}.s3"
vpc_endpoint_type = "Gateway"
route_table_ids = [aws_route_table.private.id]
}
resource "aws_ecs_service" "scanner" {
name = "${var.name}-scanner"
cluster = aws_ecs_cluster.main.id
task_definition = aws_ecs_task_definition.scanner.arn
desired_count = 2
launch_type = "FARGATE"
network_configuration {
subnets = [aws_subnet.private_a.id, aws_subnet.private_b.id]
security_groups = [aws_security_group.processor.id]
assign_public_ip = false
}
}| Service | Plane | Deploy how |
|---|---|---|
| Route 53 | 1 | Hosted zone; alias A/AAAA |
| CloudFront + WAF | 1 | Distribution; OAC to clean S3; WAF web ACL |
| API Gateway HTTP API | 2 | JWT/IAM authorizer; Lambda integration; no VPC link unless you force one |
| Transfer Family | 2 (or VPC) | SFTP to landing prefix; same scan path |
| Lambda ingest | 2 | No VPC; short timeout; 202 |
| S3 landing / clean | 2 | Separate prefixes or buckets; KMS; Block Public Access |
| EventBridge + SQS + DLQ | 2 | Rule on Object Created; redrive |
| Lambda processor | 2 or 4 | 4 only for a private scanner |
| Fargate processor | 4 | Private subnets; assign_public_ip = false |
| DynamoDB | 2 | On-demand; keys named; point-in-time recovery |
| SNS | 2 | Fan-out after CLEAN |
| Aurora | 4 | Only if you named SQL queries |
| NAT Gateway | 3 | Optional; one per AZ; not for S3 |
| Gateway VPCE | VPC route | S3 + DynamoDB on private tables |
| Interface VPCE | 4 | Secrets Manager, and the like — only if needed |
| ALB | 3 or 4 | Public vs internal; skip if API Gateway is the door |
“Is ingest Lambda in the VPC?”
Usually no. It talks to S3 and DynamoDB on AWS APIs.
“When do I draw NAT?”
Only if a private worker must call a real internet URL, like a vendor scanner.
Ingest and messaging stay on AWS-managed APIs. I only draw a VPC if the worker must reach something with a private IP. S3 and DynamoDB are not in subnets. If the worker is in a VPC, I add gateway endpoints and I do not send that traffic through NAT. Edge is CloudFront plus WAF on clean objects only.
Scenario — 100k files/day8 min
Scenario — 100k files/day
Run R-SCALE on 100k files a day, with numbers. Then say what changes at 1 million.
This is the main story of the sprint. Do not start with twenty logos. Confirm what they need, do the math, then pick a small set of boxes.
Accept 100,000 files/day over HTTPS, scan them, store metadata, notify downstream. Future is 1,000,000/day.
Ask: SFTP too? Object size? Scan SLA? How many notify consumers? How fast must we recover, and how much data can we lose?
text
HTTPS/SFTP → landing S3 → EventBridge → SQS+DLQ → scan
→ clean S3 + DynamoDB status → SNS FileReady
→ CloudFront origin = clean onlytext
100,000 files/day ≈ 1.2 files/sec average
Peak 10× ≈ 12 files/sec
1,000,000/day ≈ 12 files/sec average, 120/sec peakObject size changes everything.
10 MB × 1M/day ≈ 10 TB/day ingest. That moves S3 PUT cost, scan time, Lambda honesty, and download egress. Always ask size.
12 files/sec is not a reason for Kinesis, EKS, or Kafka.
Work the four prompts in the Napkin math page (documents, REST API, SFTP burst, large media). If you cannot get from “10k videos of 200 MB” to “2 TB/day, Fargate,” keep practicing Scale.
INTERVIEW TIP: Name security and the DLQ in the first minute. Then pick services.
| Question | Why it changes the design |
|---|---|
| Human, partner SFTP, or service? | API Gateway vs Transfer Family |
| Unit of work? | File vs API vs stream |
| Failure you cannot accept? | Lost 202 vs serving an unscanned file |
| Scan: library vs SaaS? | Lambda vs Fargate vs VPC |
| Metadata queries? | DynamoDB keys vs Aurora |
| Notify: 1 webhook vs 20 systems? | SNS vs EventBridge |
| Compliance / residency? | Region, customer-managed key, audit |
| Plane | Default | Why |
|---|---|---|
| Ingest HTTPS | API Gateway + Lambda presign (or Transfer for SFTP) | Payload limits; S3 owns bytes |
| Bytes | S3 landing (hostile) → clean after scan | Source of truth for objects |
| Event | EventBridge → SQS + DLQ | Buffer, retry, reprocess |
| Process | Lambda; Fargate if the scan is long | Queue absorbs 10× |
| Metadata | DynamoDB, keys named | Get and list patterns |
| Notify | SNS | Fan-out |
| Edge download | CloudFront + WAF on clean | Never landing |
| Security | Customer-managed key, Block Public Access, tight roles | Landing is not product read |
A strong answer names API or Transfer + S3 landing + EventBridge/SQS + processor + DynamoDB + SNS, then DLQ and KMS. Not a data lake. Not OpenSearch as the source of truth.
Use managed regional services. The queue absorbs a dead processor. Status updates must be safe to retry. Health means “I can accept an upload,” not “scan finished.” If the scanner is down, still return 202 and park the files.
“Why not EKS?”
This is an event problem, not a cluster problem. The processor can move later. The S3 contract stays the same.
“Why not EBS?”
EBS is a disk for one machine. It is not a multi-reader object store.
“Put the file in DynamoDB?”
400 KB limit. Bytes in S3. Metadata in the database.
I will confirm who uploads, file size, and what failure we cannot accept. 100,000 a day is about 1.2 files per second, or about 12 at a 10× peak. I keep upload thin: API Gateway or Transfer into a hostile landing bucket, then EventBridge and SQS feed a scanner. Clean files go to a second prefix, status lives in DynamoDB, and SNS notifies after CLEAN. CloudFront serves clean only. At 1 million a day I scale workers and the scanner, not the whole design.
Service selection matrix
Service selection matrix
| Need | First choice | Alternative | Avoid when |
|---|---|---|---|
| Bursty HTTP API | API Gateway + Lambda | ALB + Fargate | You need to process a 20-minute request body |
| Long workers | ECS Fargate or Batch | EC2 Auto Scaling | You are hitting the Lambda 15-minute limit |
| Objects | S3 | EFS only if you need a shared POSIX file system | Using EBS as a shared store |
| Metadata you look up by a known key | DynamoDB | Aurora if the data is relational | Using SCAN as your API |
| Buffer | SQS | Kinesis if you need strict order per shard | Chaining Lambda to Lambda with no queue |
| Fan-out | SNS or EventBridge | — | Hard-coding many extra invokes |
| Workflow | Step Functions | A queue plus a status machine | Hiding state only in the UI |
| Edge | CloudFront + WAF | Regional API only | Leaving the origin open to bypass |
| Secrets | Secrets Manager | SSM SecureString | Secrets in Git or plaintext env vars |
| Hybrid network | Transit Gateway or Direct Connect | VPN first | Peering every VPC when you have ~30 VPCs |
Napkin math workbook (four use cases)
Napkin math workbook (four use cases)
Turn a fuzzy prompt into per-second rate, bytes per day, and in-flight workers before you pick a service.
Interviews grade the method. List prices change. The arithmetic does not. If you skip size, you cannot explain why you picked Lambda or Fargate.
Write 86,400 on the board once (24 × 60 × 60). You will use it every time.
INTERVIEW TIP: “I am going to turn this into per-second and bytes, then pick compute. Please stop me if object size is not 2 MB.”
Round freely. 1.157 → 1.2. For peak, ask, or say “I will assume 10× unless you have a burst profile.”
Then pick Lambda vs Fargate vs a cluster.
Prompt: 100,000 files/day over HTTPS, scan, store metadata, notify. Future 1,000,000/day.
Step 1 — count. 100,000 files/day. Future 1,000,000.
Step 2 — average.
text
100,000 / 86,400 ≈ 1.157 → say 1.2 files/s
1,000,000 / 86,400 ≈ 11.57 → say 12 files/sStep 3 — peak. They did not give a peak. Assume 10× business hours.
text
100k peak ≈ 12 files/s
1M peak ≈ 120 files/sStep 4 — size. Ask. If they shrug, assume 2 MB and write it.
text
100,000 × 2 MB = 200,000 MB = 200 GB/day ingest
1,000,000 × 2 MB = 2,000 GB/day = 2 TB/dayIf they say 10 MB at 1M/day: 10 TB/day. Storage, scan time, and egress just moved more than request rate did.
Step 5 — concurrency. Ask scan time. Library scan ≈ 8 s. Appliance ≈ 90 s.
text
At 1M peak 120/s, 8 s scan: 120 × 8 = 960 in-flight
At 1M peak 120/s, 90 s scan: 120 × 90 = 10,800 in-flightWhat the numbers decide
| Signal | Decision |
|---|---|
| 1.2–12 files/s | Not Kinesis, not Kafka, not EKS “for scale” |
| 200 GB–2 TB/day at 2 MB | S3; watch lifecycle and versions, not EC2 size |
| 8 s × 12/s ≈ 96 workers | Lambda is honest |
| 90 s × 120/s ≈ 10,800 | Fargate (or a fleet). Lambda’s 15-minute timeout is fine; concurrency and /tmp are not |
| 10 TB/day | Scanner capacity and S3 PUT/storage matter more than compute type |
Say it: “Twelve files a second peak at 100k/day is a queue, not a cluster. I need object size before I pick Lambda.”
Prompt: 20,000 daily active users, about 40 API calls per user per day, p95 under 200 ms.
Step 1. 20,000 × 40 = 800,000 calls/day.
Step 2. 800,000 / 86,400 ≈ 9.3 requests/s average.
Step 3. Login or home spike. Assume 20× unless they give analytics.
text
Peak ≈ 9.3 × 20 ≈ 186 requests/sStep 4. JSON 5 KB. Bytes are small next to documents.
text
800,000 × 5 KB ≈ 4 GB/dayStep 5. Handler 50 ms = 0.05 s.
text
Concurrency ≈ 186 × 0.05 ≈ 9Decision: API Gateway + Lambda (or ALB + ECS if you already have that platform or need WebSockets). You do not need Kinesis. You do need auth, WAF, and safe POSTs. GB/day does not pick the database. Access patterns do.
Prompt: Partners drop 100,000 files by SFTP between 01:00 and 05:00.
Step 1. Still 100,000 files — but not over 24 hours.
Step 2–3. Window = 4 hours = 14,400 seconds.
text
100,000 / 14,400 ≈ 6.94 → say 7 files/s sustained for four hoursThere is no “1.2/s average” for the processor. The daily average hides a batch.
Step 4. Same size question. 2 MB × 100k = 200 GB in four hours.
Step 5. 7/s × 8 s scan ≈ 56 in-flight. Comfortable. 7/s × 90 s ≈ 630.
Decision: AWS Transfer Family into the same landing bucket. Same EventBridge → SQS → processor. Size the queue and workers for 7/s, not 1.2/s. SQS exists so ingest and process can run at different speeds.
Say it: “I will not divide by 86,400 if they told me a four-hour window.”
Prompt: 10,000 videos/day, ~200 MB each, users stream a subset.
Step 1–2. 10,000 / 86,400 ≈ 0.12 files/s average. Peak 10× ≈ 1.2/s. Tiny request rate.
Step 4.
text
10,000 × 200 MB = 2,000,000 MB = 2 TB/day ingestStep 5. Transcode 4 minutes = 240 s.
text
Peak concurrency ≈ 1.2 × 240 ≈ 288 Fargate tasks (order of magnitude)Lambda: 200 MB object plus minutes of CPU → wrong model (timeout, /tmp, cost). Use S3 + Fargate or Batch + CloudFront.
Egress (the cost question). If 30% of objects are downloaded once:
text
0.30 × 2 TB = 600 GB/day outPoint at CloudFront + cache, not at EC2.
Say it: “This is not a request-rate problem. It is a bytes and duration problem. I will not pick Lambda because the file count looks small.”
DynamoDB writes. One ~1 KB item per file. 1 write/s ≈ 1 WCU for items ≤ 1 KB. 100k/day ≈ 1.2 writes/s. At 1M/day and 120/s peak with a 2 KB item, about 240 WCU at peak. Pick Aurora when they named a query DynamoDB keys cannot answer — not because “we might report someday.”
NAT vs endpoints. 10 TB/day through NAT is the bill. A gateway VPC endpoint for S3 keeps that traffic off NAT. Name the GB and the fix. You do not need the current list price.
Queue depth. If processors die for 10 minutes at 12 files/s: 12 × 600 = 7,200 messages on SQS. The queue is the shock absorber. Health means “I can accept upload,” not “scan is caught up.”
100,000 a day is 1.2 per second. I will assume 10× peak unless you have a window — call it 12 per second. I need object size: at 2 MB that is 200 GB/day. An 8-second scan is about 100 in-flight at that peak, so Lambda behind SQS. If you tell me 200 MB files or 90-second scans, I move the worker to Fargate and I keep the same S3 contract.
Napkin math pocket card
Napkin math pocket card
BayLearn · AWS Solutions Architect Interview Sprint
Seconds/day = 86,400 (24 × 60 × 60)
| Prompt | Avg | Peak (10× unless noted) | Bytes (example) | Default |
|---|---|---|---|---|
| 100k files/day | 1.2/s | 12/s | 2 MB → 200 GB/day | SQS + Lambda |
| 1M files/day | 12/s | 120/s | 2 MB → 2 TB/day | Same; watch scanner |
| 100k in 4 h SFTP | — | 7/s sustained | 2 MB → 200 GB in 4 h | Transfer + same processor |
| 20k DAU × 40 calls | 9.3/s | ~190/s at 20× | JSON → ignore GB | API GW + Lambda |
| 10k × 200 MB video | 0.12/s | 1.2/s | 2 TB/day | Fargate + CloudFront |
Do not divide by 86,400 if they gave you a window. Do not pick Kafka at 12/s. Do not pick Lambda for 200 MB files that take minutes.
6Rs — if they already have a system
6Rs — if they already have a system
If they already have file shares or a data-center scanner, pick a 6R per part. Then go back to R-SCALE.
If the prompt is a new platform, stay on the canvas. If something already exists, the 6Rs are the migration sentence — not the architecture.
The 6Rs are six ways to move (or not move) a system.
How you use this
“I would replatform the bytes to S3 this quarter and refactor ingest to the serverless path we designed. I would retain the legal vault until they give me an RPO that S3 can meet.”
Core AWS knowledge check5 min
Core AWS knowledge check
This module is about picking compute, storage, databases, messaging, and networking for one document platform.
You have about 50 minutes of choosing, not a tour of the console. Open the lessons in order. Do not skip the scenario.
| Lesson | You are done when you can… |
|---|---|
| Compute | Defend Lambda vs Fargate vs EKS vs EC2 with a *limit* that forces the next option |
| Storage | Draw hostile landing vs clean; explain why EBS is not where documents live |
| Databases | Write three queries and a DynamoDB key (or say why Aurora) |
| Messaging | Draw S3 → EventBridge → SQS → processor → SNS and a DLQ |
| Networking | Draw two AZs, place endpoints, mark NAT optional, name each service’s plane |
| Scenario — 100k/day | Speak a full R-SCALE with napkin math in five minutes |
The interviewer is not grading a product list. They want a default, plus the one fact that would change it.
Name the access pattern or workload shape. Pick a default. Name the condition that would change the pick.
Then take the knowledge check. If one topic is weak, re-read that lesson, not this page.
The service selection matrix download is a pocket card. The lessons are the full notes.
You will
High availability8 min
High availability
HA means users can still upload if one box or one Availability Zone (one data-center group) dies — inside one Region.
Interviewers mix HA and DR on purpose. Multi-AZ is not disaster recovery. Multi-AZ means more than one Availability Zone (one data-center group) in the same Region.
INTERVIEW TIP: “HA is an AZ or instance dying at 2 p.m. DR is the Region gone. I will not mix the two.”
Name what can fail: instance → AZ → Region → account (IAM lockout) → login provider → SaaS scanner → a bad config.
HA covers instance and AZ. A whole Region down, or an IAM lockout, is not HA.
What Multi-AZ means
| Component | HA story | What you still lose |
|---|---|---|
| S3, DynamoDB, SQS, SNS, API Gateway | Regional. AWS spreads AZs for you. | The Region, IAM, or a bad key policy |
| Lambda | Regional. If it is in a VPC (your private network), put subnets in at least two AZs. | Limits and anything the function calls |
| Aurora | A sync standby in another AZ. Failover takes seconds. | In-flight work; old DNS cache |
| NAT / ALB | You place them in at least two AZs. | A bad security group |
| Your ECS service | Tasks in at least two AZs. | Slow image pull during failover |
COMMON MISTAKE: Stopping at “we are Multi-AZ.” Say what takes over and how long the user feels it.
Keep compute stateless
Do not store “file 123 is CLEAN” only on a server disk. Put session and status in DynamoDB (a key-value table) or Aurora (a managed SQL database). If uploads live only on instance disk, one box dying loses files.
Health checks that match real work
TCP port 443 being open is not “I can save metadata and send a queue message.”
Ready means: DynamoDB is reachable, SQS (the queue) can accept a send, and KMS (the encryption key service) works.
If not ready, return 503. Do not accept uploads you cannot save.
Queues absorb a spike
Scale workers on queue age and depth, not only CPU. If one AZ dies, the other AZ drains the same regional SQS. Make work idempotent — a retry must not notify twice.
One AZ gone — say this story
CLEAN after catch-up.If the scanner SaaS is down: still accept the file. Status stays LANDING or PENDING_SCAN. Do not 500 the upload. Ingest can be up even if the full product promise is not.
ARCHITECTURE DECISION: Two Regions is DR or active-active. That needs data rules. It is not HA.
“HA is in-Region. I use regional services and stateless workers in more than one AZ (Availability Zone) when they sit in a VPC. The queue holds extra work. Health means I can save an upload, not just that TCP is open. If the scanner dies, I still take files. A second Region is DR, with RTO and RPO — how fast we must be back, and how much data we can lose — not HA.”
If they ask
“AZ gone. File uploaded 10 seconds ago?”
If the S3 PUT finished: the object is there; the processor retries. If the PUT did not finish: the client retries. Conditional writes on metadata stop duplicates.
“Dashboard green, files stuck?”
The health check was only TCP. Queue age was not alarmed. The scanner hung, but uploads still looked fine.
“Two Regions for HA?”
No. That is DR. You need rules for who writes the data.
Disaster recovery8 min
Disaster recovery
Let RTO and RPO — how fast you must be back, and how much data you can lose — pick the DR pattern.
HA keeps you up in one Region. DR is for a Region going down, or a restore from backup.
INTERVIEW TIP: If they did not give RTO and RPO, ask. Do not guess zero and zero.
Pick the cheapest pattern that meets the numbers
| Pattern | Second site | Typical RTO | Cost |
|---|---|---|---|
| Backup / restore | Backups plus a runbook | Hours | Lowest |
| Pilot light | Data copied; compute off or tiny | Tens of minutes to hours | Low |
| Warm standby | A smaller live stack | Minutes to tens of minutes | Medium |
| Active / passive | Full stack; traffic on one side | Minutes if you practice | High |
| Active / active | Two Regions serving | Near-zero *if* you design for it | Highest, and harder |
Order: backup/restore → pilot light → warm standby → active/passive → active/active.
What to copy for this platform
| Data | Approach | Watch out |
|---|---|---|
| S3 bytes | Versioning. Add CRR (copy to another Region) if RPO needs it. | Do not copy unscanned landing into a Region that serves downloads |
| DynamoDB | PITR (point-in-time restore) always. Global Tables only if you have conflict rules. | Status can lag. CLEAN is a real decision. |
| SQS | Do not copy the queue. Replay from S3. | The queue is not the source of truth |
| KMS keys | Plan Multi-Region keys or replica keys. | “Primary key gone” is its own incident |
| DNS | Route 53 failover with tested health checks | Flipping, then flipping back |
Restore is the product
A DR picture with no timed drill is a wish. Say you restore into a scratch account on a schedule and write the stopwatch in the runbook.
A safe default (unless they need about a 15-minute RTO and near-zero RPO)
ARCHITECTURE DECISION: Active-active is a consistency and cost project. Status flips (
CLEANvsREJECTED) need conflict rules.
“I will not draw a second Region until I have RTO and RPO. I start with PITR, S3 versioning, and a restore drill. S3 is the source of truth — I reprocess from S3. I do not copy SQS. Active-active needs rules for status. I will not treat eventual consistency as fine for CLEAN vs REJECTED.”
If they ask
“Primary Region KMS key gone?”
Use the deletion window. Plan Multi-Region keys. Encrypt backups with a key you can still use in DR. Do not let one admin schedule key deletion with no break-glass.
“How do objects and metadata stay in sync?”
Prefer one writer. If two writers: idempotent keys, a status state machine, or a “Region of record” per file.
“Who flips DNS, and how do you flip back?”
A named role, a runbook, a health check that means “we can ingest,” and a failback rule (data lag has caught up).
DR matrix
DR matrix
| Pattern | Typical RTO | Typical RPO | Relative cost | Use when |
|---|---|---|---|---|
| Backup and restore | Hours | Hours | $ | Downtime of hours is OK |
| Pilot light | Tens of minutes to hours | Minutes | $$ | Core data is copied. Compute is off or tiny. |
| Warm standby | Minutes | Minutes | $$$ | A smaller live stack is already running |
| Active / passive | Minutes | Seconds to minutes | $$$ | Failover follows a health check |
| Active / active | Seconds | Near zero, if you designed for it | $$$$ | You need local writes, and a story for conflicts |
Multi-AZ is high availability. It is not disaster recovery.
Security10 min
Security
Treat every upload as unsafe until it is scanned and moved to clean. Then prove who can read what.
A list of logos is not a security answer. Interviewers want a path for a bad file, and IAM a reviewer can read.
IAM is who is allowed to do what. KMS is AWS Key Management Service — the keys that encrypt data.
INTERVIEW TIP: “Every upload is unsafe until scanned and promoted. Encryption, identity, and the public edge are in the first diagram.”
**Processor IAM — actions and resources, not ***
json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ReadLanding",
"Effect": "Allow",
"Action": ["s3:GetObject"],
"Resource": "arn:aws:s3:::docs-bucket/landing/*"
},
{
"Sid": "WriteClean",
"Effect": "Allow",
"Action": ["s3:PutObject"],
"Resource": "arn:aws:s3:::docs-bucket/clean/*"
},
{
"Sid": "Metadata",
"Effect": "Allow",
"Action": ["dynamodb:UpdateItem", "dynamodb:GetItem"],
"Resource": "arn:aws:dynamodb:us-west-2:123456789012:table/jobs"
},
{
"Sid": "Decrypt",
"Effect": "Allow",
"Action": ["kms:Decrypt", "kms:GenerateDataKey"],
"Resource": "arn:aws:kms:us-west-2:123456789012:key/your-cmk"
}
]
}Threats that matter here
Landing vs clean
Landing is the first bucket. Treat it as unsafe until scanned. Clean is what users download.
text
Client → presigned PUT → landing (no public, no product origin)
→ scanner role reads landing only
→ CLEAN: copy to clean bucket; metadata status=CLEAN
→ REJECT: quarantine; alert; no FileReady
Product CloudFront origin = CLEAN onlys3:GetObject on clean.COMMON MISTAKE: A public S3 ACL “for testing.” That is how many interview case studies start.
Encryption and keys
Deny PUTs that are not encrypted (s3:x-amz-server-side-encryption).Decrypt. Rotate keys.IAM in plain words
Talk actions + resources + conditions:
s3:GetObject on landing, s3:PutObject on clean, dynamodb:UpdateItem on the table, kms:Decrypt on the CMK, sqs:DeleteMessage on the work queue — not *.aws:SourceAccount / aws:SourceArn on bucket notifications (stops confused deputy).Edge
Presigned URLs
Short expiry. One verb. Made by ingest Lambda. Prefer CloudFront signed URLs or cookies for downloads so you can revoke at the edge. Do not log query strings.
“Landing is unsafe until we scan it. Clean is what users download. I put a customer-managed key on both. Three roles: ingest, process, download. WAF on the public edge. CloudTrail and GuardDuty stay on. Presigned URLs expire. If ingest keys leak, ingest still cannot read clean.”
If they ask
“Contractor access key leaked. What can they read?”
Only what that identity’s policies allow. That is why ingest is not download. Rotate the key. Check CloudTrail. Check GuardDuty IAM findings.
“Prove a file was not served before scan.”
CloudFront origin is clean only. Metadata is CLEAN before notify. CloudFront cannot use OAC on landing. Audit GetObject on clean.
“SSE-S3 vs SSE-KMS vs SSE-C?”
CMK for customer docs (policy and audit). SSE-C only if they must hold the key. SSE-S3 for low-sensitivity internals.
Security checklist
Security checklist
Multi-account follow-up
Multi-account follow-up
The app diagram is one account. The trust diagram is Organizations, Identity Center, and SCPs — who owns login, and what the account is not allowed to do.
After Lambda and a CMK, they often ask who owns the account. Keep this to one minute.
COMMON MISTAKE: Naming Control Tower as a magic box. If you name it, say it vends accounts and baselines. You can still draw the OUs without it.
“The app diagram is one account. The trust diagram is Organizations, Identity Center, and SCPs. I would not put production ingest in the account I used for this lab.”
Observability8 min
Observability
Watch the user journeys. Do not watch forty default AWS graphs.
Logs and dashboards only help if they match what a customer feels. Alarm what hurts people, not every function start.
An SLO is a promise you can measure, like “files become CLEAN in 5 minutes.”
INTERVIEW TIP: Alarm on user-visible failure, not on every Lambda invocation.
Define three journeys before metrics:
CLEAN or REJECTED in the promised timeSignals that match this platform
| Signal | Why | Where |
|---|---|---|
| Ingest 4xx / 5xx and latency | Client pain | API Gateway / CloudFront |
| Presign success vs S3 PUT complete | Abandoned uploads | Lambda + S3 metrics |
| Queue depth and age | Processor falling behind | SQS |
| Processor errors + DLQ count | Work dying quietly. A DLQ is a dead-letter queue — messages that failed too many times. | Lambda + SQS |
End-to-end: PUT → metadata CLEAN | The real SLO | Custom metric / EMF (metrics written from logs) |
KMS / IAM AccessDenied | Bad config or attack | CloudTrail / metrics |
| Scan duration and reject rate | Capacity and abuse | Processor |
Traces (X-Ray or OpenTelemetry) carry one trace id from the API through the processor. Put fileId in every log line (structured JSON). That is how you find one file at 2 a.m.
Logs — keep vs skip
Keep: fileId, status changes, error codes, latency, request id, approximate size.
Skip: raw file bytes, full presigned URLs, extra PII (personal data).
COMMON MISTAKE: Logging every payload at 1M files/day. That is a cost problem and a data leak.
Set retention. Infinite CloudWatch Logs is a cost arrow. Use metric filters or EMF for totals. Do not make a unique metric per fileId.
Alarms that should page a person
Do not page on “Lambda concurrent executions high” during a planned peak. Do not page only on CPU of a serverless function.
Dashboards
One row per journey: ingest, pipeline, notify. A wall of default widgets hides the outage.
“The file vanished” — walk this
fileId or customer + time windowfileIdCLEAN but downstream says noIf the dashboard is green and the DLQ is full, the dashboard is missing the DLQ.
“I watch upload-accepted, time-to-CLEAN, and notify. I alarm on DLQ and SLO burn, not on invocations. Logs are JSON with fileId, no payloads. Traces stitch the async hop. Retention is finite. At 1M/day I watch log cost as hard as compute.”
If they ask
“Keep observability cheap at 1M/day?”
Sample debug logs. Use EMF metrics. Do not log bodies. Shorter retention. Sample traces, with more samples on errors.
“X-Ray vs OpenTelemetry?”
Either is fine. Be consistent across Lambda and Fargate. Do not skip traces because the path is event-driven.
Cost awareness6 min
Cost awareness
You do not need list prices. You need to know which line items explode and what you would cut first.
Cost is part of R-SCALE — Limitations and Evolution. Compute is often cheap if you stay event-driven. Moving data and always-on networking usually cost more.
INTERVIEW TIP: Point at the most expensive arrow on your own diagram before the interviewer does.
Five cost buckets — write them on the canvas
If you cannot rank those five for *this* diagram, you are not done.
Expensive arrows
| Arrow | Why it grows | What you do |
|---|---|---|
| NAT for S3/DynamoDB | You pay per GB through NAT (a box that gives private subnets internet) | Gateway endpoints (a private path to S3/DynamoDB that skips NAT) |
| Cross-AZ bytes | Chatty traffic between AZs | Regional queues. Know when Multi-AZ NAT is needed. |
| Egress / CloudFront | Downloads are much bigger than uploads | Cache clean objects. Do not serve landing. |
| CloudWatch Logs | Ingest × retention × how chatty you are | No payloads. Short retention. |
| Always-on EC2 for a burst | Idle most of the week | Queue + Lambda or Fargate |
| S3 Standard forever | 10 TB/day becomes a museum | Lifecycle. Intelligent-Tiering, with eyes open. |
| KMS per object without Bucket Keys | Huge request volume | Turn on Bucket Keys |
| Global Tables | Write units × Regions | Do not buy this just to claim a better RPO |
| S3 LIST as a job | You pay per 1,000 keys | Event + keys in DynamoDB |
Skip in the first month
100k vs 1M
100k/day, 1 MB objects: about 100 GB/day. Lambda is milliseconds. Watch NAT if Lambda is in a VPC the wrong way, log volume, and download egress.
1M/day, 10 MB: about 10 TB/day. S3 PUT, storage, and lifecycle dominate. Scanner cost and Fargate hours if Lambda cannot finish the scan. KMS request volume. CloudFront egress if people download.
To cut about 30% without changing the SLO: endpoints, shorter log retention, expire old versions, stop LIST jobs, right-size Fargate, cache downloads.
“At this rate, compute is cheap if we stay event-driven. I am watching NAT, egress, logs, and storage versions. I will not buy Savings Plans until the curve is stable. Spot is for batch that can stop, not ingest. Here are the three most expensive arrows on this diagram…” Then point.
If they ask
“Would you cache documents at the edge?”
Clean, not sensitive, cacheable — yes, with signed URLs or OAC. Never cache landing. Private content needs a planned CloudFront plus signed cookie or URL story.
“Last month was mostly NAT?”
S3 and DynamoDB were going through NAT. Add gateway endpoints. Then check interface endpoints you did not need.
Production knowledge check5 min
Production knowledge check
This module is how the platform stays up when something fails, how you recover, how you keep it safe, how you watch it, and how you keep the bill honest.
A design that only works on a slide is not ready. Interviewers ask what fails, who gets paged, and what it costs.
Do not mix these five ideas. They are different questions.
Read the five lessons in order. Then take the knowledge check.
| Lesson | You are done when you can… |
|---|---|
| High availability | Say what happens if one Availability Zone (one data-center group) goes down |
| Disaster recovery | Pick a restore plan from RTO/RPO numbers — how fast you must be back, and how much data you can lose. Do not guess zero and zero. |
| Security | Walk landing vs clean, and name three IAM roles (who is allowed to do what) |
| Observability | State one SLO (a promise you can measure), three metrics, and two alarms that should page a person |
| Cost | Rank three expensive arrows on *your* diagram |
Keep them separate
If they ask about DR and you say “we are Multi-AZ,” you answered the wrong question. Multi-AZ means more than one Availability Zone in the same Region. That is HA, not DR.
Work HA → DR → Security → Observability → Cost as the full lessons. This page is only the map.
The DR matrix and security checklist downloads are pocket cards.
INTERVIEW TIP: “HA is an AZ dying this afternoon. DR is the Region gone. I will not mix the two.”
You will
Document platform design45 min
Document platform design
You design the document platform in 45 minutes. Then you explain it for 15 minutes.
This is the same 100k-files story from Module 2, taken all the way to a canvas: diagram, data flow, security, failure, watch, DR, cost, and trade-offs.
Later you may go to 1M files/day. Say what that changes.
Prompt
Ingest over SFTP and HTTPS. Keep files safe. Scan for malware. Check metadata. Do the heavy work after upload. Notify downstream. Audit. Retry. Encrypt. Add dashboards, alerts, and disaster recovery. Think about multi-region — do not require it until RTO and RPO (how fast you must be back, and how much data you can lose) say so.
You are done when you have
Use the architecture canvas lesson as the template. Use the review checklist on yourself before you stop.
text
Users/Partners
→ Route 53 → CloudFront+WAF (downloads of CLEAN only)
→ API Gateway + Lambda (presign) | Transfer Family (SFTP)
→ S3 landing (KMS, BPA)
→ EventBridge → SQS + DLQ → Processor
→ S3 clean + DynamoDB + SNSA solid first pass (you must still *explain* it)
| Plane | Default |
|---|---|
| DNS / edge | Route 53, CloudFront + WAF on clean downloads |
| HTTPS ingest | API Gateway + Lambda presigned S3 PUT |
| SFTP | Transfer Family → landing |
| Bytes | S3 landing (unsafe) → scan → S3 clean |
| Events | EventBridge → SQS + DLQ |
| Process | Lambda; Fargate if scan is long |
| Metadata | DynamoDB (keys from access patterns) |
| Notify | SNS or EventBridge |
| Security | CMK, BPA (Block Public Access), least privilege |
| Observe | Ingest, queue age, DLQ, time-to-CLEAN |
| DR | PITR + versioning until numbers demand more |
You *may* add if requirements need them: Step Functions (async vendor scan), Aurora (billing), RDS Proxy, GuardDuty Malware Protection, S3 Inventory for audit batches.
Do not add in pass one: EKS “for later,” OpenSearch as the source of truth, SageMaker, a data lake, Kinesis at 12 files/sec, public buckets.
45-minute clock
| Minutes | Do this |
|---|---|
| 0–5 | R: questions + assumptions |
| 5–10 | S: napkin math + size |
| 10–25 | C: diagram + data flow |
| 25–35 | A, security, failure, DLQ |
| 35–40 | Watch the system, cost arrows |
| 40–45 | L/E: 10×, what you give up, DR in one line |
If you go quiet, talk R-SCALE. Silence looks like panic.
15-minute defense
Expect: Why not EKS? Why not EBS? Why not Global Tables? How do you reprocess Tuesday? What if the scanner is down? NAT bill? File in DynamoDB?
Answer from Modules 2–3. Do not invent a new architecture under pressure.
How this ties to the lab
The lab is the serverless slice (API → Lambda → S3 → EventBridge → SQS → Lambda → DynamoDB → SNS). Passing the challenge means you can explain the rest (Transfer, CloudFront, DR, cost). Terraform does not need every box.
INTERVIEW TIP: If they change a requirement at minute 40, show how R-SCALE absorbs it. SFTP adds Transfer Family. 2 GB files move scan to Fargate. Do not redraw from zero.
Architecture review checklist
Architecture review checklist
6Rs — if they already have a system
6Rs — if they already have a system
If they already have file shares or a data-center scanner, pick a 6R per part. Then go back to R-SCALE.
If the prompt is a new platform, stay on the canvas. If something already exists, the 6Rs are the migration sentence — not the architecture.
The 6Rs are six ways to move (or not move) a system.
How you use this
“I would replatform the bytes to S3 this quarter and refactor ingest to the serverless path we designed. I would retain the legal vault until they give me an RPO that S3 can meet.”
Architecture canvas15 min
Architecture canvas
This page is the one-page worksheet you fill, then explain.
The challenge is 45 minutes. A blank board wastes time. Fill this table, then talk to it.
| Section | Your notes |
|---|---|
| Business goal | Ingest, scan, check, store, and send documents at 100k–1M files/day |
| Functional requirements | SFTP + HTTPS, scan, metadata, async work, notify, audit |
| Non-functional | Encryption, retries, dashboards, alerting, DR |
| Scale | 100k/day now (~1.2/s average); 1M/day later (~12/s average, plan 10× peak) |
| Compute | Thin ingest (API Gateway + Lambda, or Transfer Family). Processors on Lambda or Fargate |
| Storage | S3 landing / clean / quarantine. Versioning + KMS |
| Database | DynamoDB for job + metadata (Aurora only if you need SQL on the hot path) |
| Messaging | EventBridge → SQS; SNS for downstream; Step Functions if the workflow is long |
| Security | WAF, IAM least privilege, KMS, scan before promote, CloudTrail |
| Networking | Private processors, gateway endpoints for S3/DynamoDB, CloudFront at the edge |
| Observability | Queue depth, DLQ (dead-letter queue), scan fail %, p99 process time (slowest 1%), 5xx |
| Availability | Multi-AZ ingest and data (HA in one Region) |
| DR | Ask RTO/RPO. Start with PITR + versioning. Add S3 CRR, a metadata replica, and Route 53 failover if the numbers need them. |
| Cost | Endpoints vs NAT; storage class; log volume; avoid always-on EKS |
| Trade-offs | Lambda time vs Fargate; DynamoDB vs Aurora; active-passive vs active-active |
| Future | Prefix sharding, reserved concurrency, second-region ingest |
Walk the table top to bottom. Do not start with extra logos. If a row is empty, say your assumption out loud and write it down.
You will
How to practice the bank5 min
How to practice the bank
Thirty minutes. Do not try to finish all 100.
The bank is 100 interview stories in plain English. Each one has a simple answer, what they want to hear, common mistakes, and extra questions with answers. Reading quietly is not practice.
Open Question bank (100 questions) in this module — the prompts are on the page. Filter by topic. Answer out loud, then reveal.
Architecture 15 · Compute 10 · Networking 15 · Storage 10 · Database 15 · Security 15 · Reliability 10 · Cost 10
COMMON MISTAKE: Reading answers silently and feeling prepared.
Spend the 30 minutes on your weakest two assessment dimensions plus five Architecture questions.
Question bank (100 questions)25 min
100 prompts. Pick a topic. Answer out loud. Then open the answer.
Q-001 · Architecture · hard
A bank VP says: put our loan-document website on AWS this quarter. They have not said who uploads, how many files, or what rules apply. What do you do in the first 10 minutes? What do you not draw yet?
Q-002 · Architecture · hard
A hospital has 80,000 new patient PDFs per day. Doctors want to search a file within 60 seconds after upload. Show the simple math. Then say what those numbers let you use, and what they rule out.
Q-003 · Architecture · hard
A startup of 8 people wants Kubernetes (EKS), a service mesh, and 40 tiny services for a file pipeline. They process about 1 file per second. They want you to say yes. What do you say instead, and why?
Q-004 · Architecture · medium
The interviewer says: draw a production document system on AWS. Users upload with HTTPS and SFTP. You scan files, save status, notify others, and let people download. What do you draw first, and in what order?
Q-005 · Architecture · hard
A phone app must show Document received in under 200 milliseconds. Virus scan and text read (OCR) take 8 to 40 seconds. Product wants one API that does all of it. How do you design this, and what do you tell product?
Q-006 · Architecture · hard
Product wants one S3 folder for all files so nurses are not confused. Security wants two places: new uploads, and files that passed the scan. How do you explain two buckets in simple words?
Q-007 · Architecture · hard
Your design is for 100,000 files a day. Next year it may be 1,000,000 a day, and files may be 10 MB, not 1 MB. What stays the same? What must change?
Q-008 · Architecture · medium
Partners drop 40,000 files by SFTP in 4 night hours. A new app will also upload photos all day over HTTPS. Do you build two systems, or one? How do you size the night rush?
Q-009 · Architecture · hard
An engineer wants S3 to call the scan function directly. You drew a queue (SQS) in the middle. Why is the extra step worth it?
Q-010 · Architecture · hard
Product says: store the PDF in DynamoDB so we can search it. Files are about 2 MB, 100,000 a day. What do you say?
Q-011 · Architecture · medium
Scan now has three steps: virus check, read text, then a person may review for up to 48 hours. When do you add Step Functions (a workflow tool)? When is a queue still enough?
Q-012 · Architecture · hard
Doctors travel worldwide. The CTO wants the system live in the US and Europe on day one. Patient data may need to stay in one country. How do you answer?
Q-013 · Architecture · hard
A vendor wants the scan result on the same HTTPS call so they do not change their old software. Scan takes 8 to 30 seconds. What do you do?
Q-014 · Architecture · medium
One person wants API Gateway plus Lambda for uploads. Another wants a load balancer plus containers because the files are large. 100,000 files a day, about 2 MB each. Who is right?
Q-015 · Architecture · hard
Doctors search by patient name and should see files in 60 seconds. A consultant put a search database on every upload. What is wrong with that, and where should search sit?
Q-016 · Compute · hard
At peak you get 9 files per second. Each scan takes 90 seconds in a 4 GB container. Someone built this on Lambda. Do the worker math. Then pick Lambda, Fargate, or EKS, and say why.
Q-017 · Compute · medium
One Lambda both creates the upload link and later runs the 12-second virus scan. You have 100,000 files a day. Why split this into two functions?
Q-018 · Compute · medium
Your boss worries about Lambda cold starts (first-call delay). Upload is a user tapping a phone. Scan runs from a queue. Where do cold starts matter, and where do they not?
Q-019 · Compute · hard
The virus tool must run in a private network with no internet. It is a 6 GB vendor container and often takes 3 minutes. The platform team wants EKS. What do you pick, and why?
Q-020 · Compute · hard
Scan containers sit in private subnets and read S3 through a NAT Gateway. Last month NAT cost 10 times more than compute. How do you fix it? How does a file request travel after the fix?
Q-021 · Compute · hard
Claims files are about 200 MB. Work takes 18 minutes. They heard Lambda now has 10 GB memory. 8,000 files a day. Can Lambda do this? What should you use?
Q-022 · Compute · medium
You capped the scanner at 50 Lambdas so a bug cannot take the whole account. The next night, uploads still succeed, but jobs sit forever. What happened, and how do you fix it?
Q-023 · Compute · hard
Fargate scanners scale on queue size. The image is 3 GB. At midnight, 7 files per second arrive for 4 hours. If you scale on CPU only, what goes wrong? What do you scale on?
Q-024 · Compute · medium
Product wants a GPU to classify logos on 1% of clean files. The main scan is not a GPU job. Do you put GPUs on every scanner? What is the simple design?
Q-025 · Compute · hard
A director wants servers on all day because 100,000 files a day sounds busy, and reserved servers look cheaper than Lambda. Files are 2 MB and scan is a few seconds. How do you compare the shapes?
Q-026 · Networking · hard
Private scan tasks read S3 through a NAT Gateway. NAT is 10 times the compute bill. Tasks have no public IP. How do you fix the path, in simple steps?
Q-027 · Networking · hard
Draw where each part lives: HTTPS users, SFTP partners, Lambda upload, private scanner, S3, DynamoDB. What is on the public internet? What is not?
Q-028 · Networking · medium
A platform engineer wants a paid private link (interface endpoint) for S3, DynamoDB, SQS, and more, in every subnet. You already need S3 and DynamoDB. What is the cheap right tool, and what is extra?
Q-029 · Networking · hard
The scanner cannot read a file from the landing bucket. The IAM role looks fine. Yesterday you locked the bucket to a VPC endpoint. What do you check, in order?
Q-030 · Networking · medium
A network person drew an EC2 box with port 22 open to the world for partner SFTP. What do you use instead, and why is the EC2 idea risky?
Q-031 · Networking · hard
Product wants a link doctors can paste in chat. Security does not want a public S3 bucket. How do CloudFront and a locked bucket work together?
Q-032 · Networking · medium
Write simple firewall rules (security groups) for the private scanner. It needs S3, DynamoDB, the queue, and maybe one vendor website. What is allowed? What is not?
Q-033 · Networking · hard
Someone put the upload Lambda inside the scanner VPC for a future private call. Upload time jumped from 180 ms to 2.4 seconds, and NAT cost went up. What went wrong? How do you put it back?
Q-034 · Networking · medium
A form asks you to use network ACLs as the main lock. You already have security groups, private subnets, and bucket policies. What do ACLs do well, and what should they not do?
Q-035 · Networking · hard
A factory wants to send CAD PDFs over a private Direct Connect line into your landing bucket, with no public internet. They also have a small HTTPS app. How do you design the network?
Q-036 · Networking · medium
Where do you put WAF (the web firewall): CloudFront, API Gateway, a load balancer, or all three? Uploads go to API Gateway. Downloads go through CloudFront.
Q-037 · Networking · hard
You have NAT in two buildings (AZs) so the vendor virus tool can reach the internet. Finance asks why NAT exists if servers are private. Explain the two different jobs.
Q-038 · Networking · hard
The virus vendor offers a private connection (PrivateLink). Today you send full files out through NAT to their public API. 80,000 patient files a day. Do you take PrivateLink? Why?
Q-039 · Networking · medium
For a demo, someone gave the database a public IP so a laptop can connect. Production is next week. What do you change before go-live?
Q-040 · Networking · hard
The company wants one VPC per team plus a big transit hub. Your pipeline is mostly Lambda (no VPC), a scanner, and S3. Do you connect everyone, or keep this small? Why?
Q-041 · Storage · hard
Product wants one bucket with two folders: landing and clean. A test role can read everything. You handle patient files. Why are two buckets safer? Give a real incident story.
Q-042 · Storage · medium
Versioning is on for both buckets. There is no cleanup rule. You write 100,000 files a day and overwrite small side files. What happens to the bill in a year? What lifecycle do you set?
Q-043 · Storage · hard
Keep funded loan PDFs 7 years. Drop abandoned apps after 90 days. Drop failed landing files after 30 days. Search is needed on funded files today, not on ice-cold archive. How do you set storage classes?
Q-044 · Storage · medium
A prototype sends S3 events straight to Lambda. You want events to a queue with a dead-letter queue. What do you gain? When is the short path OK?
Q-045 · Storage · hard
Brokers upload 2 GB zip files. A junior sent the whole file through API Gateway. 10,000 packages a day. How should the bytes actually travel?
Q-046 · Storage · medium
Finance turned on auto-archive for every object, including files scanned 10 minutes ago. Support must open a just-failed file in 60 seconds. What is wrong, and how do you fix tiers?
Q-047 · Storage · hard
A slide says: copy buckets to a second Region and disaster recovery is done. Patient data, 15 minute data-loss limit, 4 hour recovery, and Europe rules were mentioned. What is missing?
Q-048 · Storage · hard
Legal wants lock-so-nobody-can-delete on every PDF forever. Ops still must delete malware from landing and fix a bad scan. How do you use Object Lock without blocking operations?
Q-049 · Storage · medium
The app needs to download a clean PDF after status is Ready. One engineer wants a short S3 link. Another wants CloudFront with a locked origin. 50,000 doctors, patient data, worldwide. Which, and why?
Q-050 · Storage · hard
A data engineer lists the whole landing bucket every 5 minutes to find new files, because events failed in a test. The bucket is already huge. Why is listing a bad job? What do you use instead?
Q-051 · Database · hard
Product wants the PDF inside DynamoDB so they can query it. 100,000 files a day, about 2 MB each. What do you say, in simple words?
Q-052 · Database · medium
You need three lookups: get one job by id, list one customer's jobs for 30 days, and find a job by file fingerprint when a partner uploads again. How do you set DynamoDB keys?
Q-053 · Database · hard
One hospital is 40% of all files. You grouped the index by customer id. Monday at 9 a.m. that index gets too busy while others are fine. What is the hot-key problem, and how do you spread the load?
Q-054 · Database · medium
Finance wants SQL and reports on every job. Engineering wants DynamoDB for the live pipeline. What do you use for the live path? What do you use for reports?
Q-055 · Database · hard
Ops wants all failed jobs in the last 24 hours, across every customer. A developer wants to scan the whole table. Why is that a bad idea? What key or index do you add?
Q-056 · Database · medium
You want old leftover job rows to disappear after 24 hours if no file arrived, and after 90 days if abandoned. What can DynamoDB TTL do, and what can it not do?
Q-057 · Database · hard
A teammate wants DynamoDB Streams to notify other systems when a job is Ready, instead of SNS. You already write Ready in the same update. When is a stream good? When is SNS simpler?
Q-058 · Database · medium
Traffic is high at 8 a.m. and almost zero at 2 a.m. A DBA wants reserved DynamoDB capacity to save money. When is on-demand the simpler choice?
Q-059 · Database · hard
The file in S3 and the row in DynamoDB must match. Never mark Ready without a clean file. Never leave a clean file with no row. DynamoDB transactions do not include S3. How do you keep them in sync?
Q-060 · Database · medium
If billing uses Aurora (SQL) next to this pipeline, the interviewer asks about Multi-AZ vs a read copy vs a global database. The live status API is still DynamoDB. How do you explain each?
Q-061 · Database · hard
A search person says: put job status in OpenSearch and drop DynamoDB. Doctors already search there. Why is that risky? What is each store for?
Q-062 · Database · medium
The phone app asks for job status every half second for 40 seconds. Many uploads at once. DynamoDB holds the status. Do you need a cache? Why or why not?
Q-063 · Database · hard
A senior engineer wants one DynamoDB table for everything. You also need per-customer scan time settings. The team is six people. One table or two? Why?
Q-064 · Database · medium
You may lose only 15 minutes of job status. Someone says S3 versions are enough, so DynamoDB does not need point-in-time recovery. What do you say?
Q-065 · Database · hard
Leadership wants DynamoDB copied live to the US and Europe so it never goes down. Job status would be written in both places. What can go wrong?
Q-066 · Security · hard
All files and the table use a customer-managed key (CMK). The scanner unlocks landing and locks clean. The KMS bill jumped at 80,000 files a day. What setting did you forget? Who is allowed to decrypt?
Q-067 · Security · medium
In simple words, what may the scanner role do? What must it never do? Talk about S3, DynamoDB, the queue, and downloads.
Q-068 · Security · hard
A partner cannot use SFTP, so someone made the landing bucket public so they can upload from a browser. These are patient files. You see it in the logs this afternoon. What do you do first, then next?
Q-069 · Security · hard
A developer logged the first 2 KB of each PDF to debug text reading. 80,000 patient files a day. Logs stay 90 days and go to another system. What is wrong, and how do you fix it?
Q-070 · Security · medium
The phone app, an internal service, and SFTP partners all upload. A lead wants one IAM user with a long-lived access key for all of them. What do you use instead?
Q-071 · Security · hard
You locked the landing bucket so only the scanner VPC endpoint can write. The next day, phone uploads and SFTP both fail. What did you break? How do you lock it the right way?
Q-072 · Security · medium
The virus vendor API key is in the container settings in plain text, in Git, and in the deploy output. Where should the secret live, and how does the task read it?
Q-073 · Security · hard
Two partner companies upload to the same bucket. Partner A must never see Partner B's files. How do you separate them with SFTP folders and IAM?
Q-074 · Security · medium
Security wants a log of every S3 read and write. Finance saw that log bill explode. 100,000 files a day plus doctor downloads. How do you keep the important logs without paying for noise?
Q-075 · Security · hard
A third-party scanner account will use a role in your account to read landing files. They sent a trust policy with no extra check (ExternalId). These are patient files. What is the risk, and how do you fix it?
Q-076 · Security · medium
A form says you are safe because the scanner is in a private VPC. Product wants to skip the web firewall, skip login, and skip Block Public Access on S3. How do you answer?
Q-077 · Security · hard
Walk encryption on the path: phone upload, SFTP, S3, scanner, DynamoDB, notify, download. Where do people forget? Is HTTPS enough by itself?
Q-078 · Security · medium
GuardDuty says the scanner role listed all buckets, then read a bucket that is not yours. You did not write that code. What do you do in the first 15 minutes?
Q-079 · Security · hard
Someone wants Macie (a data finder) on landing and clean to find patient data. You already know landing is full of patient PDFs. Is Macie the main control, a helper, or mostly a bill?
Q-080 · Security · hard
A doctor pasted a download link into chat. It lasted 24 hours and was forwarded outside the company. What do you do now? How do you make links safer next time?
Q-081 · Reliability · hard
The last architect wrote: two buildings (Multi-AZ) equals disaster recovery. You have one Region. If one building dies at 2 p.m., what still works? What is HA vs DR in simple words?
Q-082 · Reliability · hard
Bad files, a permission error, and a huge night rush can all look like failures. How do you set the dead-letter queue so people know which is which, and who retries what?
Q-083 · Reliability · hard
A queue can deliver the same message twice. The scanner sent Ready, then crashed before deleting the message. The message comes back. What happens? How do you make a second run safe?
Q-084 · Reliability · hard
Game day: one building (AZ) is turned off. Upload, S3, DynamoDB, and the queue are regional. NAT was only in that building. What breaks, and what did you forget?
Q-085 · Reliability · hard
If the whole Region is gone, you have 4 hours to be back and may lose only 15 minutes of data. Write a recovery plan you could actually run, not a slide.
Q-086 · Reliability · medium
A 0-byte file and a 12 GB fake PDF both arrive. The tiny one errors forever. The huge one fills disk and retries forever. How do you stop this at the door without rejecting good files?
Q-087 · Reliability · hard
The virus vendor is down for 2 hours. Product asks if the website is down. Uploads should still work. Search may be late. What do you tell them?
Q-088 · Reliability · hard
The slowest scans take 80 seconds. The queue hides a message for only 30 seconds (the default). What do users see? What timeout should you set?
Q-089 · Reliability · medium
The slide says: S3 versions and DynamoDB backup, we are fine. Nobody has ever restored a file or a table. What is missing from the backup story?
Q-090 · Reliability · hard
Scan worked. The clean file landed. Status was set to Ready. Then notify failed and the worker died. What does the user see? How do you finish the job safely?
Q-091 · Cost · hard
Private scanners read S3 through NAT. NAT is 10 times the compute bill. What do you change, and which line on the bill should drop?
Q-092 · Cost · medium
Doctors in Europe download files stored in the US. Someone says CloudFront is an extra service. Compare the cost of sending files from S3 in one Region vs from an edge cache.
Q-093 · Cost · hard
After 90 days, S3 is the biggest bill. Versioning is on, no cleanup, and each job writes extra small files a few times. How do you cut storage cost without losing today's files?
Q-094 · Cost · medium
Logs cost almost as much as compute. The scanner prints every line of text plus the first page. How do you cut about 70% of log cost and still debug failures?
Q-095 · Cost · hard
A director wants containers on 24 hours a day in three buildings because 100,000 files a day sounds busy. Scan is 2 seconds and about 1 file per second on average. Why is always-on the expensive shape?
Q-096 · Cost · medium
You encrypt every file with a customer key. The key bill grew with every upload, scan, and download. You already have the right key type. What one S3 setting cuts most of those key calls?
Q-097 · Cost · hard
Leadership wants a full second copy of the system in Europe so you look global. There is no law that says you must. Recovery can take 24 hours. Users are in the US. Rank the cost of that choice.
Q-098 · Cost · medium
A shared module created a paid private endpoint for almost every AWS service, in three buildings, plus NAT. S3 traffic still might use NAT. How do you clean this up?
Q-099 · Cost · hard
The CFO wants 30% less spend. Doctors must still search in 60 seconds. Uploads must still be accepted right away. After 3 months you have NAT, heavy logs, old file versions, and an idle GPU. What do you cut first?
Q-100 · Cost · medium
Partners upload only 4 hours a night, but the SFTP service runs all day. Someone wants a cheap server you start at 11:50 p.m. Compare cost vs the risk of a home-made SFTP box.
Final interview prep checklist
Final interview prep checklist
You will
Mock interview brief5 min
Mock interview brief
Forty-five to sixty minutes if you booked a live mock.
| Block | Minutes | What happens |
|---|---|---|
| Introduction | 5 | Your role and what you are targeting |
| AWS basics | 10 | Pick a service and say why |
| Architecture problem | 25 | The document platform, or a close variant |
| Challenge questions | 10 | Security, disaster recovery, cost |
| Feedback | 10 | Same-day scorecard |
Requirements · AWS knowledge · Architecture · Scale · Security · Reliability · Cost · Trade-offs · Communication · Leadership
Those ten scores become a 0–100 total.
Your band, strengths, gaps, what to review, and one next step.
Instructor-only notes stay off your report.
Live 4-hour clock: Instructor runbook.
INTERVIEW TIP: When you are stuck, ask a question or say an assumption. Do not invent a new service.
Scorecard
Scorecard
Student: ____________ Date: ____________ Instructor: ____________
Score each item from 1 to 5.
| Dimension | Score | Notes |
|---|---|---|
| Requirement clarification | ||
| AWS knowledge | ||
| Architecture | ||
| Scalability | ||
| Security | ||
| Reliability | ||
| Cost awareness | ||
| Trade-offs | ||
| Communication | ||
| Leadership / seniority |
Total / 50 × 2 = / 100
Readiness: Foundation / Developing / Interview Ready / Advanced
Strengths:
Improvements:
Services or topics to review:
Next-step plan:
Instructor runbook (live 4-hour session)
Instructor runbook (live 4-hour session)
Use this if you are running the sprint live. Students can read this page. The scoring notes are for you.
| Clock | Block | You do | They do |
|---|---|---|---|
| 0:00–0:10 | Open | State the goal. Write R-SCALE on the board. Do not draw service logos yet. | Cameras on. Check AWS accounts if the lab is today. |
| 0:10–0:25 | Assessment | Stay quiet. Do not teach during the quiz. | 15 questions |
| 0:25–0:40 | Debrief scores | Name the two weakest skills for the room. | Write them down |
| 0:40–1:00 | R-SCALE | Work one prompt out loud. | Repeat the same prompt in breakouts |
| 1:00–1:50 | Core AWS | Ask people to pick compute, storage, data, messaging, and network. | Each person defends one pick for the document platform |
| 1:50–2:25 | Production | Cover stay-up vs recover, one threat path, and one cost choice. | Security + multi-account one-pager |
| 2:25–3:05 | Canvas | 45 minutes to design. 10 minutes to defend. | Fill the canvas, then talk |
| 3:05–3:40 | Lab or drill | If they have accounts: apply and curl. If not: failure drill on the board. | Show PROCESSED, or name the three stalls |
| 3:40–4:00 | Close | Assign bank questions by weak skill. Book the mock slot. | Tonight: only the weak skills |
Module 6 (the timed mock) is a separate booked hour for 1:1. Do not fold it into this four-hour group block.
Score 1–5 on each skill, then convert to 0–100. A 3 is good enough with gaps. A 5 sounds like a senior architect.
| Dimension | 3 (good enough) | 5 (senior) |
|---|---|---|
| Requirement clarification | Asks one question, then designs | Asks two, states assumptions, writes them on the board |
| AWS knowledge | Names the right service | Names the service and the limit that would change the pick |
| Architecture | One happy path | Landing vs clean, async boundary, what is not on the request |
| Scalability | Says “auto scaling” | Does the math: count / 86400 × peak × size × duration |
| Security | Says “KMS and IAM” | Walks a threat path, two roles, key policy, and EventBridge on encrypted SQS |
| Reliability | Says “Multi-AZ” | Names a failure they cannot allow, a DLQ, and what a 202 does not mean |
| Cost | Says “S3 is cheap” | Talks endpoints vs NAT, log volume, reserved concurrency |
| Trade-offs | Lists two options | Picks one and names the cost of being wrong |
| Communication | Correct, hard to follow | Time-boxed, easy to interrupt, draws while talking |
| Leadership | Waits for the prompt | Frames the decision for a VP in one sentence |
Mock interview50 min
Mock interview
Forty-five to sixty minutes if you booked a live mock.
| Block | Minutes | What happens |
|---|---|---|
| Introduction | 5 | Your role and what you are targeting |
| AWS basics | 10 | Pick a service and say why |
| Architecture problem | 25 | The document platform, or a close variant |
| Challenge questions | 10 | Security, disaster recovery, cost |
| Feedback | 10 | Same-day scorecard |
Requirements · AWS knowledge · Architecture · Scale · Security · Reliability · Cost · Trade-offs · Communication · Leadership
Those ten scores become a 0–100 total.
Your band, strengths, gaps, what to review, and one next step.
Instructor-only notes stay off your report.
Live 4-hour clock: Instructor runbook.
INTERVIEW TIP: When you are stuck, ask a question or say an assumption. Do not invent a new service.
Download the full lab (all code)
Python handlers, Terraform, CloudFormation, demo script, and sample file. Unzip, deploy in your AWS account, demo with curl, then destroy the same day.
Download aws-sa-sprint-lab.zipYou will
Lab overview10 min
Lab overview
text
Client → API Gateway → Lambda (ingest) → S3
→ EventBridge → SQS → Lambda (processor) → DynamoDB → SNSThis lab runs in your own AWS account. Download the full pack. Read every file. Run it. Show the demo. Then destroy it the same day.
Read Lab architecture for how each hop works (12 hops, then Flows A–E). After a green demo, do the failure drill. You will stall KMS (the encryption key), set reserved concurrency to 0 (no processor runs), and skip decoding an encoded key.
Download aws-sa-sprint-lab.zip
The zip is the same tree you can also browse on this page:
lambda/ingest.py and lambda/processor.py — the two functionsterraform/main.tf, variables.tf, terraform.tfvars.example — full stackcloudformation/template.yaml — the same stack if you cannot run Terraformscripts/demo.sh — posts a sample file and waits for PROCESSEDsample-files/sample.txt, architecture, troubleshooting, cleanupTypical cost is under $2 if you destroy the same day.
bash
unzip aws-sa-sprint-lab.zip
cd aws-document-processing/terraform
cp terraform.tfvars.example terraform.tfvars
# set name_prefix to your initials, lowercase, e.g. hb-sa-lab
terraform init
terraform applyname_prefix must be unique, lowercase, and 2–21 characters (letters, numbers, hyphens).
Note the outputs: ingest_url, bucket, table, queue, dlq, topic.
bash
curl -X POST "$(terraform output -raw ingest_url)" \
-H "content-type: application/json" \
-d '{"fileName":"sample.txt","contentBase64":"SGVsbG8gQmF5TGVhcm4="}'Or from the pack root after apply:
bash
./scripts/demo.shWait about 10 seconds, then confirm:
landing/{jobId}/sample.txt existsstatus is PROCESSED0bash
aws cloudformation deploy \
--stack-name yourinitials-sa-lab \
--template-file cloudformation/template.yaml \
--parameter-overrides NamePrefix=yourinitials-sa-lab \
--capabilities CAPABILITY_NAMED_IAMUse the IngestUrl output with the same curl. Delete the stack when you are done.
bash
cd terraform
terraform destroyIf the bucket is not empty:
bash
aws s3 rm "s3://$(terraform output -raw bucket)" --recursive
terraform destroyThis pack’s Terraform sets force_destroy = true on the bucket, so destroy works after a demo even with versioned objects.
Ingest writes the DynamoDB job row first, then the KMS-encrypted S3 object, and returns 202 (accepted, not finished):
python
table.put_item(Item={"jobId": job_id, "s3Key": key, "status": "RECEIVED", ...})
s3.put_object(Bucket=BUCKET, Key=key, Body=content,
ServerSideEncryption="aws:kms", SSEKMSKeyId=os.environ["KMS_KEY_ARN"])
return {"statusCode": 202, "body": json.dumps({"jobId": job_id, "s3Key": key})}Processor is triggered by SQS (the process queue). It URL-decodes the S3 key, reads the object, marks PROCESSED, and publishes SNS (a notify topic):
python
key = unquote_plus(raw_key)
obj = s3.get_object(Bucket=bucket, Key=key)
table.update_item(..., UpdateExpression="SET #s = :s, byteSize = :n, processedAt = :t")
sns.publish(TopicArn=TOPIC, Subject="document-processed", Message=...)Open the extras on this lesson to read the full files, not just these snippets.
Lab architecture15 min
Lab architecture
Follow the file from the browser to “processed,” and be ready to say what can go wrong at each step.
The 12 hops below are enough for the weekend. The extra flows after that are only if you want more detail.
Download the code: aws-sa-sprint-lab.zip
After a green demo, do the failure drill. You will stall KMS (the encryption key), set reserved concurrency to 0 (no processor runs), and skip decoding an encoded key.
POST /ingest with fileName and contentBase64 (the file as Base64 text).POST /ingest. It uses AWS_PROXY payload 2.0 (Lambda gets the raw HTTP event). Then it calls ingest.jobId (a new unique id).status=RECEIVED before any S3 write. DynamoDB is the job table.landing/{jobId}/{fileName} with SSE-KMS (S3 encrypts with your KMS key).{ jobId, s3Key }. 202 means accepted, not finished. The client is done.Object Created onto EventBridge (the AWS event bus). The bucket talks to EventBridge. It does not call Lambda itself.PROCESSED, byteSize, and processedAt.document-processed. If the handler keeps failing, the message lands on the DLQ.Say this: “202 means accepted, not finished. PROCESSED means the async path finished. Those are different contracts.”
---
POST /ingest on the $default stage. Integration type is AWS_PROXY, payload 2.0. A resource-based policy on the function allows apigateway.amazonaws.com (API Gateway may call this Lambda).lambda.amazonaws.com). Runtime is Python 3.12. Handler is ingest.handler.isBase64Encoded is true, decode the body, then json.loads. Decode contentBase64 into bytes. uuid4() is the job id. Object key is landing/{jobId}/{fileName}.jobId. Status is RECEIVED. If you write S3 first, EventBridge can wake the processor before the row exists. That is a real race.ServerSideEncryption=aws:kms and the lab CMK (customer-managed KMS key). Ingest may s3:PutObject on landing/* only — not the whole bucket, not GetObject.jobId and s3Key. The processor has not run. That is the design.Trade-off: if S3 fails after PutItem, you have an orphan RECEIVED row. That is better than a processor 404 on a missing item. A sweeper can expire stuck RECEIVED rows.
Say this out loud: “I will not hold the HTTPS request for virus scan or OCR. I accept, persist intent, persist bytes, return 202.”
---
eventbridge = true. We did not wire S3 directly to Lambda or S3 directly to SQS.source=aws.s3, detail-type=Object Created, with bucket.name and object.key. The key is often URL-encoded.sqs:SendMessage because of a queue policy (aws:SourceArn = this rule). That is not an IAM role.kms:GenerateDataKey*, kms:Decrypt). If you forget that, S3 has the object, DynamoDB stays RECEIVED, and the queue is empty. That looks like a Lambda bug. It is a KMS bug.maxReceiveCount = 3. After three failed receives, SQS redrives to the DLQ. The main queue does not keep poison messages forever.ReceiveMessage. On success the mapping deletes the message. On exception the message becomes visible again.Why EventBridge instead of S3-to-SQS? You can fan out later (metrics, malware, notify) without changing the producer. The lab only has one target. The pattern is still the production one.
Say this out loud: “Bytes already live in S3. The queue is a buffer and a retry story, not a second copy of the file.”
---
event.Records[].body is a string. Parse it. The EventBridge event is inside. Read detail, not the SQS wrapper.unquote_plus the object key (decode the S3 key). Skip this and GetObject 404s on any key with a space or encoded slash.GetObject on landing/*. S3 decrypts with the CMK. The processor role needs kms:Decrypt. This lab only uses ContentLength — enough to prove the read path.jobId is the second segment of landing/{jobId}/{fileName}. Same id ingest wrote. No extra index.UpdateItem sets status=PROCESSED, byteSize, processedAt, and s3Key. #s is required because status is reserved in DynamoDB expressions.attribute_not_exists(processedAt) or a condition on status.sns.publish with jobId, s3Key, byteSize. The topic is KMS-encrypted, so the role needs sns:Publish and kms:GenerateDataKey.Say this out loud: “Processor is idempotent in production. This lab shows the path. I would add a condition before I called it done.”
---
ReceiveCount increments. The same payload is delivered again. That is at-least-once.ReceiveCount = 3, the redrive policy moves the message to the DLQ. The process queue stays healthy./aws/lambda/{prefix}-processor, fix IAM/KMS/code, then replay from the DLQ. Do not delete the DLQ message until you know why it is there.jobId.0 looks like a silent outage. Queue depth grows. This lab uses 5.status. Production adds GET /jobs/{id} or an SNS subscriber. This lab has you check the table.Say this out loud: “Failure is a queue problem after accept. I will not hide it on the HTTP status of ingest.”
---
s3:PutObject on landing/*, dynamodb:PutItem, KMS generate/decrypt, logs. No GetObject, no SNS, no SQS.s3:GetObject on landing/*, dynamodb:UpdateItem, sns:Publish, SQS receive/delete, KMS generate/decrypt, logs.lambda:InvokeFunction).events.amazonaws.com.kms:* (so you can administer it) and a service statement for S3, DynamoDB, SNS, SQS, EventBridge, Lambda, and Logs."Resource": "*" on S3 or DynamoDB in this design. Name the table ARN and the landing/* prefix.force_destroy so a student demo can tear down.Say this out loud: “Least privilege is two roles and a key policy that names the services that touch ciphertext. EventBridge on an encrypted queue is the one people miss.”
---
| Concern | Choice | Rejected | Why |
|---|---|---|---|
| Ingest | API Gateway + Lambda | Holding scan on the request | 202, not a 2-minute HTTPS call |
| Bytes | S3 | DynamoDB item | Objects are files, not 400 KB rows |
| Intent / status | DynamoDB | RDS | One key, jobId, pay-per-request |
| Buffer | SQS + DLQ | Direct Lambda-to-Lambda | Retry and back-pressure |
| Fan-out | EventBridge then SNS | Hard-coded extra Lambdas | Add consumers without changing ingest |
| Encryption | Customer CMK | SSE-S3 only | Interview wants you to talk key policy |
ARCHITECTURE DECISION: This lab is the serverless slice of the document platform, not the global VPC design. Ingest Lambda stays out of a VPC on purpose. A VPC lab would add gateway endpoints for S3 and DynamoDB — it would not “put S3 in a private subnet.”
---
“Client POSTs to an HTTP API. Ingest writes a RECEIVED row first. Then it writes a KMS-encrypted object under landing/jobId/file. It returns 202. S3 fires Object Created to EventBridge. A rule sends that event to an encrypted SQS queue. The processor mapping long-polls, reads the object, marks PROCESSED, and publishes SNS. Three failures go to a DLQ. The usual lab break is EventBridge missing kms:GenerateDataKey on that CMK. The object is in S3 and the job never moves.”
Build the pipeline35 min
Build the pipeline
text
Client → API Gateway → Lambda (ingest) → S3
→ EventBridge → SQS → Lambda (processor) → DynamoDB → SNSThis lab runs in your own AWS account. Download the full pack. Read every file. Run it. Show the demo. Then destroy it the same day.
Read Lab architecture for how each hop works (12 hops, then Flows A–E). After a green demo, do the failure drill. You will stall KMS (the encryption key), set reserved concurrency to 0 (no processor runs), and skip decoding an encoded key.
Download aws-sa-sprint-lab.zip
The zip is the same tree you can also browse on this page:
lambda/ingest.py and lambda/processor.py — the two functionsterraform/main.tf, variables.tf, terraform.tfvars.example — full stackcloudformation/template.yaml — the same stack if you cannot run Terraformscripts/demo.sh — posts a sample file and waits for PROCESSEDsample-files/sample.txt, architecture, troubleshooting, cleanupTypical cost is under $2 if you destroy the same day.
bash
unzip aws-sa-sprint-lab.zip
cd aws-document-processing/terraform
cp terraform.tfvars.example terraform.tfvars
# set name_prefix to your initials, lowercase, e.g. hb-sa-lab
terraform init
terraform applyname_prefix must be unique, lowercase, and 2–21 characters (letters, numbers, hyphens).
Note the outputs: ingest_url, bucket, table, queue, dlq, topic.
bash
curl -X POST "$(terraform output -raw ingest_url)" \
-H "content-type: application/json" \
-d '{"fileName":"sample.txt","contentBase64":"SGVsbG8gQmF5TGVhcm4="}'Or from the pack root after apply:
bash
./scripts/demo.shWait about 10 seconds, then confirm:
landing/{jobId}/sample.txt existsstatus is PROCESSED0bash
aws cloudformation deploy \
--stack-name yourinitials-sa-lab \
--template-file cloudformation/template.yaml \
--parameter-overrides NamePrefix=yourinitials-sa-lab \
--capabilities CAPABILITY_NAMED_IAMUse the IngestUrl output with the same curl. Delete the stack when you are done.
bash
cd terraform
terraform destroyIf the bucket is not empty:
bash
aws s3 rm "s3://$(terraform output -raw bucket)" --recursive
terraform destroyThis pack’s Terraform sets force_destroy = true on the bucket, so destroy works after a demo even with versioned objects.
Ingest writes the DynamoDB job row first, then the KMS-encrypted S3 object, and returns 202 (accepted, not finished):
python
table.put_item(Item={"jobId": job_id, "s3Key": key, "status": "RECEIVED", ...})
s3.put_object(Bucket=BUCKET, Key=key, Body=content,
ServerSideEncryption="aws:kms", SSEKMSKeyId=os.environ["KMS_KEY_ARN"])
return {"statusCode": 202, "body": json.dumps({"jobId": job_id, "s3Key": key})}Processor is triggered by SQS (the process queue). It URL-decodes the S3 key, reads the object, marks PROCESSED, and publishes SNS (a notify topic):
python
key = unquote_plus(raw_key)
obj = s3.get_object(Bucket=bucket, Key=key)
table.update_item(..., UpdateExpression="SET #s = :s, byteSize = :n, processedAt = :t")
sns.publish(TopicArn=TOPIC, Subject="document-processed", Message=...)Open the extras on this lesson to read the full files, not just these snippets.
Failure drill — break the lab on purpose
Failure drill — break the lab on purpose
The happy path already works. Interviewers ask about the stall. Do these three after a successful demo. Then put the lab back and destroy it the same day.
What you change: On the lab CMK (customer-managed KMS key), remove events.amazonaws.com from the key policy. Upload one more file.
What you see: Ingest still returns 202 (accepted, not finished). The object is in S3. DynamoDB stays RECEIVED. The process queue is empty. Processor logs are quiet. DLQ (dead-letter queue for failed messages) is empty — the message never arrived.
Why: EventBridge (the AWS event bus) must call kms:GenerateDataKey* on that CMK to send to an encrypted queue. IAM on Lambda does not fix this.
Put it back: Restore the service statement. Re-upload. Status becomes PROCESSED.
Say this out loud: “The object in S3 with a stuck RECEIVED row is usually KMS on the bus, not a Python bug.”
What you change: Set the processor reserved concurrency to 0 (no processor runs). Upload one file.
What you see: 202 still returns. Object lands. Queue depth grows. Processor does not invoke. After enough receives you may get DLQ, or the queue just sits.
Why: Reserved concurrency 0 is a deploy-time mute. It looks like an outage with no 5xx on ingest.
Put it back: Set reserved concurrency to 5. Messages drain.
Say this out loud: “I will check reserved concurrency before I rewrite the handler.”
What you change: Temporarily comment out unquote_plus (decode the S3 key) in processor.py. Redeploy that function only. Upload a file named my file.txt (space in the name).
What you see: Ingest 202. S3 object exists. Processor throws / retries. After 3 receives the message is on the DLQ. CloudWatch shows NoSuchKey or a 404-style GetObject.
Why: EventBridge/S3 encode spaces. GetObject needs the decoded key.
Put it back: Restore unquote_plus, redeploy, replay from the DLQ or upload again.
Say this out loud: “I unquote the key before GetObject. I do not ask the client to POST again.”
terraform destroy the same day. Do not leave a broken concurrency setting in the account.
Troubleshooting
Troubleshooting
If the demo stalls, start here. Most lab breaks are IAM, KMS (the encryption key), or a path — not Python.
| Symptom | Likely cause | Fix |
|---|---|---|
terraform apply fails on archive_file | Missing lambda/ingest.py or lambda/processor.py next to terraform/ | Unzip the full lab pack. Keep the folder layout: lambda/ and terraform/ as siblings |
| 403 on ingest | Apply did not finish, or you curled the wrong URL | terraform output ingest_url — it must end with /ingest |
Object in S3, DynamoDB stays RECEIVED | EventBridge (the AWS event bus) cannot write the encrypted SQS queue | Confirm the CMK policy allows events.amazonaws.com kms:GenerateDataKey* and kms:Decrypt. This pack already includes that policy |
| Object in S3, no DynamoDB update at all | EventBridge rule or Lambda event-source mapping | Check the rule target is the process queue and the mapping is enabled |
| Processor loops | Visibility timeout (hide time while a worker has the message) shorter than the function | This pack uses 60s visibility and a 30s timeout. Do not lower visibility below timeout |
| Messages on the DLQ (dead-letter queue for failed messages) | Handler exception after 3 receives | Read /aws/lambda/{prefix}-processor. Replay after you fix the code |
KMS AccessDenied | Role or service missing decrypt | Use the key and roles the template creates. Do not swap in a different CMK |
| Bucket already exists | name_prefix is not unique | Change name_prefix to your initials plus a date |
| Unexpected cost | Stack left running | terraform destroy the same day. This lab does not create NAT |
WARNING: Do not set Lambda reserved concurrency to 0 (no processor runs) and forget — it looks like a silent outage.
Cleanup
Cleanup
Destroy the same day. That keeps the bill near zero.
bash
cd terraform
terraform destroyIf destroy fails because the bucket is not empty (versioning is on), Terraform in this pack sets force_destroy = true so a second terraform destroy should succeed. If you are on an older copy:
bash
BUCKET="$(terraform output -raw bucket)"
aws s3 rm "s3://$BUCKET" --recursive
# versioned objects also need:
aws s3api list-object-versions --bucket "$BUCKET" --output json \
| python3 -c "import sys,json; d=json.load(sys.stdin); objs=[{'Key':v['Key'],'VersionId':v['VersionId']} for v in d.get('Versions',[])+d.get('DeleteMarkers',[])];
print(json.dumps({'Objects':objs,'Quiet':True}) if objs else '')" > /tmp/delete.json
if [ -s /tmp/delete.json ]; then aws s3api delete-objects --bucket "$BUCKET" --delete file:///tmp/delete.json; fi
terraform destroybash
aws cloudformation delete-stack --stack-name yourinitials-sa-lab
aws cloudformation wait stack-delete-complete --stack-name yourinitials-sa-labConfirm: no leftover Lambda, SQS, DynamoDB table, or CMK (customer-managed KMS key) pending deletion you did not expect.
Read the lab source
Same files as the zip. Open one at a time — map the function to the interview sentence.
Ingest Lambda (Python)
python
import base64
import json
import os
import uuid
from datetime import datetime, timezone
import boto3
s3 = boto3.client("s3")
ddb = boto3.resource("dynamodb")
table = ddb.Table(os.environ["TABLE_NAME"])
BUCKET = os.environ["BUCKET_NAME"]
def handler(event, _context):
body = event.get("body") or "{}"
if event.get("isBase64Encoded"):
body = base64.b64decode(body).decode("utf-8")
payload = json.loads(body)
file_name = payload.get("fileName") or "upload.txt"
content = base64.b64decode(payload.get("contentBase64") or "")
job_id = str(uuid.uuid4())
key = f"landing/{job_id}/{file_name}"
# Write the job row first so the processor never races the S3 event.
table.put_item(
Item={
"jobId": job_id,
"s3Key": key,
"fileName": file_name,
"status": "RECEIVED",
"createdAt": datetime.now(timezone.utc).isoformat(),
}
)
s3.put_object(
Bucket=BUCKET,
Key=key,
Body=content,
ServerSideEncryption="aws:kms",
SSEKMSKeyId=os.environ["KMS_KEY_ARN"],
Metadata={"jobid": job_id},
)
return {
"statusCode": 202,
"headers": {"content-type": "application/json"},
"body": json.dumps({"jobId": job_id, "s3Key": key}),
}Choose a delivery mode. BayAreaLa8s invoices after you request a session.
This text is a draft. It is not a current BayLearn offer and it does not change existing bookings. Read the draft refund policy
$349
Introductory $299
Request a slot. Invoicing is handled by BayAreaLa8s after the request — no Stripe checkout.