Interview Q&A · questions with model answers

DynamoDB Interview Questions

Ordered by how often they're asked. Most-asked answers are free to read in full; members see every answer and can rate their confidence on each.

  1. Most asked Explain partition keys, sort keys and the two kinds of primary key.

    A primary key is either a simple partition key (each item has a unique partition key value) or a composite of partition key plus sort key (items share a partition key and are unique by sort key).…

  2. Most asked How do conditional writes work, and how do you implement optimistic locking in DynamoDB?

    A ConditionExpression makes a write succeed only if the condition holds on the current item (attribute_not_exists(PK), version = :expected, balance >= :amount); otherwise it fails with…

  3. Most asked DynamoDB or a relational database such as Aurora PostgreSQL: how do you decide?

    Choose DynamoDB when access patterns are known and key-based, scale or traffic spikes are large, and you want a serverless operational model. Choose a relational database when you need flexible…

  4. Most asked How does DynamoDB partition data, and what limits apply per partition?

    DynamoDB hashes the partition key to place items on partitions (storage units of up to about 10 GB). Each partition supports up to 3,000 read capacity units and 1,000 write capacity units per…

  5. Most asked How does pagination work in DynamoDB?

    Query and Scan return at most 1 MB of data per call (before filtering), plus LastEvaluatedKey when there is more. Pass it as ExclusiveStartKey in the next request. Limit caps the number of items…

  6. Most asked How do DynamoDB transactions work, and what are their limits?

    TransactWriteItems and TransactGetItems apply up to 100 actions across items and tables (in one account and Region) atomically: all succeed or none do, with conditions checked as part of the…

  7. Do filter expressions reduce the capacity a query consumes?

    No. Filters are applied after items are read, so you pay read capacity for every item the Query or Scan evaluated, not just those returned. Filters only reduce the data sent back over the network.

  8. How does TTL work in DynamoDB?

    You choose a numeric attribute containing an expiry time in Unix epoch seconds; DynamoDB deletes expired items in the background at no write cost. Deletion is not immediate: items can remain for…

  9. How do backups and point-in-time recovery work in DynamoDB?

    Point-in-time recovery (PITR) continuously backs up the table so you can restore to any second within the retention period (up to 35 days). On-demand backups create full snapshots kept until you…

  10. How do BatchGetItem and BatchWriteItem work, and what is the catch?

    BatchGetItem reads up to 100 items (16 MB) and BatchWriteItem puts or deletes up to 25 items (16 MB) in one call, across tables. They are not transactional, and any items DynamoDB could not process…

Was this page helpful?

Report a mistake