Prepare for your DynamoDB interview with these 30 essential questions covering basic concepts, practical scenarios, and advanced features. Organized from basic to advanced, this guide helps freshers, 1-3 year professionals, and 3-6 year experienced candidates master DynamoDB fundamentals and best practices.[1][2][5]
Basic DynamoDB Questions (1-10)
1. What is Amazon DynamoDB?
DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability. It supports both document and key-value store models and handles table creation, indexing, and data replication automatically.[1][3][5]
2. What are the key features of DynamoDB?
Key features include single-digit millisecond latency, automatic scaling, built-in fault tolerance across multiple Availability Zones, and support for provisioned or on-demand capacity modes.[3][5]
3. What is a primary key in DynamoDB?
A primary key uniquely identifies each item in a table. It can be a partition key (hash key) alone or a composite key with both partition key and sort key (range key) for efficient data organization.[2][4]
4. What is the difference between On-Demand and Provisioned Capacity in DynamoDB?
On-Demand capacity automatically scales throughput based on traffic with no capacity planning required, while Provisioned capacity lets you specify read/write capacity units upfront for predictable workloads.[3][5]
5. What type of consistency does DynamoDB provide by default?
DynamoDB provides eventual consistency by default for reads, meaning replicas may take time to reflect recent writes. Strong consistency is available but consumes double the read capacity.[1][2]
6. What is the maximum item size in DynamoDB?
The maximum size of an item in DynamoDB is 400 KB, including attribute names and values in binary format.[5]
7. How does DynamoDB ensure high availability and fault tolerance?
DynamoDB automatically replicates data across three Availability Zones in a region, providing 99.99% availability and durable storage with automatic backups.[3]
8. What are Read Capacity Units (RCUs) and Write Capacity Units (WCUs) in DynamoDB?
One RCU allows one strongly consistent read of up to 4 KB per second, or two eventually consistent reads. One WCU allows one write of up to 1 KB per second.[3][5]
9. Can you change the provisioned throughput settings of a DynamoDB table after creation?
Yes, you can modify provisioned throughput settings anytime without downtime using automatic scaling or manual adjustments.[3]
10. What is DynamoDB Auto Scaling?
DynamoDB Auto Scaling automatically adjusts provisioned read and write capacity based on traffic patterns, making it cost-effective while maintaining performance.[5]
Intermediate DynamoDB Questions (11-20)
11. What is the difference between a Scan and a Query operation in DynamoDB?
Query uses the primary key for efficient access to specific items, while Scan examines every item in the table, making it slower and more expensive for large tables.[2][5]
12. What are Local Secondary Indexes (LSIs) in DynamoDB?
LSIs provide an alternative sort key for a given partition key in the same table, created at table creation with shared read/write capacity.[1][4]
13. What are Global Secondary Indexes (GSIs) in DynamoDB?
GSIs have a different partition key and optional sort key from the base table, with independent read/write capacity and can be added or removed anytime.[1][4]
14. What is the purpose of DynamoDB Streams?
DynamoDB Streams capture item-level modifications in near-real-time as an ordered sequence for 24 hours, enabling applications to respond to changes.[5]
15. How does DynamoDB handle schema changes?
DynamoDB is schemaless, so you can add or update attributes dynamically without downtime. Use secondary indexes and data migration for complex schema evolution.[2]
16. What are conditional writes in DynamoDB?
Conditional writes succeed only if specified conditions (like attribute existence or value comparison) are met, ensuring data integrity and preventing conflicts.[2][6]
17. How do you handle throttling in DynamoDB?
Implement exponential backoff in your application code to retry throttled requests gracefully. Monitor CloudWatch metrics and use auto-scaling to prevent throttling.[1]
18. What are access patterns in DynamoDB data modeling?
Access patterns define how your application reads/writes data. Design partition keys, sort keys, and indexes to efficiently support these patterns for optimal performance.[2][4]
19. How can you optimize queries in DynamoDB at Flipkart?
Choose appropriate partition keys to distribute data evenly, use sort keys for range queries, leverage GSIs/LSIs for alternate access patterns, and minimize scanned attributes.[3][5]
{
TableName: "Orders",
KeyConditionExpression: "CustomerId = :cid AND OrderDate BETWEEN :start AND :end",
ExpressionAttributeValues: {
":cid": "CUST123",
":start": "2026-01-01",
":end": "2026-02-06"
}
}
20. What is the purpose of provisioned throughput in DynamoDB?
Provisioned throughput specifies guaranteed RCUs/WCUs for predictable performance. Monitor utilization via CloudWatch to right-size capacity.[1][3]
Advanced DynamoDB Questions (21-30)
21. Explain DynamoDB Transactions.
Transactions provide atomicity across multiple items/tables with all-or-nothing execution, supporting up to 100 actions with 4 MB total size limit.[5]
22. How would you implement optimistic concurrency control at Zoho using DynamoDB?
Store a version attribute in items. Use conditional writes checking the version matches before updating, then increment the version on success.[2][6]
23. What are DynamoDB backups and Point-in-Time Recovery (PITR)?
On-demand backups create full table snapshots. PITR enables continuous backups with up to 35 days retention for restoring to any point within that window.[1]
24. How do you monitor and troubleshoot performance issues in DynamoDB?
Use CloudWatch metrics for throttled requests, latency, and capacity utilization. Enable Contributor Insights for hot partitions and analyze query patterns.[1]
25. What security features does DynamoDB provide?
IAM policies control access, encryption at rest (default KMS) and in transit (HTTPS), fine-grained access control, and VPC endpoints for private connectivity.[1]
26. How would you design a DynamoDB table for a Paytm e-commerce order system?
Use OrderId as partition key for point lookups, add GSIs for customer-based queries (CustomerId-GSI) and time-based queries (OrderDate-GSI).[4][18]
27. What is DynamoDB Accelerator (DAX)?
DAX is an in-memory cache providing microsecond latency for reads, handling up to 99% cache hit rates while maintaining DynamoDB consistency guarantees.[7]
28. How do you implement a conditional write in DynamoDB? Provide a code example.
Use ConditionExpression to specify atomic conditions:
{
TableName: "Users",
Key: {"UserId": {"S": "USER123"}},
UpdateExpression: "SET Balance = Balance - :amount",
ConditionExpression: "Balance >= :amount",
ExpressionAttributeValues: {":amount": {"N": "100"}}
}
If condition fails, returns ConditionalCheckFailedException.[1][2]
29. Explain sparse indexes in DynamoDB at Salesforce.
Sparse indexes only include items with the indexed attribute present, saving capacity. GSIs automatically handle sparse attributes efficiently.[1]
30. How would you handle hot partitions in a high-traffic Swiggy food delivery app using DynamoDB?
Use high-cardinality partition keys, composite keys with random suffixes, write sharding across multiple partitions, and monitor with Contributor Insights.[1][4]
## Related Posts