BayLearnBayAreaLa8s

BayLearn Weekend Interview Sprints

AWS Solutions Architect Weekend Interview Sprint

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.

  • 4-Hour Live 1:1
  • Real AWS Decisions
  • Security and Resilience
  • Interview Scenarios
  • Mock Interview + Feedback

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.

Who this is for

  • Cloud Engineer
  • Solutions Architect
  • Senior Backend Engineer
  • DevOps Engineer moving into architecture

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.

What You Leave With

  • Interview Readiness Score
  • Top Strengths and Gaps
  • Reusable Interview Framework
  • Real Scenario Practice
  • Mock Interview Score
  • Personalized Feedback
  • Question Bank
  • 7-Day Preparation Plan

Preview the 7-day plan

Four-hour agenda

  1. Hour 1

    Core concepts and interview patterns

  2. Hour 2

    Architecture / coding scenarios

  3. Hour 3

    Hands-on interview challenges

  4. Hour 4

    Mock interview and feedback

Sample interview questions

  • How would you design an application that remains available during complete AWS Region failure?
  • When would you choose SQS instead of EventBridge?
  • How would you design secure enterprise SFTP onboarding?
  • How would you approach disaster recovery for a stateful application?

Can you explain these confidently?

Meet Your Interview Coach

Himanshu Bhadra

Enterprise Architect | Cloud | AI | Distributed Systems | Technical Leadership

Learn by designing, building and explaining.

Availability

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 Call

FAQ

Can I master the topic in four hours?
No. The Sprint is focused interview preparation for people who already have relevant fundamentals or experience.
What happens in the four hours?
Targeted review, scenario practice, hands-on or architecture exercises, and a mock interview with feedback.
Is it live 1:1?
For the premium format, yes. Other delivery modes may be offered separately.
Can I share my job description?
Yes, so preparation can be better aligned to the target role.
Do you guarantee I will pass?
No. BayLearn improves preparation and readiness but does not guarantee hiring outcomes.
What if my interview is next week?
That is the primary use case for the Weekend Interview Sprint.
What if I need more depth?
Use a BayLearn Professional Program for deeper 8–16 week training.
What is the refund policy?
Refund terms are a draft and are not a current offer. They depend on the format you buy. Read the draft at /refund-policy/ before you enroll or book.

Need more than a weekend?

Professional 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 Programs

Curriculum

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

  • See the full lesson path before you book
  • Know what is a teaching note vs a quiz vs a lab

Course overview5 min

Course overview

Course overview — AWS Solutions Architect Interview Sprint

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.

Global document platform Edge Route 53 � CloudFront + WAF � API Gateway � Transfer Family Ingest and store HTTPS presigned PUT or SFTP S3 landing (hostile, KMS, BPA) EventBridge � SQS + DLQ Processor Lambda / Fargate Promote and notify Scan then copy to S3 clean DynamoDB metadata (fileId, status) SNS / EventBridge FileReady CloudFront origin = clean only Cross-cutting IAM least privilege � CMK � CloudTrail / GuardDuty Multi-AZ HA � PITR + versioning for DR � alarms on DLQ and time-to-CLEAN Cost arrows: NAT, egress, logs, versions  not peak EC2
Global document platform you will design this weekend

Use the weekend clock. Do not start with the 100-question bank.

Four-hour weekend clock Four hours. This order. Do not start the bank first. 1. 0:00 Assessment 20 min two weak scores 2. 0:20 R-SCALE 25 min one answer aloud 3. 0:45 Core AWS 60 min pick + reject 4. 1:45 Production 40 min HA DR security 5. 2:25 Canvas + hops 45 min 12-hop walk 6. 3:10 Lab / drill 40 min PROCESSED 7. 3:50 Bank filter 10 min weak dims only Mock is a separate booked hour. Do not spend the bank before the canvas.
Four-hour weekend clock

What you will do

  1. Take a short 15-question quiz. You get eight skill scores.
  2. Learn R-SCALE — a simple order for every answer: Requirements, Scale, Components, Availability, Limitations, Evolution.
  3. Pick compute, storage, databases, messaging, and networking for one document platform.
  4. Cover production basics: stay up, recover, stay secure, watch the system, and control cost.
  5. Draw the design on an architecture canvas.
  6. Practice interview questions out loud.
  7. Do a timed mock if you booked one.
  8. Build a small pipeline in your own AWS account, then delete it the same day.

The 28 lessons

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

Who this is for

People who already use AWS a bit and have an architecture interview coming — or want one.

Who this is not for

This is not a first AWS certification dump. If you are brand new to the cloud, use a longer BayLearn course first.

How to use the player

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)

Weekend clock — if you have 4 hours

Do the blocks in this order. Do not open the 100-question bank first, and do not skip the lab.

Four-hour weekend clock Four hours. This order. Do not start the bank first. 1. 0:00 Assessment 20 min two weak scores 2. 0:20 R-SCALE 25 min one answer aloud 3. 0:45 Core AWS 60 min pick + reject 4. 1:45 Production 40 min HA DR security 5. 2:25 Canvas + hops 45 min 12-hop walk 6. 3:10 Lab / drill 40 min PROCESSED 7. 3:50 Bank filter 10 min weak dims only Mock is a separate booked hour. Do not spend the bank before the canvas.
Four-hour weekend clock
  1. 0:00–0:20 — Quiz. Answer the 15 questions. Write down your two weakest skills.
  2. 0:20–0:45 — R-SCALE. Read the method and the cheat sheet. Say one full answer out loud, in order.
  3. 0:45–1:45 — Core AWS. Compute, storage, databases, messaging, networking, then the 100k story. For each, say what you would pick and one thing you would not pick.
  4. 1:45–2:25 — Production. High availability, disaster recovery, security, observability, cost. Be able to say how fast you must be back, and how much data you can lose.
  5. 2:25–3:10 — Canvas and lab notes. Fill the canvas. Read the 12 hops in Lab architecture. Walk the happy path without looking.
  6. 3:10–3:50 — Build or paper drill. If you have an AWS account: deploy, send a test file, confirm it processed, then delete the stack. If you do not: do the failure-drill lesson on paper.
  7. 3:50–4:00 — A few questions. Open the bank. Do only your weak skills, plus five architecture questions. Out loud.

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

  • Answer 15 scenario questions (not a certification dump)
  • See weak dimensions before the live session

How the assessment works5 min

How the assessment works

How the assessment works

Module 0 is a short placement quiz. It is not the 100-question bank.

LessonWhat it isWhat you do
1. How the assessment worksThis pageRead it, then open lesson 2
2. Readiness AssessmentThe 15-question quizTake it in Learn after you enroll

This page does not score you. Lesson 2 does.

Readiness bands Eight skill scores — not a pass/fail trophy 0-40% Foundation 41-60% Developing 61-80% Interview Ready 81-100% Advanced Architect
Readiness bands from Foundation to Advanced Architect

How to take it

  1. Enroll in this sprint.
  2. Open Learn (the course player).
  3. Open Module 0.
  4. Open the lesson named Readiness Assessment.
  5. You get 15 short stories, one at a time. Each screen shows the skill it scores, such as Compute · 1/15.
  6. Pick the best default. There is no back button.
  7. After question 15 you see:

- your overall percent and a band

- eight skill scores

  1. Write the two weakest skills on paper. Then go to Module 1.

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.

What each question scores

Two questions per skill, except Architecture, which has one.

#SkillThe story is about
1ComputeA bursty image API — Lambda vs a server that stays on vs EKS
2ComputeA 20-minute video job vs Lambda’s 15-minute limit
3StorageKeeping files for 7 years — why a disk volume is the wrong place
4StorageFiles in S3, facts about the files in a database
5NetworkingPrivate compute reading S3 without a big NAT bill
6NetworkingWhat makes a subnet public (the route, not the name)
7DatabaseKnown access patterns — DynamoDB vs a warehouse
8DatabaseA standby database in one Region is high availability, not disaster recovery
9SecurityGive a role only the folder and table it needs
10SecurityWhere a Lambda password should live
11ServerlessOne upload fans out to scan, extract, and notify
12ServerlessAn API that cannot wait 2 minutes — return 202 (accepted, not finished) and a job id
13ResiliencyRecover in 1 hour, lose at most 15 minutes of data
14ResiliencyHow long a queue hides a message vs how long work takes
15ArchitectureAsk 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.

Bands

ScoreLabelWhat to do with your four hours
0–40%FoundationGo slowly on Modules 1 and 2. Do not skip the method.
41–60%DevelopingUse your two weak skills as your practice filter.
61–80%Interview readySpend more time on the canvas and the mock.
81–100%AdvancedUse 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)

Take the 15-question readiness assessment

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.

  1. Always-on EC2 in one AZ, scaled manually at 9am
  2. Lambda (or Fargate scheduled to zero) behind an API, because idle cost should be near zero and bursts are native
  3. EKS with three managed node groups as the simplest option
  4. A single t3.micro with swap

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

  • Open answers with a clarifying sentence
  • Walk R → S → C → A → L → E in order

R-SCALE20 min

R-SCALE

R-SCALE — a simple order for every architecture answer

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.

R-SCALE order R Requirements S Scale C Components A Availability L Limits E Evolution 10x Services come after R and S
R-SCALE: services come after requirements and scale

Why you need an order

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.

Start by saying this

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.

R — Requirements (what are we building?)

Do not treat “build a document platform” as a full spec. Ask until you can fill this table:

AskWhy 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:

  1. Who is the user?
  2. What is one unit of work?
  3. What failure can the business not accept?
  4. How fast must we be back, and how much data can we lose?
  5. What is already in production?

If they will not answer, say your assumptions out loud and write them down.

S — Scale (do the simple math)

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 peak

Always 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.

Napkin math pipeline you run on every prompt Do this arithmetic out loud, in this order 1. Count / day files or requests from the prompt 2. / 86,400 average per second 24 x 60 x 60 3. x peak ask, or 5-10x business hours 4. x size GB/day ingest always ask size 5. x duration concurrency = rate x seconds If you skip size or duration, you cannot pick Lambda vs Fargate or NAT vs endpoints.
Do this arithmetic out loud, in this order

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.

C — Components (what boxes, in what order)

Do not sprinkle logos. Draw in this order:

  1. Who talks to what
  2. Where the file bytes live, where the facts about the file live, and search — three different things
  3. Ingest — the upload path. Keep it small.
  4. Async work — scan, enrich, notify. This can take longer.
  5. Downloads — usually CloudFront plus a firewall
  6. Security labels on those boxes (who can read, which key encrypts)
  7. How you will watch it — the user journey, not a logo that says “logs”

If a box does not serve a requirement or a number, remove it.

A — Availability (stay up in one Region)

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.

L — Limitations (what you give up)

Every pick has a downside. Practice naming it.

If you pickYou give up
Lambda15 minute max, small payload, small temp disk
DynamoDBEasy ad-hoc SQL and cheap joins
Standard SQSStrict first-in, first-out order
One RegionSurviving that Region going down
Scan during uploadUpload stays down if the scanner is down

If you cannot name what you give up, you have not chosen. You have listed products.

E — Evolution (what happens at 10×)

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.

Fourteen steps on a whiteboard

  1. Clarify what they need
  2. Estimate size
  3. APIs
  4. Data (files vs facts vs search)
  5. Compute
  6. Storage
  7. Networking
  8. Async work
  9. Security
  10. How you watch it
  11. Stay up / recover
  12. Cost
  13. Trade-offs
  14. What happens at 10×

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.

Practice

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

Napkin math — step by step, four use cases

Turn a fuzzy prompt into per-second rate, bytes per day, and in-flight workers before you pick a service.

Why this matters

Interviews grade the method. List prices change. The arithmetic does not. If you skip size, you cannot explain why you picked Lambda or Fargate.

Napkin math pipeline you run on every prompt Do this arithmetic out loud, in this order 1. Count / day files or requests from the prompt 2. / 86,400 average per second 24 x 60 x 60 3. x peak ask, or 5-10x business hours 4. x size GB/day ingest always ask size 5. x duration concurrency = rate x seconds If you skip size or duration, you cannot pick Lambda vs Fargate or NAT vs endpoints.
Do this arithmetic out loud, in this order
Four interview use cases reduced to per-second numbers Same method, four prompts  count is not the architecture Documents 100k files / day 1.2 / s avg 12 / s at 10x peak Ask size. 2 MB = 200 GB / day ingest SQS + Lambda REST API 20k DAU x 40 calls 9.3 / s avg ~190 / s at 20x Payloads are small GB/day is tiny APIGW + Lambda SFTP burst 100k in 4 hours 6.9 / s sustained not 1.2 / s Transfer Family same processor math Size for the window Media objects 10k x 200 MB / day 0.12 / s avg 2 TB / day ingest Low QPS, huge bytes Fargate + CloudFront Lambda is the wrong box
Four prompts reduced to per-second numbers
Little's law for processors: concurrency equals arrival times duration Processor math  Little's law on the whiteboard in-flight work = arrival rate (per second) x duration (seconds) Peak arrival 12 files / second Scan duration 8 seconds each Concurrency 12 x 8 = 96 workers If duration is 90s, 12 x 90 = 1,080. That is the number that kills a tiny Lambda story.
Concurrency = arrival x duration

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.”

The idea — five steps (every prompt)

  1. Count / day — files, API calls, or messages. Take it from the prompt, or assume and say so.
  2. Average per second = count ÷ 86,400.
  3. Peak per second = average × peak factor (5–10× for business hours; 1× for a flat batch; 20× for login storms if they hint at it).
  4. Bytes / day = count × object size. Always ask size. A count with no size is not enough.
  5. Concurrency = peak per second × duration in seconds. That is how many workers you need in flight.

Then pick Lambda vs Fargate vs a cluster.

Use case 1 — Document ingest (the main sprint story)

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/s

