Home › Blog › DynamoDB Interview Questions (2026): 30 Questions on Keys, Indexes, Capacity and Design

DynamoDB Interview Questions (2026): 30 Questions on Keys, Indexes, Capacity and Design

DynamoDB interview questions check whether you can design keys for access patterns, size capacity and avoid hot partitions, because DynamoDB gives single-digit-millisecond reads only for the queries your keys and indexes were built for. Limits matter in these interviews, so the numbers below come from the AWS DynamoDB developer guide, checked November 17, 2026: 400 KB maximum item size, 1 MB per Query or Scan page, 100 items or 4 MB per transaction, and 20 global and 5 local secondary indexes per table by default.

DynamoDB interview questions check whether you can design keys for access patterns, size capacity and avoid hot partitions, because DynamoDB gives single-digit-millisecond reads only for the queries your keys and indexes were built for. Limits matter in these interviews, so the numbers below come from the AWS DynamoDB developer guide, checked November 17, 2026: 400 KB maximum item size, 1 MB per Query or Scan page, 100 items or 4 MB per transaction, and 20 global and 5 local secondary indexes per table by default.

Below are 30 questions by level, five design scenarios and how interviews test this. Wider AWS ground is in AWS interview questions; a self-managed relative is in Cassandra interview questions.

DynamoDB interview questions: fundamentals (1–10)

  1. What is DynamoDB? A fully managed, serverless key-value and document database from AWS. You define a primary key and capacity mode; AWS handles partitioning, replication across Availability Zones, patching and scaling.
  2. Partition key versus composite primary key? A simple primary key is only a partition key. A composite key adds a sort key, so many items share a partition key and are ordered by the sort key, which enables range queries such as begins_with(SK, 'ORDER#').
  3. How big can keys and items be? Partition key values up to 2048 bytes, sort key values up to 1024 bytes, and items up to 400 KB including attribute names. Store large blobs in S3 and keep a pointer.
  4. What is a read capacity unit? One strongly consistent read per second of an item up to 4 KB, or two eventually consistent reads; a transactional read costs two units. Sizes round up, so an 8 KB strongly consistent read needs 2 units.
  5. What is a write capacity unit? One write per second of an item up to 1 KB, rounded up; transactional writes cost double. A 3.5 KB item costs 4 write units per write.
  6. On-demand or provisioned capacity? On-demand bills per request and absorbs spiky, unknown traffic. Provisioned (optionally with auto scaling and reserved capacity) is cheaper for steady, predictable load. By default a table can use up to 40,000 read and 40,000 write units, an adjustable quota.
  7. Query versus Scan? Query reads one partition key's items, optionally narrowed by sort key, and is efficient. Scan reads the whole table and then filters, consuming capacity for everything it reads. Both return at most 1 MB per call; page with LastEvaluatedKey.
  8. Do filter expressions save capacity? No. Filters apply after items are read, so you pay for everything read. Put selective conditions in the key condition, or design a key or index for them.
  9. Eventually or strongly consistent reads? Reads are eventually consistent by default and cost half. Strongly consistent reads return the latest committed write but are not available on global secondary indexes.
  10. What is TTL? An attribute holding an epoch timestamp; DynamoDB deletes expired items in the background, typically within a few days per the AWS docs, at no write cost. Filter expired items out of queries until then.

