DynamoDB Interview Preparation
This lesson brings the whole course together as interview practice: core concepts, data modeling, indexes, streams, transactions, global tables, and operations.
Introduction
This lesson brings the whole course together as interview practice: core concepts, data modeling, indexes, streams, transactions, global tables, and operations. Answer each question out loud before expanding it, then work through the design exercise at the end.
Purpose of this lesson
You will review the questions interviewers ask most often about DynamoDB and practise a full single-table design under time pressure.
Understanding the topic
What interviewers look for:
- You start from access patterns, not entities.
- You can explain partition keys, hot partitions, and capacity math.
- You know when to use GSIs vs LSIs, Query vs Scan, transactions vs conditional writes.
- You design failure handling for streams and retries.
- You know when DynamoDB is the wrong choice.
Advanced interview questions
Interview Prep
Practice concise answers, then expand each card for the explanation.
1BeginnerQuestionExplain partition keys and sort keys.+
Answer
2BeginnerQuestionHow many WCUs does writing a 2.5 KB item use?+
Answer
3BeginnerQuestionWhy are Scans discouraged?+
Answer
4IntermediateQuestionGSI vs LSI?+
Answer
5IntermediateQuestionHow do you model a many-to-many relationship?+
Answer
6IntermediateQuestionHow do you guarantee unique usernames?+
Answer
7IntermediateQuestionWhat happens when a Lambda stream consumer keeps failing on one record?+
Answer
8AdvancedQuestionHow do global tables handle write conflicts?+
Answer
9AdvancedQuestionA table is throttling but consumed capacity is low. What is happening?+
Answer
10IntermediateQuestionWhen would you not use DynamoDB?+
Answer
Hands-on exercise
Design exercise (30 minutes): design the table for a ride-sharing app with these access patterns: get rider profile; list a rider's trips newest first; get a trip with its location updates; list available drivers in a city zone; ensure a driver is assigned to only one active trip; expire location updates after 30 days. Write the key layout, indexes, transactions, and TTL settings, then compare with the solution notes below.
- Rider:
PK=RIDER#id, SK=PROFILE; trips under the rider:SK=TRIP#<ISO time>#tripId(Query, descending). - Trip:
PK=TRIP#idwithSK=HEADERandSK=LOC#<ISO time>items; TTLexpiresAton location items. - Available drivers: sparse GSI on
availableZone = CITY#zone(set only while available), sharded if zones are hot. - One active trip per driver: transaction that conditionally sets
activeTripIdon the driver item (attribute_not_exists(activeTripId)) and creates the trip.
Summary
Interview success with DynamoDB comes from access-pattern-first modeling, clear capacity math, the right index and write primitives, robust stream handling, and knowing DynamoDB's limits.