Step 3 — peak. They did not give a peak. Assume 10× business hours.

text

100k peak ≈ 12 files/s
1M peak   ≈ 120 files/s

Step 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/day

If 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-flight

What the numbers decide

SignalDecision
1.2–12 files/sNot Kinesis, not Kafka, not EKS “for scale”
200 GB–2 TB/day at 2 MBS3; watch lifecycle and versions, not EC2 size
8 s × 12/s ≈ 96 workersLambda is honest
90 s × 120/s ≈ 10,800Fargate (or a fleet). Lambda’s 15-minute timeout is fine; concurrency and /tmp are not
10 TB/dayScanner 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.”

Use case 2 — REST API (humans, small JSON)

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/s

Step 4. JSON 5 KB. Bytes are small next to documents.

text

800,000 × 5 KB ≈ 4 GB/day

Step 5. Handler 50 ms = 0.05 s.

text

Concurrency ≈ 186 × 0.05 ≈ 9

Decision: 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.

Use case 3 — SFTP burst (same 100k files, wrong window)

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 hours

There 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.”

Use case 4 — Large media (low rate, huge bytes)

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 ingest

Step 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 out

Point 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.”

Two extra numbers that come up

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.”

What to say

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

Napkin math pocket card

BayLearn · AWS Solutions Architect Interview Sprint

Seconds/day = 86,400 (24 × 60 × 60)

  1. Count / day
  2. Average / s = count ÷ 86,400
  3. Peak / s = average × peak factor (ask, or 5–10×; 20× login storms; 1× flat batch)
  4. Bytes / day = count × object size (always ask size)
  5. In-flight = peak / s × duration seconds
PromptAvgPeak (10× unless noted)Bytes (example)Default
100k files/day1.2/s12/s2 MB → 200 GB/daySQS + Lambda
1M files/day12/s120/s2 MB → 2 TB/daySame; watch scanner
100k in 4 h SFTP—7/s sustained2 MB → 200 GB in 4 hTransfer + same processor
20k DAU × 40 calls9.3/s~190/s at 20×JSON → ignore GBAPI GW + Lambda
10k × 200 MB video0.12/s1.2/s2 TB/dayFargate + 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

R-SCALE — pocket card

BayLearn Interview Sprints · AWS Solutions Architect

R-SCALE order R Requirements S Scale C Components A Availability L Limits E Evolution 10x Services come after R and S
R-SCALE: services come after requirements and scale
LetterMeaningSay this
RRequirementsWho uses it, what success is, what must not fail
SScalePer second, file size, peak vs average
CComponentsDraw boxes only after R and S
AAvailabilityMore than one AZ (Availability Zone), health checks, how fast we recover
LLimitationsWhat you give up, and why that is OK
EEvolutionWhat breaks at 10×

Design order

Clarify → size → APIs → data → compute → storage → network → async → security → watch it → recover → cost → trade-offs.

Lines you can reuse

  • “I am assuming X. Tell me if that is wrong.”
  • “I will keep upload thin and do heavy work after, in the background.”
  • “File bytes go in S3. Facts about the file go in DynamoDB or Aurora.”
  • “Retries can run twice. The handler must be safe to run twice.”
  • “Multi-AZ is staying up. Multi-Region is a recover conversation with numbers.”

Downloadable cheat sheet

Downloadable cheat sheet

R-SCALE cheat sheet

BayLearn · AWS Solutions Architect Interview Sprint

LetterMeaningSay this
RRequirementsWho uses it, what success is, what must not fail
SScalePer second, file size, peak vs average
CComponentsDraw boxes only after R and S
AAvailabilityMore than one AZ, health checks, how fast we recover
LLimitationsWhat you gave up, and why that is OK
EEvolutionWhat breaks at 10×

Design order

Clarify → size → APIs → data → compute → storage → network → async → security → watch it → recover → cost → trade-offs.

Defaults you can say

  • Keep upload thin. Do heavy work later, in the background.
  • File bytes in S3. Facts about the file in DynamoDB or Aurora.
  • Retries can run twice. The handler must be safe to run twice.
  • Multi-AZ is staying up. Multi-Region is a recover conversation with numbers.

Napkin math workbook

Napkin math workbook

Napkin math — step by step, four use cases

Turn a fuzzy prompt into per-second rate, bytes per day, and in-flight workers before you pick a service.

Why this matters

Interviews grade the method. List prices change. The arithmetic does not. If you skip size, you cannot explain why you picked Lambda or Fargate.

Napkin math pipeline you run on every prompt Do this arithmetic out loud, in this order 1. Count / day files or requests from the prompt 2. / 86,400 average per second 24 x 60 x 60 3. x peak ask, or 5-10x business hours 4. x size GB/day ingest always ask size 5. x duration concurrency = rate x seconds If you skip size or duration, you cannot pick Lambda vs Fargate or NAT vs endpoints.
Do this arithmetic out loud, in this order
Four interview use cases reduced to per-second numbers Same method, four prompts  count is not the architecture Documents 100k files / day 1.2 / s avg 12 / s at 10x peak Ask size. 2 MB = 200 GB / day ingest SQS + Lambda REST API 20k DAU x 40 calls 9.3 / s avg ~190 / s at 20x Payloads are small GB/day is tiny APIGW + Lambda SFTP burst 100k in 4 hours 6.9 / s sustained not 1.2 / s Transfer Family same processor math Size for the window Media objects 10k x 200 MB / day 0.12 / s avg 2 TB / day ingest Low QPS, huge bytes Fargate + CloudFront Lambda is the wrong box
Four prompts reduced to per-second numbers
Little's law for processors: concurrency equals arrival times duration Processor math  Little's law on the whiteboard in-flight work = arrival rate (per second) x duration (seconds) Peak arrival 12 files / second Scan duration 8 seconds each Concurrency 12 x 8 = 96 workers If duration is 90s, 12 x 90 = 1,080. That is the number that kills a tiny Lambda story.
Concurrency = arrival x duration

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.”

The idea — five steps (every prompt)

  1. Count / day — files, API calls, or messages. Take it from the prompt, or assume and say so.
  2. Average per second = count ÷ 86,400.
  3. Peak per second = average × peak factor (5–10× for business hours; 1× for a flat batch; 20× for login storms if they hint at it).
  4. Bytes / day = count × object size. Always ask size. A count with no size is not enough.
  5. Concurrency = peak per second × duration in seconds. That is how many workers you need in flight.

Then pick Lambda vs Fargate vs a cluster.

Use case 1 — Document ingest (the main sprint story)

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/s

Step 3 — peak. They did not give a peak. Assume 10× business hours.

text

100k peak ≈ 12 files/s
1M peak   ≈ 120 files/s

Step 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/day

If 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-flight

What the numbers decide

SignalDecision
1.2–12 files/sNot Kinesis, not Kafka, not EKS “for scale”
200 GB–2 TB/day at 2 MBS3; watch lifecycle and versions, not EC2 size
8 s × 12/s ≈ 96 workersLambda is honest
90 s × 120/s ≈ 10,800Fargate (or a fleet). Lambda’s 15-minute timeout is fine; concurrency and /tmp are not
10 TB/dayScanner 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.”

Use case 2 — REST API (humans, small JSON)

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/s

Step 4. JSON 5 KB. Bytes are small next to documents.

text

800,000 × 5 KB ≈ 4 GB/day

Step 5. Handler 50 ms = 0.05 s.

text

Concurrency ≈ 186 × 0.05 ≈ 9

Decision: 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.

Use case 3 — SFTP burst (same 100k files, wrong window)

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 hours

There 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.”

Use case 4 — Large media (low rate, huge bytes)

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 ingest

Step 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 out

Point 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.”

Two extra numbers that come up

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.”

What to say

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

Napkin math pocket card

BayLearn · AWS Solutions Architect Interview Sprint

Seconds/day = 86,400 (24 × 60 × 60)

  1. Count / day
  2. Average / s = count ÷ 86,400
  3. Peak / s = average × peak factor (ask, or 5–10×; 20× login storms; 1× flat batch)
  4. Bytes / day = count × object size (always ask size)
  5. In-flight = peak / s × duration seconds
PromptAvgPeak (10× unless noted)Bytes (example)Default
100k files/day1.2/s12/s2 MB → 200 GB/daySQS + Lambda
1M files/day12/s120/s2 MB → 2 TB/daySame; watch scanner
100k in 4 h SFTP—7/s sustained2 MB → 200 GB in 4 hTransfer + same processor
20k DAU × 40 calls9.3/s~190/s at 20×JSON → ignore GBAPI GW + Lambda
10k × 200 MB video0.12/s1.2/s2 TB/dayFargate + 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-SCALE — a simple order for every architecture answer

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.

R-SCALE order R Requirements S Scale C Components A Availability L Limits E Evolution 10x Services come after R and S
R-SCALE: services come after requirements and scale

Why you need an order

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.

Start by saying this

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.

R — Requirements (what are we building?)

Do not treat “build a document platform” as a full spec. Ask until you can fill this table:

AskWhy 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:

  1. Who is the user?
  2. What is one unit of work?
  3. What failure can the business not accept?
  4. How fast must we be back, and how much data can we lose?
  5. What is already in production?

If they will not answer, say your assumptions out loud and write them down.

S — Scale (do the simple math)

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 peak

Always 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.

Napkin math pipeline you run on every prompt Do this arithmetic out loud, in this order 1. Count / day files or requests from the prompt 2. / 86,400 average per second 24 x 60 x 60 3. x peak ask, or 5-10x business hours 4. x size GB/day ingest always ask size 5. x duration concurrency = rate x seconds If you skip size or duration, you cannot pick Lambda vs Fargate or NAT vs endpoints.
Do this arithmetic out loud, in this order

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.

C — Components (what boxes, in what order)

Do not sprinkle logos. Draw in this order:

  1. Who talks to what
  2. Where the file bytes live, where the facts about the file live, and search — three different things
  3. Ingest — the upload path. Keep it small.
  4. Async work — scan, enrich, notify. This can take longer.
  5. Downloads — usually CloudFront plus a firewall
  6. Security labels on those boxes (who can read, which key encrypts)
  7. How you will watch it — the user journey, not a logo that says “logs”

If a box does not serve a requirement or a number, remove it.

A — Availability (stay up in one Region)

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.

L — Limitations (what you give up)

Every pick has a downside. Practice naming it.

If you pickYou give up
Lambda15 minute max, small payload, small temp disk
DynamoDBEasy ad-hoc SQL and cheap joins
Standard SQSStrict first-in, first-out order
One RegionSurviving that Region going down
Scan during uploadUpload stays down if the scanner is down

If you cannot name what you give up, you have not chosen. You have listed products.

E — Evolution (what happens at 10×)

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.

Fourteen steps on a whiteboard

  1. Clarify what they need
  2. Estimate size
  3. APIs
  4. Data (files vs facts vs search)
  5. Compute
  6. Storage
  7. Networking
  8. Async work
  9. Security
  10. How you watch it
  11. Stay up / recover
  12. Cost
  13. Trade-offs
  14. What happens at 10×

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.

Practice

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

  • Pick one service and say why, not list ten
  • Design upload for 100k files/day

Compute selection10 min

Compute selection

Compute selection — deep dive

Pick the compute that matches the job. Then name the limit that would make you switch.

Why this matters

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.

Compute default by workload shape Pick from workload shape — not from fashion Lambda Burst, short, events 15 min / payload limits ECS Fargate Containers, long jobs No nodes to patch EKS Only if k8s is already an operated platform EC2 + ASG GPU, kernel, steady high utilization
Compute default by workload shape
Serverless document pipeline Client API Gateway Ingest Lambda S3 EventBridge SQS Processor DynamoDB SNS DLQ
Lab pipeline the ingest Lambda sits on

Working code — ingest Lambda (from the sprint lab)

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
    }
  }
}

How to choose

Lambda

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:

  • Timeout is 15 minutes at most
  • Memory also sets CPU
  • Temp disk (/tmp) starts at 512 MB and can go to 10 GB. That is still not a file farm
  • Sync payload through API Gateway is 6 MB. Many async events are 256 KB. An S3 event is a pointer to the file, not the file
  • Concurrency is how many copies run at once. 100k files/day is about 1.2 per second on average. That is a small number unless each scan is slow
  • If you put Lambda in a VPC (your private network), add gateway endpoints for S3 and DynamoDB. Those are private routes so you skip NAT. If you skip the endpoints, traffic goes through NAT Gateway and the bill jumps

A 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.

ECS on Fargate

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

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 (plus Auto Scaling and a load balancer)

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: API Gateway vs a load balancer
Front doorUse when
API Gateway HTTP/RESTRequest/response APIs, auth, throttling, Lambda proxy
ALBHTTP to ECS or EC2, path routing, longer connections
NLBRaw TCP, static IPs, TLS passthrough
CloudFrontGlobal 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.

Limits that change the document platform

ConstraintWhat you do
Lambda 15 minLarge file scan → Fargate worker
Lambda 6 MB syncUpload goes to S3, not in the JSON body
/tmpStream to S3. Do not load a 500 MB PDF into memory
Burst 10×Queue + more workers, not “a bigger box”
VPC Lambda and no endpointsNAT Gateway becomes the design

Decision table

If this is trueStart with
Bursty, short, event-drivenLambda
Containers, little cluster workECS Fargate
Many services and the team already runs KubernetesEKS
Special kernel, GPU, steady high useEC2 + Auto Scaling
Jobs longer than 15 minutesFargate or Batch
Batch that can wait and can be interruptedSpot, with a drain plan (never the only ingest path)

Worked design — 100k files/day

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.

If they ask

“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.

What to say

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

Compute selection guide