Intermediate DynamoDB questions (11–20)

  1. GSI or LSI? A global secondary index has its own partition and sort key, can be added at any time, has its own capacity and is eventually consistent. A local secondary index shares the table's partition key with a different sort key, must be created with the table and supports strong reads. Defaults: 20 GSIs and 5 LSIs per table.
  2. What limit does an LSI add? With any LSI, an item collection (all items sharing a partition key, plus their LSI entries) cannot exceed 10 GB, because it cannot be split across partitions.
  3. What are projections? The attributes copied into an index: KEYS_ONLY, INCLUDE or ALL. Project what the query needs; reading a missing attribute from a GSI means a second request to the table.
  4. How do transactions work? TransactWriteItems and TransactGetItems are all-or-nothing across tables in one Region, up to 100 unique items or 4 MB, with no two actions on the same item. They cost twice the capacity of standard operations.
  5. What are batch operation limits? BatchGetItem reads up to 100 items (16 MB); BatchWriteItem takes up to 25 put or delete requests (16 MB). Batches are not transactional: retry whatever comes back in UnprocessedItems or UnprocessedKeys, with backoff.
  6. How do you do optimistic locking? Store a version number and write with a condition: ConditionExpression: "version = :expected", incrementing it on success. A ConditionalCheckFailedException means someone else won, so re-read and retry.
  7. What are DynamoDB Streams? A log of item changes, in order for each item, kept for 24 hours, with the new image, old image or both. Typical consumers are Lambda functions for projections, search indexing, auditing or cross-system events.
  8. What is a hot partition and how do you avoid it? Traffic concentrated on one partition key value. AWS says a single partition can deliver up to 3,000 read units and 1,000 write units; adaptive capacity helps uneven load but cannot split one item. Fix with high-cardinality keys or write sharding (key#0 to key#9).
  9. How do you paginate? Use Limit and pass LastEvaluatedKey back as ExclusiveStartKey. Counting or jumping to page 50 is expensive, so prefer "load more" designs.
  10. What is DAX? DynamoDB Accelerator, an in-memory, write-through cache with a DynamoDB-compatible API for microsecond reads on read-heavy, eventually consistent workloads. It does not help write-heavy or strongly consistent reads.

Experienced and senior DynamoDB questions (21–30)

  1. What is single-table design? Storing several entity types in one table with generic keys (PK, SK) such as PK=CUSTOMER#42, SK=ORDER#2026-11-17, so one Query returns related items together. It suits known access patterns; it is harder to evolve and analyze, and multiple tables are fine when patterns are independent.
  2. How do you model many-to-many relationships? An adjacency list: items for each edge with PK=A, SK=B, plus a GSI that swaps them (GSI1PK=B, GSI1SK=A) to query the other direction.
  3. What are sparse indexes? A GSI only contains items that have its key attributes. Setting an attribute such as pendingSince only on open orders gives a small index of open orders that is cheap to query.
  4. How do you get uniqueness on a non-key attribute? Write a second item keyed by that value, such as PK=EMAIL#a@b.com, in the same transaction as the user item, with attribute_not_exists(PK) conditions on both.
  5. What do global tables offer? Multi-Region, multi-active replicas. Per the AWS docs, the default mode is multi-Region eventual consistency (MREC); multi-Region strong consistency (MRSC) can be chosen at creation so strongly consistent reads in any MRSC replica return the latest version.
  6. How do backups and point-in-time recovery work? On-demand backups for long-term copies; point-in-time recovery restores to any second in a recovery period of 1 to 35 days (35 by default). A restore creates a new table.
  7. How do you run analytics on DynamoDB data? Not with Scans in production. Export to S3 (from PITR, without consuming capacity) and query with Athena or a warehouse, or stream changes through Streams or Kinesis into an analytics store.
  8. How do you migrate a hot key pattern without downtime? Dual-write the new key shape, backfill old items with a throttled job, switch reads behind a flag, then stop writing the old shape. Streams can drive the backfill.
  9. How do you control cost? Right capacity mode, projections kept small, no Scans on hot paths, TTL for expiring data, Standard-Infrequent Access table class for rarely read data, and CloudWatch alarms on consumed capacity and throttles.
  10. When is DynamoDB the wrong choice? Ad hoc queries, many-way joins, heavy aggregation, or access patterns you cannot predict. A relational database or a search engine fits better; DynamoDB rewards knowing your queries up front.

DynamoDB scenario and troubleshooting questions

Writes are being throttled even though table capacity looks fine. Look for a hot partition with CloudWatch Contributor Insights, and check GSIs: an under-provisioned GSI throttles writes to the base table. Fix the key distribution or the GSI capacity.

Design the table for an e-commerce order system. List access patterns first: order by ID, a customer's orders by date, orders by status. Then PK=CUSTOMER#id, SK=ORDER#date#id, a GSI on status and date (sparse for open orders), and an order item collection for line items.

A Scan-based admin page times out. Replace it with a GSI built for the filter, paginate with LastEvaluatedKey, or move the reporting to an S3 export.

Two workers double-process the same job item. Claim the job with a conditional update: SET owner = :me only if attribute_not_exists(owner), or a lease that expires. Only the winner proceeds.

A batch import reports success but items are missing. BatchWriteItem can return UnprocessedItems when throttled. The importer must loop on them with exponential backoff.

How DynamoDB interviews test this

FormatWhat it usually looks likeHow to prepare
Concept Q&AKeys, GSI versus LSI, capacity units, Query versus Scan, consistencyDo the capacity math out loud with item sizes
Data modeling"List the access patterns, then design keys and indexes"Practice single-table and multi-table versions of one app
System designDynamoDB as the store behind a high-traffic serviceExplain hot partitions, Streams and how you would back it up
AWS or backend roleLambda, Streams and IAM questions around the tableKnow conditional writes, transactions and retries

Interviewers often contrast DynamoDB with MongoDB and use Redis as the caching comparison.

Where CoPilot Interview fits

CoPilot Interview is an AI interview assistant. Its free AI mock interview builds DynamoDB and AWS questions from your résumé and the job description, reads them aloud and scores each spoken answer out of 10, which is a fast way to find the answers above that you know but cannot yet explain cleanly under pressure. The browser demo has 145 practice questions in 10 tracks, scores typed answers out of 10 and needs no signup. The free plan gives 15 minutes a day of live help in sessions of up to 15 minutes, with AI mock interviews included. Paid plans are Standard at $24.99 a month and Pro at $39.99 a month, in the desktop app for Windows 10/11 and macOS 12 or later.

Use it to practice. Online assessments, proctored tests, take-home tasks with rules and AI-led rounds forbid outside help, so prepare for those instead of bringing a tool. For any live interview, follow your employer's rules.

Disclosure: CoPilot Interview is our product, so weigh what we say about it accordingly.

Frequently asked questions

What are the most common DynamoDB interview questions?

Partition and sort keys, GSI versus LSI, read and write capacity units, on-demand versus provisioned, Query versus Scan, hot partitions, transactions, Streams and single-table design.

What is the maximum item size in DynamoDB?

400 KB, including attribute names, according to the AWS developer guide checked November 17, 2026.

Can you query a DynamoDB GSI with strong consistency?

No. Global secondary indexes support only eventually consistent reads; local secondary indexes and the base table support strongly consistent reads.

Is single-table design required?

No. It helps when entities are fetched together by known patterns. Several tables are simpler when access patterns are independent or analytics matter more.

How do I prepare for a DynamoDB interview?

Model one app three ways (multi-table, single-table, with GSIs), do capacity math for its traffic, and explain how you would handle a hot key and a failed batch write.

Practice this interview before the real one

The AI mock interview builds questions from your resume and the job description, reads them aloud and scores each spoken answer out of 10. Included on the free plan.

Start a mock interview