WorkloadFirst pickWhy
Short burst, event-drivenLambdaYou pay when it runs. Idle cost is near zero.
Container, little opsECS FargateYou ship a container. You do not manage nodes.
Many services, and you already run KubernetesEKSUse it when the team already operates it well.
Steady high use, or special hardwareEC2You control the machine. Price can be better at steady load.
Jobs longer than 15 minutesFargate or BatchLambda stops at 15 minutes.
Batch that can be interruptedSpot, then drainDo not use Spot as the only upload path.

Storage selection8 min

Storage selection

Storage selection — deep dive

Put file bytes in S3. Keep the landing bucket hostile. Serve files only after a scan.

Why this matters

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.

Landing vs clean buckets Client S3 landing hostile � no download origin Scanner S3 clean CloudFront / presigned GET Upload is never served until scan promotes it Ingest role: PUT landing only Download role: GET clean only
Landing bucket is hostile; clean bucket is the download origin

Working code — encrypt and block public access

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" } }
  }]
}

The idea — three different products

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.

How S3 shows up in interviews

Durability vs availability

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.

Encryption
  • SSE-S3: AWS-owned keys. Fine for many internal objects.
  • SSE-KMS (CMK): You own the key policy. CloudTrail can log Decrypt. Default for customer documents. You can allow GetObject but deny kms:Decrypt.
  • S3 Bucket Keys: Fewer KMS calls when you have millions of objects.
  • SSE-C: The caller sends the key every time. Rare unless they force it.
Landing vs clean (the security design)
  1. The client uploads to landing (presigned PUT or Transfer Family). Block Public Access is on. CloudFront does not read landing.
  2. The object is hostile until scanned. Product users cannot download landing.
  3. The scanner reads landing only. On clean: copy to the clean prefix or bucket. Write metadata status=CLEAN.
  4. On reject: move to a quarantine prefix. Alert. Do not say “file ready.”
  5. Downloads (CloudFront signed URL or S3 presigned GET) point at clean only.
Versioning, replication, lifecycle — say who pays
FeatureSay this or do not turn it on
VersioningRecovers overwrite or delete. Set noncurrent expiration or you pay forever
ReplicationCopy to another Region. Lag is the RPO unless you buy RTC. Replica keys and IAM must work
Intelligent-TieringGood when access is unknown. Watch the monitoring charge
GlacierName 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.

Events

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.

Presigned URLs

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.

Decision table

DataDefaultNot the default
Customer documentsS3 + customer-managed KMS keyEBS volume as the archive
Boot / instance diskEBS gp3 (io2 if you can justify IOPS)S3 mounted as a disk
Shared POSIX across tasksEFSOne EBS volume with many writers
Cold / audit copiesLifecycle to IA or Glacier, with restore time namedStandard forever “just in case”
Scratch/tmp or ephemeral diskA second public landing bucket

Worked design — document platform

  • Landing bucket: private, Block Public Access, SSE-KMS, versioning only if you expire old versions.
  • Clean bucket: a separate bucket or prefix, and a different IAM role. CloudFront OAC (origin access control) points here only.
  • Metadata is not a 10 MB JSON on EBS. Bytes stay in S3. Keys and status stay in DynamoDB.
  • Multipart upload for large objects. Abort leftover parts with a lifecycle rule. Orphaned parts still cost money.

If they ask

“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.

What to say

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

Database selection — deep dive

Draw the queries and keys first. Then pick DynamoDB or Aurora.

Why this matters

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.”

Bytes in S3, metadata in DynamoDB Access patterns first, then the engine S3 � system of record for bytes landing/fileId/contract.pdf clean/fileId/contract.pdf KMS key is not in the DynamoDB item DynamoDB � keys and status PK jobId / FILE#id s3Key, status, sha256 item must stay under 400 KB
Bytes stay in S3; keys and status stay in DynamoDB

Working code — table, item, safe status update

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.

How to choose

How DynamoDB behaves

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.

  • Capacity: on-demand vs provisioned. For bursty ingest, on-demand is the usual interview default until the load is steady.
  • Hot partitions: one famous customerId can soak all writes. Split with customerId#shard, or pick a better key.
  • 400 KB item size. The PDF does not go in the item. Store the S3 key, checksum, status, and times.
  • GSIs (global secondary indexes) are extra copies you can query. “Find by SHA-256” might be a GSI on checksum. Say the extra write cost.
  • Consistency: normal reads can be a bit stale. Strong reads work on the base table, not on a GSI. Do not promise a GSI is strongly consistent.
  • Transactions: 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.

How Aurora / RDS behaves

Aurora and RDS are relational databases. You get SQL, joins, and transactions that match invoices and entities.

  • Failover: Multi-AZ. Clients must retry. Failover is seconds, not zero. Use RDS Proxy if many Lambdas would open too many connections.
  • Disk can grow. The interview failure is usually connection count or lock contention, not “disk full.”
  • Read replicas lag. Do not read “did my write land?” from a replica.

Use Aurora when they add invoices, multi-row transactions, or reporting that GSIs cannot do.

Cache and search are not the source of truth

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.

Decision table

PatternDefaultWatch-outs
Known key, high scale, small itemDynamoDBHot keys; 400 KB; GSI consistency
Relational, joins, reportingAurora / RDSConnections; failover; replica lag
Hot keys / sessionElastiCacheNot the source of truth
Full-text searchOpenSearchNot money, not the legal record
Analytics / “all files with virus X in 90 days”Warehouse, or S3 + AthenaNot a DynamoDB SCAN on the API path

COMMON MISTAKE: Bytes in DynamoDB, metadata in S3. Flip it: bytes in S3, metadata in a database.

Worked schema — document platform

Access patterns (write these on the board first):

  1. Get a file by fileId
  2. List a customer’s recent files (customerId + createdAt)
  3. Worker updates status (LANDING → SCANNING → CLEAN or REJECTED)

Item (DynamoDB):

  • PK: FILE#<fileId>
  • Or PK CUSTOMER#<customerId> and SK FILE#<timestamp>#<fileId> if list-by-customer is the hot path. Then add a GSI on FILE#<fileId> for point gets
  • Attributes: s3LandingKey, s3CleanKey, status, contentType, sizeBytes, sha256, createdAt, updatedAt

What 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.

If they ask

“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.

What to say

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

Database selection guide

Access patternFirst pickDo not
Get by key, or list by tenant and dayDynamoDBDo not SCAN the table as your API.
Relational data and transactionsAurora or RDSDo not force DynamoDB to act like SQL.
Hot keys or a cacheElastiCacheDo not treat cache as the source of truth.
Full text or logsOpenSearchDo not use search as the system of record.
AnalyticsWarehouse or a data lakeDo not put RDS on the request path for this.

Messaging and workflow8 min

Messaging and workflow

Messaging and workflow — deep dive

After upload, a queue holds the work. Workers compete for it. A retry must be safe to run twice.

Why this matters

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.

How to choose

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.

NeedToolWhat it is
Many workers, a buffer, retriesSQSA queue. Each message goes to one worker (standard).
Fan-out “this happened”SNSPub/sub. One publish, many subscribers.
Filter, archive, many AWS sourcesEventBridgeA bus plus rules. You can replay from an archive.
Ordered high-volume stream, replay by shardKinesisA partitioned log. You manage shards.
A long branching workflow you can auditStep FunctionsA 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.

Serverless document pipeline Client API Gateway Ingest Lambda S3 EventBridge SQS Processor DynamoDB SNS DLQ
S3 to EventBridge to SQS to processor, with a DLQ

Working code — event pattern, redrive, processor

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}))

How SQS works

  • Standard: at-least-once delivery, best-effort order, very high throughput. This is the default.
  • FIFO: order per message group, and exactly-once *processing* only if you set dedup IDs right. Throughput is capped. Name a message group id (for example customerId). Other groups still run in parallel. Do not pick FIFO “just in case.”
  • Visibility timeout: if the worker dies mid-scan, the message shows up again. Set the timeout longer than the worst scan, or heartbeat with ChangeMessageVisibility.
  • DLQ: after maxReceiveCount, poison messages leave the main queue. Alarm on DLQ depth. A silent DLQ does not help.
  • Partial batch failure: with Lambda, report which items failed so the good ones are not retried.

COMMON MISTAKE: Kinesis at a 12 files/sec peak. SQS is enough until you need per-key order or replay by shard.

EventBridge vs S3 → Lambda directly

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.

SNS

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.

Kinesis — when it is honest

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.

Step Functions — when it is honest

  • A vendor scan that calls back later
  • Undo steps (delete the clean copy if notify fails and policy says you must)
  • Human approval
  • A visual audit for compliance

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.

Idempotency (say this before they ask)

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.”

Worked path — document platform

  1. The object lands in S3 (presigned PUT, or an API that writes it).
  2. EventBridge rule: Object Created on the landing prefix.
  3. Target: SQS (not Lambda directly).
  4. Processor: scan, write DynamoDB, copy to clean, then SNS FileReady.
  5. Failures: retry on timeout. DLQ after N. Alarm. Re-drive from S3. The object is the source of truth, not the message.

Reprocess Tuesday: replay the EventBridge archive, or query DynamoDB by createdAt and re-enqueue. Do not “replay SQS.” SQS is not a log.

If they ask

“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.

What to say

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

Messaging selection guide

NeedFirst pick
Many workers, a buffer, retriesSQS
Tell many subscribers one thing happenedSNS
Many AWS sources, plus filter or archiveEventBridge
Ordered high-volume streamKinesis
A workflow you can see and auditStep Functions
User is waiting for a replyKeep that path sync. Queue the rest.

Networking8 min

Networking

Networking — deep dive

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).

Why this matters

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.

VPC endpoints not NAT for S3 Private subnet Processor Lambda / Fargate Gateway VPC endpoint S3 / DynamoDB NAT Gateway not for S3/DDB Correct path is left-to-middle. NAT is only for true internet APIs.
Gateway VPC endpoints for S3 and DynamoDB — not NAT
Two-AZ network topology for the document platform Draw this topology  edge first, then VPC, then data EDGE / AWS-MANAGED  these boxes are not subnets Users Route 53 CloudFront + WAF API Gateway (HTTPS) Transfer Family (SFTP) VPC 10.0.0.0/16  two AZs, public vs private IGW Internet Gateway  ALB/NAT uplink only. Not for S3. AZ-a Public 10.0.0.0/24 NAT Gateway (optional) � ALB if HTTP to ECS Private 10.0.10.0/24 Processor � no public IP RDS only if you actually need SQL AZ-b Public 10.0.1.0/24 Second NAT for HA � same ALB Private 10.0.11.0/24 Processor replica subnet Aurora standby if used Gateway VPC endpoints on private route tables S3 prefix list + DynamoDB prefix list  bytes never hit NAT AWS managed APIs No subnet. Reach via public AWS or via the gateway endpoints. S3 landing / clean DynamoDB metadata EventBridge � SQS � SNS NAT is not this column NAT = vendor HTTPS / yum only Lambda ingest often stays outside the VPC entirely.
Two-AZ topology: edge, public/private subnets, gateway endpoints

INTERVIEW TIP: Most production APIs look like this: CloudFront + WAF → API Gateway or a public ALB → private compute → private data.

How to draw it (do this on the board, in order)

Do not start with twenty services. Draw planes. Say each step.

  1. Actors. Humans on HTTPS, partners on SFTP, maybe an internal service. One box per actor.
  2. DNS. Route 53. Alias to CloudFront (downloads) and to API Gateway (ingest). Route 53 is not in a subnet.
  3. Edge. CloudFront + WAF in front of clean downloads. Size limits and managed rules on WAF. The landing bucket is not an origin.
  4. Ingest entry (not a subnet). API Gateway for HTTPS. AWS Transfer Family for SFTP into landing. These are regional AWS endpoints.
  5. VPC rectangle. CIDR such as 10.0.0.0/16. Draw two Availability Zones or you have not drawn high availability.
  6. Public vs private in each AZ. Public has a route to the Internet Gateway. Private does not. Put NAT in public only if something in private must call the real internet.
  7. Compute. Default: ingest Lambda outside the VPC. Put the processor in private subnets only if it must reach a private scanner (or an old RDS). No public IPs on workers.
  8. Data stores. S3 and DynamoDB stay outside the VPC as AWS APIs. Aurora, if you need SQL, is in private subnets, Multi-AZ.
  9. Endpoints. On the private route tables, add gateway VPC endpoints for S3 and DynamoDB. Those are private routes, not extra servers. Interface endpoints (PrivateLink ENIs) are for APIs that need them — you pay hourly.
  10. NAT last. Draw NAT, then cross it out for S3 and DynamoDB. Leave it for a vendor malware API or OS repos. Label the expensive arrows: NAT GB, cross-AZ, egress.

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.”

Working code — S3 gateway endpoint (the NAT fix)

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:

  1. DNS: Route 53. Alias to CloudFront or API Gateway.
  2. Edge: CloudFront (TLS, geo, cache of safe GETs) + WAF (size limits, then app rules).
  3. Entry: API Gateway for ingest (often no VPC). ALB if you terminate HTTP to ECS or EC2.
  4. Compute: private subnets, no public IPs on workers.
  5. Data: S3, DynamoDB, and Aurora in private space if you run SQL.
  6. Endpoints: Gateway VPC endpoints for S3 and DynamoDB. Interface endpoints only where needed.
  7. NAT: only for a few real internet targets. Not for S3.

COMMON MISTAKE: NAT Gateway for all S3 and DynamoDB traffic. That is cost and a dependency you did not need.

VPC pieces, in plain words

  • Subnets: public (route to the Internet Gateway) vs private (NAT or endpoints only). Put databases and workers in private.
  • Route tables: one per tier if you need isolation. Do not overdraw.
  • Internet Gateway: for the public edge (ALB) or NAT’s uplink. Not for DynamoDB.
  • Security groups: stateful firewall. Processor SG: egress to S3/DynamoDB endpoints and maybe one scanner. No 0.0.0.0/0 on data stores.
  • NACLs: stateless, subnet-level, easy to break. Fine for a coarse deny. Do not design the app around them.
  • Transit Gateway: many VPCs or hybrid. Not for a single new VPC.

Lambda in a VPC

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.

SFTP vs HTTPS entry

  • HTTPS humans and apps: API Gateway + presigned S3 PUT, or CloudFront + S3.
  • Partner SFTP: AWS Transfer Family into the landing bucket. Same scan path. Do not open port 22 on EC2 unless an old system forces a jump host.

Cost arrows you must name

ArrowWhy it hurtsFix
NAT for S3/DynamoDBPer-GB + hourlyGateway endpoints
Cross-AZ chatty trafficData transferKeep the processor path tight. You still need Multi-AZ for HA of NAT or ALB
Egress / CloudFront to the internetDownloads dominateCache clean objects. Do not serve landing
Interface endpoints everywhereHourly + per-GBOnly where needed

Worked design — document platform

  • Public: CloudFront + WAF for clean downloads. API Gateway for ingest auth and presign.
  • Private: processor in a VPC only if the scanner is private. Else processor Lambda with no VPC.
  • Gateway endpoints on the VPC that needs S3.
  • No Transit Gateway. No public RDS. No public S3.

If they ask

“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.

What to say

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

Deployment posture — where each service actually lives

Put each box on one of four planes so you stop drawing S3 inside a subnet.

Why this matters

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.

Where each AWS service actually lives Deployment posture  do not put every logo inside the VPC 1. Global edge Route 53 � CloudFront � WAF � Shield. No subnet. Terminate TLS and cache here. 2. Regional managed  no ENI, no subnet API Gateway � Lambda (default) � S3 � DynamoDB � SQS � SNS � EventBridge � KMS � CloudWatch 3. VPC public subnets Internet Gateway � NAT Gateway � public ALB. Only what must have a public IP or an internet route. 4. VPC private subnets Fargate/EC2 workers � Lambda-in-VPC � Aurora/RDS � Interface VPC endpoints. No public IP. Common fail Putting S3, DynamoDB, or SQS in a private subnet. They are not EC2. You attach endpoints, you do not launch them.
Where each AWS service actually lives
Two honest postures for the same document platform Same product, two postures  pick from the scanner, not from fashion Mode A  serverless default API Gateway + Lambda ingest (no VPC) S3 + EventBridge + SQS + Lambda processor DynamoDB + SNS � CloudFront on clean Use when scan is a library or SaaS reachable on the public AWS API. No NAT. No ENI. Lab posture. Mode B  private worker Same ingest (still often no VPC) Processor in private subnets (Fargate or Lambda-in-VPC) to reach a private scanner Gateway endpoints for S3 and DynamoDB NAT only for the scanner vendor URL Forgetting endpoints is the NAT bill.
Same product, two postures

The idea — four planes

Ask where the box actually runs before you draw it. Then park it on one of these four planes.

PlaneWhat lives hereWhat does not
1. Global edgeRoute 53, CloudFront, WAF, ShieldYour Lambda, your database
2. Regional managedAPI Gateway, default Lambda, S3, DynamoDB, SQS, SNS, EventBridge, KMS, CloudWatchThings that need your network card (ENI)
3. VPC public subnetsInternet Gateway, NAT Gateway, public ALBData stores, processors
4. VPC private subnetsFargate/EC2, Lambda-in-VPC, Aurora, interface VPC endpointsS3 “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.”

How to choose a posture

Walk this in the interview. Do not skip.

  1. What must be reachable from the internet? Ingest API (HTTPS) and maybe SFTP. Downloads of clean objects. That is edge + API Gateway / Transfer / CloudFront. Not a public EC2.
  2. Where do bytes live? S3. Plane 2. Bucket policy + Block Public Access. Origin Access Control on CloudFront for clean.
  3. Where does metadata live? DynamoDB (plane 2) unless you named a SQL query that forces Aurora (plane 4).
  4. Does the processor need a private IP?

- 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.

  1. Do you need an ALB? Only if you terminate HTTP to ECS or EC2. API Gateway ingest does not need an ALB.
  2. Do you need NAT? Only after step 4 said “yes, real internet from private.” Two NATs (one per AZ) if that path is in the HA story.
  3. Security groups. Stateful firewall on plane 4. Processor SG: egress to S3/DynamoDB prefix lists (or 443 to endpoints) and to the scanner. Database SG: ingress only from the processor SG. No 0.0.0.0/0 on data.
  4. Say the skip out loud. “I am not placing S3, SQS, or DynamoDB in a subnet.”

Mode A vs Mode B (same product)

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 only

Use 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 only

Use when the scanner cannot be reached without a VPC. Forgetting the gateway endpoints is how NAT costs more than compute.

Working code — the two things that encode posture

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-by-service cheat (document platform)

ServicePlaneDeploy how
Route 531Hosted zone; alias A/AAAA
CloudFront + WAF1Distribution; OAC to clean S3; WAF web ACL
API Gateway HTTP API2JWT/IAM authorizer; Lambda integration; no VPC link unless you force one
Transfer Family2 (or VPC)SFTP to landing prefix; same scan path
Lambda ingest2No VPC; short timeout; 202
S3 landing / clean2Separate prefixes or buckets; KMS; Block Public Access
EventBridge + SQS + DLQ2Rule on Object Created; redrive
Lambda processor2 or 44 only for a private scanner
Fargate processor4Private subnets; assign_public_ip = false
DynamoDB2On-demand; keys named; point-in-time recovery
SNS2Fan-out after CLEAN
Aurora4Only if you named SQL queries
NAT Gateway3Optional; one per AZ; not for S3
Gateway VPCEVPC routeS3 + DynamoDB on private tables
Interface VPCE4Secrets Manager, and the like — only if needed
ALB3 or 4Public vs internal; skip if API Gateway is the door

If they ask

“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.

What to say

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

Scenario deep dive — 100k files/day → 1M

Run R-SCALE on 100k files a day, with numbers. Then say what changes at 1 million.

Why this matters

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.

The prompt (memorize)

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?

Global document platform Edge Route 53 � CloudFront + WAF � API Gateway � Transfer Family Ingest and store HTTPS presigned PUT or SFTP S3 landing (hostile, KMS, BPA) EventBridge � SQS + DLQ Processor Lambda / Fargate Promote and notify Scan then copy to S3 clean DynamoDB metadata (fileId, status) SNS / EventBridge FileReady CloudFront origin = clean only Cross-cutting IAM least privilege � CMK � CloudTrail / GuardDuty Multi-AZ HA � PITR + versioning for DR � alarms on DLQ and time-to-CLEAN Cost arrows: NAT, egress, logs, versions  not peak EC2
First-pass global document platform
Napkin math pipeline you run on every prompt Do this arithmetic out loud, in this order 1. Count / day files or requests from the prompt 2. / 86,400 average per second 24 x 60 x 60 3. x peak ask, or 5-10x business hours 4. x size GB/day ingest always ask size 5. x duration concurrency = rate x seconds If you skip size or duration, you cannot pick Lambda vs Fargate or NAT vs endpoints.
Napkin math pipeline

text

HTTPS/SFTP → landing S3 → EventBridge → SQS+DLQ → scan
          → clean S3 + DynamoDB status → SNS FileReady
          → CloudFront origin = clean only

Scale napkin (say it)

text

100,000 files/day  ≈ 1.2 files/sec average
Peak 10×           ≈ 12 files/sec
1,000,000/day      ≈ 12 files/sec average, 120/sec peak

Object 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.

R — Requirements (do not skip)

QuestionWhy 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

C — First-pass components (eight boxes, not twenty)

PlaneDefaultWhy
Ingest HTTPSAPI Gateway + Lambda presign (or Transfer for SFTP)Payload limits; S3 owns bytes
BytesS3 landing (hostile) → clean after scanSource of truth for objects
EventEventBridge → SQS + DLQBuffer, retry, reprocess
ProcessLambda; Fargate if the scan is longQueue absorbs 10×
MetadataDynamoDB, keys namedGet and list patterns
NotifySNSFan-out
Edge downloadCloudFront + WAF on cleanNever landing
SecurityCustomer-managed key, Block Public Access, tight rolesLanding 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.

A — Availability (in one Region)

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.

L — Limitations (what you gave up)

  • Lambda timeout vs large files → Fargate
  • Scanner speed is the first 10× bottleneck, not S3
  • Notify is at-least-once
  • You did not add a warehouse in pass one

E — Evolution to 1M/day

  • S3 and SQS still fine
  • Watch processor concurrency and scanner capacity
  • Split ingest vs process if they share one function today
  • Lifecycle on versions; S3 Bucket Keys for KMS
  • Revisit Step Functions if scan becomes a long callback
  • A second Region only if recovery numbers demand it (see the DR lesson)

If they ask

“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.

What to say

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

AWS service selection matrix

NeedFirst choiceAlternativeAvoid when
Bursty HTTP APIAPI Gateway + LambdaALB + FargateYou need to process a 20-minute request body
Long workersECS Fargate or BatchEC2 Auto ScalingYou are hitting the Lambda 15-minute limit
ObjectsS3EFS only if you need a shared POSIX file systemUsing EBS as a shared store
Metadata you look up by a known keyDynamoDBAurora if the data is relationalUsing SCAN as your API
BufferSQSKinesis if you need strict order per shardChaining Lambda to Lambda with no queue
Fan-outSNS or EventBridge—Hard-coding many extra invokes
WorkflowStep FunctionsA queue plus a status machineHiding state only in the UI
EdgeCloudFront + WAFRegional API onlyLeaving the origin open to bypass
SecretsSecrets ManagerSSM SecureStringSecrets in Git or plaintext env vars
Hybrid networkTransit Gateway or Direct ConnectVPN firstPeering every VPC when you have ~30 VPCs

Napkin math workbook (four use cases)

Napkin math workbook (four use cases)

Napkin math — step by step, four use cases

Turn a fuzzy prompt into per-second rate, bytes per day, and in-flight workers before you pick a service.

Why this matters

Interviews grade the method. List prices change. The arithmetic does not. If you skip size, you cannot explain why you picked Lambda or Fargate.

Napkin math pipeline you run on every prompt Do this arithmetic out loud, in this order 1. Count / day files or requests from the prompt 2. / 86,400 average per second 24 x 60 x 60 3. x peak ask, or 5-10x business hours 4. x size GB/day ingest always ask size 5. x duration concurrency = rate x seconds If you skip size or duration, you cannot pick Lambda vs Fargate or NAT vs endpoints.
Do this arithmetic out loud, in this order
Four interview use cases reduced to per-second numbers Same method, four prompts  count is not the architecture Documents 100k files / day 1.2 / s avg 12 / s at 10x peak Ask size. 2 MB = 200 GB / day ingest SQS + Lambda REST API 20k DAU x 40 calls 9.3 / s avg ~190 / s at 20x Payloads are small GB/day is tiny APIGW + Lambda SFTP burst 100k in 4 hours 6.9 / s sustained not 1.2 / s Transfer Family same processor math Size for the window Media objects 10k x 200 MB / day 0.12 / s avg 2 TB / day ingest Low QPS, huge bytes Fargate + CloudFront Lambda is the wrong box
Four prompts reduced to per-second numbers
Little's law for processors: concurrency equals arrival times duration Processor math  Little's law on the whiteboard in-flight work = arrival rate (per second) x duration (seconds) Peak arrival 12 files / second Scan duration 8 seconds each Concurrency 12 x 8 = 96 workers If duration is 90s, 12 x 90 = 1,080. That is the number that kills a tiny Lambda story.
Concurrency = arrival x duration

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.”

The idea — five steps (every prompt)

  1. Count / day — files, API calls, or messages. Take it from the prompt, or assume and say so.
  2. Average per second = count ÷ 86,400.
  3. Peak per second = average × peak factor (5–10× for business hours; 1× for a flat batch; 20× for login storms if they hint at it).
  4. Bytes / day = count × object size. Always ask size. A count with no size is not enough.
  5. Concurrency = peak per second × duration in seconds. That is how many workers you need in flight.

Then pick Lambda vs Fargate vs a cluster.

Use case 1 — Document ingest (the main sprint story)

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/s

Step 3 — peak. They did not give a peak. Assume 10× business hours.

text

100k peak ≈ 12 files/s
1M peak   ≈ 120 files/s

Step 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/day

If 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-flight

What the numbers decide

SignalDecision
1.2–12 files/sNot Kinesis, not Kafka, not EKS “for scale”
200 GB–2 TB/day at 2 MBS3; watch lifecycle and versions, not EC2 size
8 s × 12/s ≈ 96 workersLambda is honest
90 s × 120/s ≈ 10,800Fargate (or a fleet). Lambda’s 15-minute timeout is fine; concurrency and /tmp are not
10 TB/dayScanner 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.”

Use case 2 — REST API (humans, small JSON)

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/s

Step 4. JSON 5 KB. Bytes are small next to documents.

text

800,000 × 5 KB ≈ 4 GB/day

Step 5. Handler 50 ms = 0.05 s.

text

Concurrency ≈ 186 × 0.05 ≈ 9

Decision: 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.

Use case 3 — SFTP burst (same 100k files, wrong window)

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 hours

There 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.”

Use case 4 — Large media (low rate, huge bytes)

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 ingest

Step 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 out

Point 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.”

Two extra numbers that come up

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.”

What to say

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

Napkin math pocket card

BayLearn · AWS Solutions Architect Interview Sprint

Seconds/day = 86,400 (24 × 60 × 60)

  1. Count / day
  2. Average / s = count ÷ 86,400
  3. Peak / s = average × peak factor (ask, or 5–10×; 20× login storms; 1× flat batch)
  4. Bytes / day = count × object size (always ask size)
  5. In-flight = peak / s × duration seconds
PromptAvgPeak (10× unless noted)Bytes (example)Default
100k files/day1.2/s12/s2 MB → 200 GB/daySQS + Lambda
1M files/day12/s120/s2 MB → 2 TB/daySame; watch scanner
100k in 4 h SFTP—7/s sustained2 MB → 200 GB in 4 hTransfer + same processor
20k DAU × 40 calls9.3/s~190/s at 20×JSON → ignore GBAPI GW + Lambda
10k × 200 MB video0.12/s1.2/s2 TB/dayFargate + 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

6Rs — when they already have a document system

If they already have file shares or a data-center scanner, pick a 6R per part. Then go back to R-SCALE.

Why this matters

If the prompt is a new platform, stay on the canvas. If something already exists, the 6Rs are the migration sentence — not the architecture.

6Rs for a document platform One R per subsystem. Not one R for the company. 1. Rehost File server to EC2 Buy time Not the end state 2. Replatform Bytes to S3 Keep the app Usual first step 3. Repurchase SaaS docs Build vs buy Name residency 4. Refactor This sprint design Ingest + scan 100k will not fit NAS 5. Retain Legal vault On-prem scanner Draw as a source 6. Retire Orphan shares No owner Do not migrate
6Rs for a document platform

The idea

The 6Rs are six ways to move (or not move) a system.

  1. Rehost — Lift the file server to EC2 + EBS, or put Transfer Family in front of the same layout. Fast. You keep the same ops and the same size of outage. Use it to buy time, not as the end state.
  2. Replatform — Keep the app. Move bytes to S3 and metadata to DynamoDB or RDS. Smallest change that gets you off NAS backups. This is the usual first production step.
  3. Repurchase — Buy a SaaS document system. Fine if they are testing “build vs buy.” Say integration and data-residency cost out loud.
  4. Refactor — The sprint design: HTTPS + SFTP ingest, landing/clean, EventBridge, SQS, scan, notify. You change the architecture because 100k/day and malware scan will not fit the file server.
  5. Retain — A regulated on-prem scanner or a records vault that legal will not move this year. Draw it as a source, not as the platform.
  6. Retire — Old share drives with no owner. Do not migrate them. Say so.

How you use this

  • Ask: “Is there a current system, or are we starting new?”
  • If current: pick one R per part (ingest, store, search, notify). Do not force one R on the whole company.
  • Then do napkin math and draw the target.

What to say

“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

Module 2 deep dive — Core AWS as selection problems

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.

LessonYou are done when you can…
ComputeDefend Lambda vs Fargate vs EKS vs EC2 with a *limit* that forces the next option
StorageDraw hostile landing vs clean; explain why EBS is not where documents live
DatabasesWrite three queries and a DynamoDB key (or say why Aurora)
MessagingDraw S3 → EventBridge → SQS → processor → SNS and a DLQ
NetworkingDraw two AZs, place endpoints, mark NAT optional, name each service’s plane
Scenario — 100k/daySpeak a full R-SCALE with napkin math in five minutes

Why this matters

The interviewer is not grading a product list. They want a default, plus the one fact that would change it.

Compute default by workload shape Pick from workload shape — not from fashion Lambda Burst, short, events 15 min / payload limits ECS Fargate Containers, long jobs No nodes to patch EKS Only if k8s is already an operated platform EC2 + ASG GPU, kernel, steady high utilization
Compute defaults
Global document platform Edge Route 53 � CloudFront + WAF � API Gateway � Transfer Family Ingest and store HTTPS presigned PUT or SFTP S3 landing (hostile, KMS, BPA) EventBridge � SQS + DLQ Processor Lambda / Fargate Promote and notify Scan then copy to S3 clean DynamoDB metadata (fileId, status) SNS / EventBridge FileReady CloudFront origin = clean only Cross-cutting IAM least privilege � CMK � CloudTrail / GuardDuty Multi-AZ HA � PITR + versioning for DR � alarms on DLQ and time-to-CLEAN Cost arrows: NAT, egress, logs, versions  not peak EC2
Document platform you will stitch together

How to choose

Name the access pattern or workload shape. Pick a default. Name the condition that would change the pick.

How to use the 50 minutes

  1. Compute (10) — how code runs, and the limits
  2. Storage (8) — object vs block vs file
  3. Databases (8) — keys before engines
  4. Messaging (8) — buffer vs stream vs workflow
  5. Networking (8) — edge, private data, skip NAT for S3
  6. Scenario (8) — stitch it

Then take the knowledge check. If one topic is weak, re-read that lesson, not this page.

Easy mistakes to skip

  • EKS as the first compute box
  • Documents on EBS
  • DynamoDB with no keys
  • Kinesis at 12 files/sec
  • NAT in front of S3
  • Twenty logos on the 100k prompt

The service selection matrix download is a pocket card. The lessons are the full notes.

You will

  • Name the failure you cannot accept
  • Point at the costliest arrow on your diagram

High availability8 min

High availability

High availability — deep dive

HA means users can still upload if one box or one Availability Zone (one data-center group) dies — inside one Region.

Why this matters

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.”

HA in Region vs DR across Regions HA  one Region AZ-a and AZ-b Regional S3, SQS, DynamoDB Survive instance / AZ loss DR  another Region or restore RTO / RPO numbers pick the pattern PITR, CRR, pilot light, active-active Not the same as Multi-AZ
HA is Multi-AZ in one Region; DR is another Region or a restore

The idea

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

ComponentHA storyWhat you still lose
S3, DynamoDB, SQS, SNS, API GatewayRegional. AWS spreads AZs for you.The Region, IAM, or a bad key policy
LambdaRegional. If it is in a VPC (your private network), put subnets in at least two AZs.Limits and anything the function calls
AuroraA sync standby in another AZ. Failover takes seconds.In-flight work; old DNS cache
NAT / ALBYou place them in at least two AZs.A bad security group
Your ECS serviceTasks 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

  1. The ingest API (regional) still accepts in the AZs that are up.
  2. Objects already in S3 are fine. S3 is regional.
  3. A Lambda that died mid-work is retried when the SQS visibility timeout ends (the message shows up again).
  4. A user who already got 201 still gets CLEAN after catch-up.
  5. A user who did not finish the presigned PUT (a timed upload URL) retries from the client.

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.

What to say

“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

Disaster recovery — deep dive

Let RTO and RPO — how fast you must be back, and how much data you can lose — pick the DR pattern.

Why this matters

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.

HA in Region vs DR across Regions HA  one Region AZ-a and AZ-b Regional S3, SQS, DynamoDB Survive instance / AZ loss DR  another Region or restore RTO / RPO numbers pick the pattern PITR, CRR, pilot light, active-active Not the same as Multi-AZ
Do not label Multi-AZ as DR

The idea

  • RPO (Recovery Point Objective): how much data you can lose, in time. Async copy means RPO is not zero.
  • RTO (Recovery Time Objective): how long until you serve again. Count DNS, restore, config, and people.

Pick the cheapest pattern that meets the numbers

PatternSecond siteTypical RTOCost
Backup / restoreBackups plus a runbookHoursLowest
Pilot lightData copied; compute off or tinyTens of minutes to hoursLow
Warm standbyA smaller live stackMinutes to tens of minutesMedium
Active / passiveFull stack; traffic on one sideMinutes if you practiceHigh
Active / activeTwo Regions servingNear-zero *if* you design for itHighest, and harder

Order: backup/restore → pilot light → warm standby → active/passive → active/active.

What to copy for this platform

DataApproachWatch out
S3 bytesVersioning. Add CRR (copy to another Region) if RPO needs it.Do not copy unscanned landing into a Region that serves downloads
DynamoDBPITR (point-in-time restore) always. Global Tables only if you have conflict rules.Status can lag. CLEAN is a real decision.
SQSDo not copy the queue. Replay from S3.The queue is not the source of truth
KMS keysPlan Multi-Region keys or replica keys.“Primary key gone” is its own incident
DNSRoute 53 failover with tested health checksFlipping, 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)

  1. DynamoDB PITR and S3 versioning
  2. A written restore into a new account or bucket
  3. Processors replay from S3
  4. No Global Tables. No two Regions writing the same row.
  5. If they tighten RPO: CRR on clean (and maybe landing). Name the lag. Keep one writer Region until they pay for active-active.

ARCHITECTURE DECISION: Active-active is a consistency and cost project. Status flips (CLEAN vs REJECTED) need conflict rules.

What to say

“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

DR matrix

PatternTypical RTOTypical RPORelative costUse when
Backup and restoreHoursHours$Downtime of hours is OK
Pilot lightTens of minutes to hoursMinutes$$Core data is copied. Compute is off or tiny.
Warm standbyMinutesMinutes$$$A smaller live stack is already running
Active / passiveMinutesSeconds to minutes$$$Failover follows a health check
Active / activeSecondsNear 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

Security — deep dive

Treat every upload as unsafe until it is scanned and moved to clean. Then prove who can read what.

Why this matters

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.”

Landing vs clean buckets Client S3 landing hostile � no download origin Scanner S3 clean CloudFront / presigned GET Upload is never served until scan promotes it Ingest role: PUT landing only Download role: GET clean only
Landing vs clean: ingest cannot read product downloads

The idea

**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

  1. A bad file served to other customers.
  2. A public bucket or listing.
  3. Stolen ingest credentials reading clean documents.
  4. A presigned URL (a timed upload or download link) leaked in logs, still valid.
  5. Confused deputy: S3 notifying a queue in another account.
  6. KMS: the pipeline cannot decrypt, or every role can decrypt everything.

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 only
  • Ingest role cannot s3:GetObject on clean.
  • Processor can write clean and update metadata.
  • Downloader role (CloudFront OAC — Origin Access Control, so CloudFront can read the bucket) can read clean only.

COMMON MISTAKE: A public S3 ACL “for testing.” That is how many interview case studies start.

Encryption and keys

  • SSE-KMS CMK for customer documents. That is a customer-managed key you control. Bucket policy Deny PUTs that are not encrypted (s3:x-amz-server-side-encryption).
  • S3 Bucket Keys cut KMS request volume at 1M objects/day.
  • Key policy: least privilege. CloudTrail on Decrypt. Rotate keys.
  • SSE-S3 uses AWS-owned keys. Weaker audit. Say why you still pick a CMK for customer data.
  • Secrets go in Secrets Manager or SSM, not long-lived keys in Lambda env.

IAM in plain words

Talk actions + resources + conditions:

  • Processor: 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 *.
  • Conditions: aws:SourceAccount / aws:SourceArn on bucket notifications (stops confused deputy).
  • No shared “app role” for ingest, process, and humans.

Edge

  • WAF (a web firewall) on CloudFront for downloads and/or API Gateway for ingest. Body size limits. Rate limits on presign.
  • Shield Standard is on. Shield Advanced is a business choice for a DDoS retainer.
  • GuardDuty, CloudTrail (management events; data events cost money — sample or scope them), Security Hub if the account already uses it.

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.

What to say

“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

Security checklist

  • [ ] Data buckets are not public
  • [ ] Block Public Access is on
  • [ ] Use a KMS customer-managed key. Set the key policy and IAM.
  • [ ] Compute uses roles. No long-lived access keys.
  • [ ] Secrets live in Secrets Manager or SSM
  • [ ] WAF sits at the edge
  • [ ] CloudTrail is on for the org or account. Logs cannot be quietly changed.
  • [ ] Landing prefix and clean prefix are separate
  • [ ] If many tenants, isolate them
  • [ ] Do not put PII in logs
  • [ ] Presigned URLs expire soon
  • [ ] People connect with SSM or IAM Identity Center

Multi-account follow-up

Multi-account follow-up

Multi-account — the follow-up after your app diagram

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.

Why this matters

After Lambda and a CMK, they often ask who owns the account. Keep this to one minute.

Organization, OUs, and where the lab lives App diagram is one account. Trust diagram is the org. Management account  billing, Organizations, IAM Identity Center. Humans start here. 1. Security OU Log Archive Audit CloudTrail lands here 2. Shared OU Network / DNS Shared services Not the document app 3. Workloads OU Prod / nonprod Ingest + S3 + CMK SCPs still apply 4. Sandbox OU This weekend lab Destroy the same day Not prod ingest SCPs deny. IAM Identity Center grants. The lab CMK stays in the workload or sandbox account.
Org, OUs, and where the lab lives

The idea

  1. Use an Organization, not one account. An Organization is a bill-and-guardrail tree of accounts. A production document platform is not built in a shared sandbox. The management account holds billing, the org, and SSO. Work runs in member accounts.
  1. OUs by how much can break. An OU is a folder of accounts. Typical: Security (Log Archive, Audit), Shared (network, DNS), Workloads (prod / nonprod), Sandbox. The lab you deploy this weekend is a sandbox-style workload, not the org.
  1. IAM Identity Center is how humans log in. Long-lived IAM users in prod is the wrong default. People assume a role per account, per job (admin vs read vs deploy).
  1. SCPs (Service Control Policies) are guardrails, not IAM. Examples: “no disable CloudTrail,” “no leave us-west-2,” “no create IAM users.” An SCP can deny even the account root of a member. It does not grant access.
  1. The lab CMK stays in the workload account. Shared org keys show up when they ask about shared encryption. Do not invent a KMS hub unless they ask.
  1. Logs leave the workload. CloudTrail and VPC Flow Logs go to a Log Archive account. Processor logs can stay in the workload account for this design. Say you would ship them if they ask about forensics.

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.

What to say

“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

Observability — deep dive

Watch the user journeys. Do not watch forty default AWS graphs.

Why this matters

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.

User journeys to instrument Alarm DLQ and SLO burn � not every invocation 1. Upload accepted API 2xx + S3 PUT complete 2. Time to CLEAN SLO: PUT to metadata status 3. Notify after CLEAN SNS only when status is ready
Three journeys: upload, time-to-CLEAN, notify

The idea

Define three journeys before metrics:

  1. Client gets 2xx, or gets a presign and finishes the S3 PUT
  2. File becomes CLEAN or REJECTED in the promised time
  3. Downstream gets notify after metadata says ready

Signals that match this platform

SignalWhyWhere
Ingest 4xx / 5xx and latencyClient painAPI Gateway / CloudFront
Presign success vs S3 PUT completeAbandoned uploadsLambda + S3 metrics
Queue depth and ageProcessor falling behindSQS
Processor errors + DLQ countWork dying quietly. A DLQ is a dead-letter queue — messages that failed too many times.Lambda + SQS
End-to-end: PUT → metadata CLEANThe real SLOCustom metric / EMF (metrics written from logs)
KMS / IAM AccessDeniedBad config or attackCloudTrail / metrics
Scan duration and reject rateCapacity and abuseProcessor

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

  • DLQ > 0 or oldest message age > SLO
  • Ingest 5xx burn rate (not one blip)
  • End-to-end SLO burn (error budget)
  • Spike of KMS or IAM denials
  • GuardDuty high-severity (often a different on-call)

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

  1. fileId or customer + time window
  2. Ingest logs: was presign issued? Did S3 PUT finish?
  3. DynamoDB: item? status?
  4. S3: landing key and clean key
  5. SQS DLQ and processor logs for that fileId
  6. SNS delivery if CLEAN but downstream says no

If the dashboard is green and the DLQ is full, the dashboard is missing the DLQ.

What to say

“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

Cost awareness — deep dive

You do not need list prices. You need to know which line items explode and what you would cut first.

Why this matters

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.

Expensive cost arrows Point at these arrows before the interviewer does NAT S3/DDB via NAT Egress downloads / CF Logs payloads + retention Versions S3 noncurrent forever Compute often the cheapest
NAT, egress, logs, and versions usually beat compute

The idea

Five cost buckets — write them on the canvas

  1. Ingest: API Gateway requests, S3 PUT, Transfer Family hours if you use SFTP
  2. Process: Lambda GB-seconds or Fargate vCPU-hours × time × how many run at once
  3. Store: GB-month, requests, versions, replication
  4. Move: NAT, egress (data leaving AWS), cross-AZ, CloudFront
  5. Observe: logs, traces, data events

If you cannot rank those five for *this* diagram, you are not done.

Expensive arrows

ArrowWhy it growsWhat you do
NAT for S3/DynamoDBYou 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 bytesChatty traffic between AZsRegional queues. Know when Multi-AZ NAT is needed.
Egress / CloudFrontDownloads are much bigger than uploadsCache clean objects. Do not serve landing.
CloudWatch LogsIngest × retention × how chatty you areNo payloads. Short retention.
Always-on EC2 for a burstIdle most of the weekQueue + Lambda or Fargate
S3 Standard forever10 TB/day becomes a museumLifecycle. Intelligent-Tiering, with eyes open.
KMS per object without Bucket KeysHuge request volumeTurn on Bucket Keys
Global TablesWrite units × RegionsDo not buy this just to claim a better RPO
S3 LIST as a jobYou pay per 1,000 keysEvent + keys in DynamoDB

Skip in the first month

  • Savings Plans or Reserved Instances on day one (you do not know the shape yet)
  • Spot on the customer-facing API (Spot can be taken away)
  • Glacier on objects support must restore in 60 seconds
  • Reciting the price page without pointing at *your* arrows

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.

What to say

“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

Module 3 deep dive — Production architecture

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.

Why this matters

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.

The idea

Read the five lessons in order. Then take the knowledge check.

LessonYou are done when you can…
High availabilitySay what happens if one Availability Zone (one data-center group) goes down
Disaster recoveryPick 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.
SecurityWalk landing vs clean, and name three IAM roles (who is allowed to do what)
ObservabilityState one SLO (a promise you can measure), three metrics, and two alarms that should page a person
CostRank three expensive arrows on *your* diagram

Keep them separate

  • HA: stay up if an instance or AZ dies *in this Region* (one AWS area)
  • DR: get back if the whole Region dies, or restore from a backup. The numbers pick the plan.
  • Security: treat uploads as unsafe, give each job little access, protect the public edge
  • Observability: prove the user journeys; alarm what hurts users
  • Cost: point at the expensive arrows before the interviewer does

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.

HA in Region vs DR across Regions HA  one Region AZ-a and AZ-b Regional S3, SQS, DynamoDB Survive instance / AZ loss DR  another Region or restore RTO / RPO numbers pick the pattern PITR, CRR, pilot light, active-active Not the same as Multi-AZ
HA is in-Region; DR is another Region or a restore
Landing vs clean buckets Client S3 landing hostile � no download origin Scanner S3 clean CloudFront / presigned GET Upload is never served until scan promotes it Ingest role: PUT landing only Download role: GET clean only
Landing vs clean is the security diagram
Expensive cost arrows Point at these arrows before the interviewer does NAT S3/DDB via NAT Egress downloads / CF Logs payloads + retention Versions S3 noncurrent forever Compute often the cheapest
Cost arrows to rank on your canvas

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.

What to say

INTERVIEW TIP: “HA is an AZ dying this afternoon. DR is the Region gone. I will not mix the two.”

You will

  • Spend 45 minutes drawing, then 15 minutes explaining
  • Leave with a diagram, data flow, security, cost, and trade-offs

Document platform design45 min

Document platform design

Module 4 deep dive — Architecture challenge

You design the document platform in 45 minutes. Then you explain it for 15 minutes.

Why this matters

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.

The idea

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

  1. Assumptions written down (object size, peak factor, scan SLA, number of notify consumers)
  2. R-SCALE spoken or bulleted
  3. Diagram with ingest, landing, scan, clean, metadata, notify, edge
  4. Data flow for one happy file and one reject
  5. Scale math (files/sec, and TB/day if you know size)
  6. Security landing vs clean, CMK, three roles, WAF
  7. Failure AZ loss, scanner down, poison message / DLQ
  8. Observability one SLO + two alarms
  9. DR pattern named from RTO/RPO
  10. Cost three arrows ranked
  11. 10× what breaks first
  12. Trade-offs (Lambda vs Fargate, DynamoDB vs Aurora, one Region vs two)

Use the architecture canvas lesson as the template. Use the review checklist on yourself before you stop.

Global document platform Edge Route 53 � CloudFront + WAF � API Gateway � Transfer Family Ingest and store HTTPS presigned PUT or SFTP S3 landing (hostile, KMS, BPA) EventBridge � SQS + DLQ Processor Lambda / Fargate Promote and notify Scan then copy to S3 clean DynamoDB metadata (fileId, status) SNS / EventBridge FileReady CloudFront origin = clean only Cross-cutting IAM least privilege � CMK � CloudTrail / GuardDuty Multi-AZ HA � PITR + versioning for DR � alarms on DLQ and time-to-CLEAN Cost arrows: NAT, egress, logs, versions  not peak EC2
Draw this, then explain it

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 + SNS

A solid first pass (you must still *explain* it)

PlaneDefault
DNS / edgeRoute 53, CloudFront + WAF on clean downloads
HTTPS ingestAPI Gateway + Lambda presigned S3 PUT
SFTPTransfer Family → landing
BytesS3 landing (unsafe) → scan → S3 clean
EventsEventBridge → SQS + DLQ
ProcessLambda; Fargate if scan is long
MetadataDynamoDB (keys from access patterns)
NotifySNS or EventBridge
SecurityCMK, BPA (Block Public Access), least privilege
ObserveIngest, queue age, DLQ, time-to-CLEAN
DRPITR + 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

MinutesDo this
0–5R: questions + assumptions
5–10S: napkin math + size
10–25C: diagram + data flow
25–35A, security, failure, DLQ
35–40Watch the system, cost arrows
40–45L/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.

What to say

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

Architecture review checklist

  • [ ] Restate the requirements in your own words
  • [ ] Scale sketch with units
  • [ ] Label every assumption
  • [ ] Draw trust boundaries and AZ / Region lines
  • [ ] Name the system of record vs the object store
  • [ ] Say what is sync and what is async
  • [ ] Sketch IAM with least privilege
  • [ ] Encryption in transit and at rest. Who owns the key?
  • [ ] Retry, dead-letter queue, and safe-to-retry handlers
  • [ ] Watch it: metric, log, trace, alarm
  • [ ] RTO, RPO, and the DR pattern
  • [ ] Cost: NAT, egress, idle time, logs
  • [ ] What breaks at 10×
  • [ ] One trade-off you can explain

6Rs — if they already have a system

6Rs — if they already have a system

6Rs — when they already have a document system

If they already have file shares or a data-center scanner, pick a 6R per part. Then go back to R-SCALE.

Why this matters

If the prompt is a new platform, stay on the canvas. If something already exists, the 6Rs are the migration sentence — not the architecture.

6Rs for a document platform One R per subsystem. Not one R for the company. 1. Rehost File server to EC2 Buy time Not the end state 2. Replatform Bytes to S3 Keep the app Usual first step 3. Repurchase SaaS docs Build vs buy Name residency 4. Refactor This sprint design Ingest + scan 100k will not fit NAS 5. Retain Legal vault On-prem scanner Draw as a source 6. Retire Orphan shares No owner Do not migrate
6Rs for a document platform

The idea

The 6Rs are six ways to move (or not move) a system.

  1. Rehost — Lift the file server to EC2 + EBS, or put Transfer Family in front of the same layout. Fast. You keep the same ops and the same size of outage. Use it to buy time, not as the end state.
  2. Replatform — Keep the app. Move bytes to S3 and metadata to DynamoDB or RDS. Smallest change that gets you off NAS backups. This is the usual first production step.
  3. Repurchase — Buy a SaaS document system. Fine if they are testing “build vs buy.” Say integration and data-residency cost out loud.
  4. Refactor — The sprint design: HTTPS + SFTP ingest, landing/clean, EventBridge, SQS, scan, notify. You change the architecture because 100k/day and malware scan will not fit the file server.
  5. Retain — A regulated on-prem scanner or a records vault that legal will not move this year. Draw it as a source, not as the platform.
  6. Retire — Old share drives with no owner. Do not migrate them. Say so.

How you use this

  • Ask: “Is there a current system, or are we starting new?”
  • If current: pick one R per part (ingest, store, search, notify). Do not force one R on the whole company.
  • Then do napkin math and draw the target.

What to say

“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

Architecture Canvas — Global Document Processing Platform

This page is the one-page worksheet you fill, then explain.

Why this matters

The challenge is 45 minutes. A blank board wastes time. Fill this table, then talk to it.

Global document platform Edge Route 53 � CloudFront + WAF � API Gateway � Transfer Family Ingest and store HTTPS presigned PUT or SFTP S3 landing (hostile, KMS, BPA) EventBridge � SQS + DLQ Processor Lambda / Fargate Promote and notify Scan then copy to S3 clean DynamoDB metadata (fileId, status) SNS / EventBridge FileReady CloudFront origin = clean only Cross-cutting IAM least privilege � CMK � CloudTrail / GuardDuty Multi-AZ HA � PITR + versioning for DR � alarms on DLQ and time-to-CLEAN Cost arrows: NAT, egress, logs, versions  not peak EC2
Reference architecture to explain on the canvas

The idea

SectionYour notes
Business goalIngest, scan, check, store, and send documents at 100k–1M files/day
Functional requirementsSFTP + HTTPS, scan, metadata, async work, notify, audit
Non-functionalEncryption, retries, dashboards, alerting, DR
Scale100k/day now (~1.2/s average); 1M/day later (~12/s average, plan 10× peak)
ComputeThin ingest (API Gateway + Lambda, or Transfer Family). Processors on Lambda or Fargate
StorageS3 landing / clean / quarantine. Versioning + KMS
DatabaseDynamoDB for job + metadata (Aurora only if you need SQL on the hot path)
MessagingEventBridge → SQS; SNS for downstream; Step Functions if the workflow is long
SecurityWAF, IAM least privilege, KMS, scan before promote, CloudTrail
NetworkingPrivate processors, gateway endpoints for S3/DynamoDB, CloudFront at the edge
ObservabilityQueue depth, DLQ (dead-letter queue), scan fail %, p99 process time (slowest 1%), 5xx
AvailabilityMulti-AZ ingest and data (HA in one Region)
DRAsk RTO/RPO. Start with PITR + versioning. Add S3 CRR, a metadata replica, and Route 53 failover if the numbers need them.
CostEndpoints vs NAT; storage class; log volume; avoid always-on EKS
Trade-offsLambda time vs Fargate; DynamoDB vs Aurora; active-passive vs active-active
FuturePrefix sharding, reserved concurrency, second-region ingest

What to say

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

  • Answer out loud, then check the suggested answer
  • Practice your two weak skills plus a few architecture questions

How to practice the bank5 min

How to practice the bank

Module 5 — Practice the 100-question 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.

Question bank practice loop 100 questions — master what you can teach Read out loud Answer with R-SCALE Compare expectation Mark mastered
Practice loop for the question bank

Distribution

Architecture 15 · Compute 10 · Networking 15 · Storage 10 · Database 15 · Security 15 · Reliability 10 · Cost 10

How to practice

  1. Read the prompt out loud.
  2. Structure with R-SCALE if it is a design question.
  3. Reveal Answer only after you have a first pass.
  4. Read Interviewer's Expectation — that is the real bar.
  5. Note Common Mistakes.
  6. Answer one Follow-Up.
  7. Mark as Mastered only if you could teach it.

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

Final interview prep checklist

Night before

  • [ ] R-SCALE on one page
  • [ ] Three stories: a design, a failure, a cost save
  • [ ] The company's likely constraints (regulated? global? startup?)
  • [ ] Your two weakest skills — five questions each
  • [ ] Lab path memorized: ingest → S3 → event → queue → process
  • [ ] Questions for them: team, on-call, how they review architecture

In the room

  • [ ] Restate the problem
  • [ ] Write assumptions
  • [ ] Draw users first
  • [ ] Pause for constraints
  • [ ] Name a trade-off before they ask

You will

  • Run a timed mock from the sprint question bank
  • Receive strengths, gaps, and a next-step plan

Mock interview brief5 min

Mock interview brief

Module 6 — Timed mock interview

Forty-five to sixty minutes if you booked a live mock.

Mock interview blocks Same-day rubric 1-5, score 0-100 Intro 5m role / loop Fundamentals 10m selection not trivia Architecture 25m document platform Challenge 10m sec / DR / cost Feedback 10m scorecard
Timed mock interview flow

Suggested flow

BlockMinutesWhat happens
Introduction5Your role and what you are targeting
AWS basics10Pick a service and say why
Architecture problem25The document platform, or a close variant
Challenge questions10Security, disaster recovery, cost
Feedback10Same-day scorecard

How you are scored (1–5 each)

Requirements · AWS knowledge · Architecture · Scale · Security · Reliability · Cost · Trade-offs · Communication · Leadership

Those ten scores become a 0–100 total.

What you get after

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

Mock interview scorecard

Student: ____________ Date: ____________ Instructor: ____________

Score each item from 1 to 5.

DimensionScoreNotes
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)

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.

Four-hour weekend clock Four hours. This order. Do not start the bank first. 1. 0:00 Assessment 20 min two weak scores 2. 0:20 R-SCALE 25 min one answer aloud 3. 0:45 Core AWS 60 min pick + reject 4. 1:45 Production 40 min HA DR security 5. 2:25 Canvas + hops 45 min 12-hop walk 6. 3:10 Lab / drill 40 min PROCESSED 7. 3:50 Bank filter 10 min weak dims only Mock is a separate booked hour. Do not spend the bank before the canvas.
Live session clock

Minute-by-minute

ClockBlockYou doThey do
0:00–0:10OpenState 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:25AssessmentStay quiet. Do not teach during the quiz.15 questions
0:25–0:40Debrief scoresName the two weakest skills for the room.Write them down
0:40–1:00R-SCALEWork one prompt out loud.Repeat the same prompt in breakouts
1:00–1:50Core AWSAsk people to pick compute, storage, data, messaging, and network.Each person defends one pick for the document platform
1:50–2:25ProductionCover stay-up vs recover, one threat path, and one cost choice.Security + multi-account one-pager
2:25–3:05Canvas45 minutes to design. 10 minutes to defend.Fill the canvas, then talk
3:05–3:40Lab or drillIf they have accounts: apply and curl. If not: failure drill on the board.Show PROCESSED, or name the three stalls
3:40–4:00CloseAssign 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.

How to score — what a 3 vs a 5 sounds like

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.

Dimension3 (good enough)5 (senior)
Requirement clarificationAsks one question, then designsAsks two, states assumptions, writes them on the board
AWS knowledgeNames the right serviceNames the service and the limit that would change the pick
ArchitectureOne happy pathLanding vs clean, async boundary, what is not on the request
ScalabilitySays “auto scaling”Does the math: count / 86400 × peak × size × duration
SecuritySays “KMS and IAM”Walks a threat path, two roles, key policy, and EventBridge on encrypted SQS
ReliabilitySays “Multi-AZ”Names a failure they cannot allow, a DLQ, and what a 202 does not mean
CostSays “S3 is cheap”Talks endpoints vs NAT, log volume, reserved concurrency
Trade-offsLists two optionsPicks one and names the cost of being wrong
CommunicationCorrect, hard to followTime-boxed, easy to interrupt, draws while talking
LeadershipWaits for the promptFrames the decision for a VP in one sentence

Feedback rules

  • Send the scorecard the same day. Do not say you will send notes next week.
  • Keep instructor-only notes off the student report.
  • Next step is one sentence: which two bank skills to practice, and whether they should redeploy the lab or only walk the 12 hops.

Do not

  • Add a new module mid-session.
  • Let the question bank eat the canvas time.
  • Leave a student AWS stack running overnight.

Mock interview50 min

Mock interview

Module 6 — Timed mock interview

Forty-five to sixty minutes if you booked a live mock.

Mock interview blocks Same-day rubric 1-5, score 0-100 Intro 5m role / loop Fundamentals 10m selection not trivia Architecture 25m document platform Challenge 10m sec / DR / cost Feedback 10m scorecard
Timed mock interview flow

Suggested flow

BlockMinutesWhat happens
Introduction5Your role and what you are targeting
AWS basics10Pick a service and say why
Architecture problem25The document platform, or a close variant
Challenge questions10Security, disaster recovery, cost
Feedback10Same-day scorecard

How you are scored (1–5 each)

Requirements · AWS knowledge · Architecture · Scale · Security · Reliability · Cost · Trade-offs · Communication · Leadership

Those ten scores become a 0–100 total.

What you get after

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.zip

You will

  • Deploy with Terraform or CloudFormation in your account
  • Clean up the same day (typical cost under $2)

Lab overview10 min

Lab overview

Lab — Build a small document pipeline

text

Client → API Gateway → Lambda (ingest) → S3
       → EventBridge → SQS → Lambda (processor) → DynamoDB → SNS

This 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.

Serverless document pipeline Client API Gateway Ingest Lambda S3 EventBridge SQS Processor DynamoDB SNS DLQ
What you will deploy

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.

Happy path  12 numbered hops Happy path  read the numbers in order. Sync returns 202. Async finishes the job. SYNCHRONOUS  the client is still on the socket 1 Client curl POST /ingest 2 API Gateway HTTP API, AWS_PROXY 3 Ingest Lambda decode + jobId 4 DynamoDB PutItem RECEIVED 5 S3 landing PutObject + KMS 6 HTTP 202 jobId + s3Key After step 6 the client hangs up. Processing is not on this request. ASYNCHRONOUS  the file is already in S3 7 S3 event Object Created 8 EventBridge rule match 9 SQS buffer + retry 10 Processor GetObject 11 DynamoDB status PROCESSED 12 SNS notify DLQ after 3 fails
Happy path — 12 numbered hops

1. Download the entire lab

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 functions
  • terraform/main.tf, variables.tf, terraform.tfvars.example — full stack
  • cloudformation/template.yaml — the same stack if you cannot run Terraform
  • scripts/demo.sh — posts a sample file and waits for PROCESSED
  • sample-files/sample.txt, architecture, troubleshooting, cleanup

Typical cost is under $2 if you destroy the same day.

2. Unzip and deploy (Terraform)

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 apply

name_prefix must be unique, lowercase, and 2–21 characters (letters, numbers, hyphens).

Note the outputs: ingest_url, bucket, table, queue, dlq, topic.

3. Demo

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.sh

Wait about 10 seconds, then confirm:

  1. S3 landing/{jobId}/sample.txt exists
  2. DynamoDB item status is PROCESSED
  3. SQS DLQ (dead-letter queue for failed messages) depth is 0
  4. CloudWatch has log streams for both functions

4. CloudFormation (if you cannot use Terraform)

bash

aws cloudformation deploy \
  --stack-name yourinitials-sa-lab \
  --template-file cloudformation/template.yaml \
  --parameter-overrides NamePrefix=yourinitials-sa-lab \
  --capabilities CAPABILITY_NAMED_IAM

Use the IngestUrl output with the same curl. Delete the stack when you are done.

5. Cleanup (do this the same day)

bash

cd terraform
terraform destroy

If the bucket is not empty:

bash

aws s3 rm "s3://$(terraform output -raw bucket)" --recursive
terraform destroy

This pack’s Terraform sets force_destroy = true on the bucket, so destroy works after a demo even with versioned objects.

What the code does

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.

Prerequisites

  • AWS account that can create IAM, S3, Lambda, API Gateway, SQS, SNS, DynamoDB, EventBridge, KMS
  • Terraform ≥ 1.5 or AWS CLI + CloudFormation
  • 45–60 minutes

Lab architecture15 min

Lab architecture

How each hop works

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.

Happy path  12 numbered hops Happy path  read the numbers in order. Sync returns 202. Async finishes the job. SYNCHRONOUS  the client is still on the socket 1 Client curl POST /ingest 2 API Gateway HTTP API, AWS_PROXY 3 Ingest Lambda decode + jobId 4 DynamoDB PutItem RECEIVED 5 S3 landing PutObject + KMS 6 HTTP 202 jobId + s3Key After step 6 the client hangs up. Processing is not on this request. ASYNCHRONOUS  the file is already in S3 7 S3 event Object Created 8 EventBridge rule match 9 SQS buffer + retry 10 Processor GetObject 11 DynamoDB status PROCESSED 12 SNS notify DLQ after 3 fails
Happy path — 12 numbered hops

The 12 hops (match the diagram)

  1. Client sends POST /ingest with fileName and contentBase64 (the file as Base64 text).
  2. API Gateway (the HTTPS front door) matches POST /ingest. It uses AWS_PROXY payload 2.0 (Lambda gets the raw HTTP event). Then it calls ingest.
  3. Ingest Lambda (a short-lived function) decodes the body. It mints a jobId (a new unique id).
  4. DynamoDB PutItem writes status=RECEIVED before any S3 write. DynamoDB is the job table.
  5. S3 PutObject writes landing/{jobId}/{fileName} with SSE-KMS (S3 encrypts with your KMS key).
  6. HTTP 202 returns { jobId, s3Key }. 202 means accepted, not finished. The client is done.
  7. S3 emits Object Created onto EventBridge (the AWS event bus). The bucket talks to EventBridge. It does not call Lambda itself.
  8. EventBridge matches this bucket only. It sends the event to the process queue.
  9. SQS (a queue) holds the event. Visibility is 60s (the hide time while a worker has it). After 3 failed receives, SQS sends it to the DLQ (dead-letter queue for failed messages).
  10. Processor Lambda is invoked by the event-source mapping (Lambda long-polls SQS for you).
  11. DynamoDB UpdateItem sets PROCESSED, byteSize, and processedAt.
  12. SNS (a notify topic) publishes 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.”

---

Flow A — Ingest (sync path)

Ingest Lambda internals  steps 1 to 8 Flow A  Ingest internals. DynamoDB is written before S3 on purpose. 1. Client POST HTTPS to the HTTP API. Body is JSON: fileName + contentBase64. No IAM user on the wire. 2. API Gateway HTTP API Route POST /ingest. Integration AWS_PROXY 2.0. Stage $default auto-deploys. Permission: apigateway.amazonaws.com may invoke ingest. This lab has no JWT authorizer  say that out loud. 3. Lambda cold/warm start Runtime python3.12. Handler ingest.handler. Role assumed: sts:AssumeRole lambda.amazonaws.com 4. Decode the event If isBase64Encoded, decode the body first. json.loads. Base64-decode the file bytes. uuid4() becomes jobId. Key = landing/{jobId}/{fileName} 5. DynamoDB PutItem FIRST Item: jobId, s3Key, fileName, status=RECEIVED, createdAt UTC. Partition key is jobId only. Why first: S3 Object Created can fire before a later PutItem. Processor would miss the row. Tradeoff a senior names If S3 put fails after this, you have an orphan RECEIVED row. Prefer that over a race. Pay-per-request. Table SSE uses the lab CMK. 6. S3 PutObject + KMS SSE-KMS with the lab CMK. Bucket key on. Ingest role: s3:PutObject on landing/* and kms:GenerateDataKey + Decrypt. 7. Return 202 Body: jobId and s3Key. Not 200. Not 201. 202 = accepted for async work. 8. Client disconnects Processor has not run yet. That is correct.
Ingest internals, steps 1 to 8
  1. The client hits HTTPS. There is no IAM user on that curl. The next identity is API Gateway calling Lambda.
  2. The HTTP API route is 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).
  3. This lab has no JWT authorizer (no login check on the API). Say that first in interview. Production would add Cognito or IAM before you talk about KMS.
  4. Lambda assumes the ingest role (lambda.amazonaws.com). Runtime is Python 3.12. Handler is ingest.handler.
  5. If isBase64Encoded is true, decode the body, then json.loads. Decode contentBase64 into bytes. uuid4() is the job id. Object key is landing/{jobId}/{fileName}.
  6. PutItem first. Partition key is jobId. Status is RECEIVED. If you write S3 first, EventBridge can wake the processor before the row exists. That is a real race.
  7. PutObject second. ServerSideEncryption=aws:kms and the lab CMK (customer-managed KMS key). Ingest may s3:PutObject on landing/* only — not the whole bucket, not GetObject.
  8. Return 202, not 200. The body is just 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.”

---

Flow B — S3 to EventBridge to SQS (handoff)

S3 to EventBridge to SQS internals  steps 1 to 8 Flow B  Handoff. S3 does not call Lambda. EventBridge + SQS sit in the middle. 1. Bucket notification eventbridge = true on the bucket. Not S3-to-Lambda. Not S3-to-SQS. 2. Object Created S3 emits source=aws.s3 detail-type=Object Created detail.bucket.name + object.key Key may be URL-encoded. 3. EventBridge rule Pattern matches this bucket only. Other buckets in the account are ignored. 4. Target = process queue No Lambda target. Queue is the buffer. Queue policy: events.amazonaws.com sqs:SendMessage if SourceArn equals this rule ARN. 5. KMS on the queue SQS SSE uses the lab CMK. EventBridge must call kms:GenerateDataKey* + Decrypt. 6. If the key policy omits events.amazonaws.com, the object lands in S3 and the job stays RECEIVED. Silent stall. 7. SQS holds the event Visibility timeout 60s. Processor timeout 30s. Visibility must stay longer than runtime or two processors take the same message. Redrive: maxReceiveCount = 3 After 3 receives, SQS moves the message to the DLQ. The main queue stays healthy. Batch size on the mapping is 1. 8. Event source mapping Lambda service long-polls SQS. It is not a self-managed poller in our code. Processor role needs sqs:ReceiveMessage, DeleteMessage, GetQueueAttributes, and kms:Decrypt to read the body. On success the mapping deletes the message. On exception the message becomes visible again.
Async handoff, steps 1 to 8
  1. The bucket has eventbridge = true. We did not wire S3 directly to Lambda or S3 directly to SQS.
  2. S3 emits source=aws.s3, detail-type=Object Created, with bucket.name and object.key. The key is often URL-encoded.
  3. The EventBridge rule matches this bucket only. Other buckets in the account do not wake this processor.
  4. The target is the process queue. EventBridge may sqs:SendMessage because of a queue policy (aws:SourceArn = this rule). That is not an IAM role.
  5. The queue is encrypted with the same CMK. EventBridge must be in the key policy (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.
  6. Visibility timeout is 60s. Processor timeout is 30s. Visibility must stay longer than runtime, or two workers take one message.
  7. maxReceiveCount = 3. After three failed receives, SQS redrives to the DLQ. The main queue does not keep poison messages forever.
  8. The event-source mapping is the poller. Your Python does not call 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.”

---

Flow C — Processor (async path)

Processor Lambda internals  steps 1 to 8 Flow C  Processor. One SQS record in, metadata + notify out. 1. Event shape event.Records[].body is a STRING. json.loads once. Inside is the EventBridge envelope. Use detail, not the outer wrapper. 2. Unquote the S3 key unquote_plus(object.key). Spaces and slashes come encoded. Skip this and GetObject 404s. 3. GetObject Role: s3:GetObject on landing/* S3 decrypts with the CMK. Role needs kms:Decrypt. We only read ContentLength. 4. jobId from the key landing / {jobId} / fileName Same id ingest stored. No extra lookup. That is why the prefix is structured. 5. UpdateItem PROCESSED SET status, byteSize, processedAt, s3Key. #s because status is reserved in DDB. 6. Interview honesty This UpdateItem is not conditional. At-least-once SQS can run twice and publish SNS twice. Production adds attribute_not_exists(processedAt). 7. SNS Publish Subject document-processed. JSON: jobId, s3Key, byteSize. Topic is KMS-encrypted. Role needs sns:Publish + kms:GenerateDataKey. 8. Mapping deletes the message Handler returns. Lambda service calls DeleteMessage. Job is done. Reserved concurrency = 5 in this lab.
Processor internals, steps 1 to 8
  1. event.Records[].body is a string. Parse it. The EventBridge event is inside. Read detail, not the SQS wrapper.
  2. unquote_plus the object key (decode the S3 key). Skip this and GetObject 404s on any key with a space or encoded slash.
  3. 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.
  4. jobId is the second segment of landing/{jobId}/{fileName}. Same id ingest wrote. No extra index.
  5. UpdateItem sets status=PROCESSED, byteSize, processedAt, and s3Key. #s is required because status is reserved in DynamoDB expressions.
  6. This update is not conditional. SQS is at-least-once (a message can arrive more than once). A retry can publish SNS twice. Production: attribute_not_exists(processedAt) or a condition on status.
  7. sns.publish with jobId, s3Key, byteSize. The topic is KMS-encrypted, so the role needs sns:Publish and kms:GenerateDataKey.
  8. The handler returns. The mapping deletes the SQS message. Reserved concurrency is 5 so a bug cannot scale to thousands of concurrent invokes in a student account.

Say this out loud: “Processor is idempotent in production. This lab shows the path. I would add a condition before I called it done.”

---

Flow D — Failure, retry, DLQ

Failure path  retry, visibility, DLQ Flow D  Failure. The client already got 202. Recovery is on the queue, not the HTTP call. 1. Handler throws Bad key, KMS deny, missing job row, SNS deny Do not swallow errors. 2. No DeleteMessage Mapping sees failure. Message stays in flight until visibility expires. Timeout 60s in this lab. 3. Visible again ReceiveCount += 1 Another invoke. Same payload. This is at-least-once. 4. ReceiveCount = 3 Redrive policy fires. Message leaves the process queue. Lands on the DLQ. 5. What you do with a DLQ Read CloudWatch /aws/lambda/{prefix}-processor. Fix the code or the IAM/KMS miss. Replay: SQS StartMessageMoveTask, or a one-off send from DLQ back to the process queue. Do not delete the DLQ message until you know why. 6. What you do not do Do not retry by asking the client to POST again 7. Reserved concurrency = 0 Looks like a silent outage. Queue depth grows. This lab sets reserved concurrency to 5. 8. Client already got 202 Ingest success is not process success. The interview answer: poll DynamoDB status, or subscribe to SNS, or expose a GET /jobs/id. This lab uses DynamoDB as the source of truth.
Failure path, steps 1 to 8
  1. The processor throws (bad key, KMS deny, missing row, SNS deny). Do not catch-and-return-success. That deletes the message and you lose the job.
  2. The mapping does not delete the message. It stays in-flight until visibility expires (60s).
  3. The message becomes visible. ReceiveCount increments. The same payload is delivered again. That is at-least-once.
  4. At ReceiveCount = 3, the redrive policy moves the message to the DLQ. The process queue stays healthy.
  5. You read /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.
  6. You do not ask the client to POST again as the recovery plan. They already have a jobId.
  7. Reserved concurrency 0 looks like a silent outage. Queue depth grows. This lab uses 5.
  8. The client already received 202. Source of truth is DynamoDB 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.”

---

Flow E — IAM and KMS (who is trusted)

IAM and KMS trust  who is allowed to do what Flow E  Trust. Two Lambda roles plus a CMK policy. No star on data APIs. 1. Ingest role Trust: lambda.amazonaws.com s3:PutObject landing/* dynamodb:PutItem on this table kms:Decrypt, GenerateDataKey logs:CreateLogGroup / Stream / Put No GetObject. No SNS. No SQS. 2. Processor role Trust: lambda.amazonaws.com s3:GetObject landing/* dynamodb:UpdateItem sns:Publish this topic sqs Receive / Delete / GetAttrs kms:Decrypt, GenerateDataKey 3. Who is not a role API Gateway uses a resource policy on the Lambda (lambda:InvokeFunction). EventBridge uses the SQS queue policy, not an IAM role. Name that difference in interview. 4. CMK key policy  two statements Account root: kms:* so you can administer the key. AWS services: s3, dynamodb, sns, sqs, events, lambda, logs get Encrypt / Decrypt / GenerateDataKey* / CreateGrant / DescribeKey. 5. Why EventBridge is on that list Encrypted SQS will not accept the event unless the bus can generate a data key. IAM on Lambda is not enough. The CMK policy must allow the service principal. 6. What you do not say "I used Resource": "*" on S3 or DynamoDB. 7. Public access Block Public ACLs / policy on the bucket. Versioning on. force_destroy for lab teardown.
Trust plane — IAM and KMS
  1. Ingest role: s3:PutObject on landing/*, dynamodb:PutItem, KMS generate/decrypt, logs. No GetObject, no SNS, no SQS.
  2. Processor role: s3:GetObject on landing/*, dynamodb:UpdateItem, sns:Publish, SQS receive/delete, KMS generate/decrypt, logs.
  3. API Gateway is not a role on those data APIs. It is a resource policy on the ingest function (lambda:InvokeFunction).
  4. EventBridge is not a role on SQS. It is a queue policy plus a CMK policy grant to events.amazonaws.com.
  5. The CMK has account-root kms:* (so you can administer it) and a service statement for S3, DynamoDB, SNS, SQS, EventBridge, Lambda, and Logs.
  6. Do not put "Resource": "*" on S3 or DynamoDB in this design. Name the table ARN and the landing/* prefix.
  7. The bucket blocks public ACLs and public policy. Versioning is on. Terraform sets 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.”

---

Why these services (and what you rejected)

ConcernChoiceRejectedWhy
IngestAPI Gateway + LambdaHolding scan on the request202, not a 2-minute HTTPS call
BytesS3DynamoDB itemObjects are files, not 400 KB rows
Intent / statusDynamoDBRDSOne key, jobId, pay-per-request
BufferSQS + DLQDirect Lambda-to-LambdaRetry and back-pressure
Fan-outEventBridge then SNSHard-coded extra LambdasAdd consumers without changing ingest
EncryptionCustomer CMKSSE-S3 onlyInterview 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.”

---

60-second interview script

“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

Lab — Build a small document pipeline

text

Client → API Gateway → Lambda (ingest) → S3
       → EventBridge → SQS → Lambda (processor) → DynamoDB → SNS

This 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.

Serverless document pipeline Client API Gateway Ingest Lambda S3 EventBridge SQS Processor DynamoDB SNS DLQ
What you will deploy

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.

Happy path  12 numbered hops Happy path  read the numbers in order. Sync returns 202. Async finishes the job. SYNCHRONOUS  the client is still on the socket 1 Client curl POST /ingest 2 API Gateway HTTP API, AWS_PROXY 3 Ingest Lambda decode + jobId 4 DynamoDB PutItem RECEIVED 5 S3 landing PutObject + KMS 6 HTTP 202 jobId + s3Key After step 6 the client hangs up. Processing is not on this request. ASYNCHRONOUS  the file is already in S3 7 S3 event Object Created 8 EventBridge rule match 9 SQS buffer + retry 10 Processor GetObject 11 DynamoDB status PROCESSED 12 SNS notify DLQ after 3 fails
Happy path — 12 numbered hops

1. Download the entire lab

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 functions
  • terraform/main.tf, variables.tf, terraform.tfvars.example — full stack
  • cloudformation/template.yaml — the same stack if you cannot run Terraform
  • scripts/demo.sh — posts a sample file and waits for PROCESSED
  • sample-files/sample.txt, architecture, troubleshooting, cleanup

Typical cost is under $2 if you destroy the same day.

2. Unzip and deploy (Terraform)

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 apply

name_prefix must be unique, lowercase, and 2–21 characters (letters, numbers, hyphens).

Note the outputs: ingest_url, bucket, table, queue, dlq, topic.

3. Demo

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.sh

Wait about 10 seconds, then confirm:

  1. S3 landing/{jobId}/sample.txt exists
  2. DynamoDB item status is PROCESSED
  3. SQS DLQ (dead-letter queue for failed messages) depth is 0
  4. CloudWatch has log streams for both functions

4. CloudFormation (if you cannot use Terraform)

bash

aws cloudformation deploy \
  --stack-name yourinitials-sa-lab \
  --template-file cloudformation/template.yaml \
  --parameter-overrides NamePrefix=yourinitials-sa-lab \
  --capabilities CAPABILITY_NAMED_IAM

Use the IngestUrl output with the same curl. Delete the stack when you are done.

5. Cleanup (do this the same day)

bash

cd terraform
terraform destroy

If the bucket is not empty:

bash

aws s3 rm "s3://$(terraform output -raw bucket)" --recursive
terraform destroy

This pack’s Terraform sets force_destroy = true on the bucket, so destroy works after a demo even with versioned objects.

What the code does

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.

Prerequisites

  • AWS account that can create IAM, S3, Lambda, API Gateway, SQS, SNS, DynamoDB, EventBridge, KMS
  • Terraform ≥ 1.5 or AWS CLI + CloudFormation
  • 45–60 minutes

Failure drill — break the lab on purpose

Failure drill — break the lab on purpose

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.

Three lab stalls to name in interview After a green demo, break these three. Then destroy. 1. EventBridge + KMS Remove events.amazonaws.com from the CMK policy. See: 202, object in S3, status stays RECEIVED, queue empty, DLQ empty. Not a Python bug. 2. Reserved concurrency 0 Mute the processor. Ingest still succeeds. See: queue depth grows, no processor invokes, no 5xx on the client. Looks like a silent outage. 3. Encoded S3 key Skip unquote_plus. Upload my file.txt. See: GetObject miss, retries, then DLQ. Replay after the fix. Do not re-POST as recovery.
Three lab stalls to name in interview

Drill 1 — EventBridge cannot write encrypted SQS

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.”

Drill 2 — Reserved concurrency 0

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.”

Drill 3 — Encoded S3 key

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.”

Cleanup

terraform destroy the same day. Do not leave a broken concurrency setting in the account.

Troubleshooting

Troubleshooting

Troubleshooting

If the demo stalls, start here. Most lab breaks are IAM, KMS (the encryption key), or a path — not Python.

SymptomLikely causeFix
terraform apply fails on archive_fileMissing 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 ingestApply did not finish, or you curled the wrong URLterraform output ingest_url — it must end with /ingest
Object in S3, DynamoDB stays RECEIVEDEventBridge (the AWS event bus) cannot write the encrypted SQS queueConfirm 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 allEventBridge rule or Lambda event-source mappingCheck the rule target is the process queue and the mapping is enabled
Processor loopsVisibility timeout (hide time while a worker has the message) shorter than the functionThis 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 receivesRead /aws/lambda/{prefix}-processor. Replay after you fix the code
KMS AccessDeniedRole or service missing decryptUse the key and roles the template creates. Do not swap in a different CMK
Bucket already existsname_prefix is not uniqueChange name_prefix to your initials plus a date
Unexpected costStack left runningterraform 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

Cleanup

Destroy the same day. That keeps the bill near zero.

Terraform

bash

cd terraform
terraform destroy

If 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 destroy

CloudFormation

bash

aws cloudformation delete-stack --stack-name yourinitials-sa-lab
aws cloudformation wait stack-delete-complete --stack-name yourinitials-sa-lab

Confirm: 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}),
    }

Pricing

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

Self-paced

$49

Small group

$129

Live 1:1

$349

Introductory $299

Book Your Interview Sprint

Request a slot. Invoicing is handled by BayAreaLa8s after the request — no Stripe checkout.

Log in or enroll to request a live session time.