Interview Questions

Get ready for your next interview with our comprehensive question library

DynamoDB Interview Questions

Filter by Difficulty

1.

What is Amazon DynamoDB and what are its key characteristics?

beginner

Amazon DynamoDB is a fully managed NoSQL database service provided by AWS. Key characteristics include:

  • Serverless: No infrastructure management required
  • High Performance: Single-digit millisecond latency at any scale
  • Highly Available: 99.99% availability SLA with multi-AZ replication
  • Flexible Schema: NoSQL document and key-value data models
  • Auto Scaling: Automatically scales up/down based on traffic
  • ACID Transactions: Support for transactions across multiple items
  • Global Tables: Multi-region, multi-master replication
2.

What are the main data types supported by DynamoDB?

beginner

DynamoDB supports several data types:

Scalar Types:

  • String (S)
  • Number (N)
  • Binary (B)
  • Boolean (BOOL)
  • Null (NULL)

Collection Types:

  • String Set (SS)
  • Number Set (NS)
  • Binary Set (BS)
  • List (L) - ordered collection of values
  • Map (M) - unordered collection of key-value pairs
3.

What is the difference between DynamoDB and traditional relational databases?

beginner
DynamoDB Relational Database
NoSQL, schema-less SQL, fixed schema
Horizontal scaling Vertical scaling (primarily)
Eventually consistent reads by default ACID consistency
No complex joins Complex joins supported
Key-value and document model Relational model
Managed service Requires administration
Pay per request/capacity Pay for instance time
4.

What is a partition key and why is it important?

beginner

A partition key is the primary key component that determines which physical partition your data is stored on. It's crucial because:

  • Data Distribution: DynamoDB uses the partition key value to distribute data across multiple partitions
  • Performance: Even distribution prevents hot partitions
  • Scalability: Enables horizontal scaling across partitions

Example: In a user table, user_id as partition key distributes users evenly across partitions.

5.

Explain the difference between Query and Scan operations.

beginner

Query:

  • Uses primary key or index keys
  • Retrieves specific items efficiently
  • Lower cost and better performance
  • Can use filter expressions for additional filtering

Scan:

  • Examines every item in table/index
  • Expensive and slow for large tables
  • Uses filter expressions to return subset
  • Should be avoided in production for large datasets
# Query example
response = table.query(
    KeyConditionExpression=Key('user_id').eq('123')
)

# Scan example  
response = table.scan(
    FilterExpression=Attr('age').gt(21)
)
6.

What are Read Capacity Units (RCU) and Write Capacity Units (WCU)?

beginner

Upgrade to Premium to see the answer

Upgrade to Premium
7.

How do you implement Time to Live (TTL) in DynamoDB?

beginner

Upgrade to Premium to see the answer

Upgrade to Premium
8.

What are the differences between DynamoDB Local and DynamoDB in AWS?

beginner

Upgrade to Premium to see the answer

Upgrade to Premium
9.

Explain the difference between partition key and composite primary key.

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
10.

What are the best practices for choosing a good partition key?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
11.

How do you model one-to-many relationships in DynamoDB?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
12.

What are Global Secondary Indexes (GSI) and when would you use them?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
13.

What's the difference between GSI and Local Secondary Index (LSI)?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
14.

What are sparse indexes and how are they useful?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
15.

What are the consistency models in DynamoDB?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
16.

What are DynamoDB transactions and when should you use them?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
17.

What are conditional writes and how do they work?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
18.

What's the difference between provisioned and on-demand capacity modes?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
19.

What causes throttling in DynamoDB and how can you prevent it?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
20.

What is eventual consistency and how does it affect your application design?

intermediate

Upgrade to Premium to see the answer

Upgrade to Premium
Showing 1 to 20 of 35 results

Premium Plan

$10.00 /monthly
  • Access all premium content - interview questions, and other learning resources

  • We regularly update our features and content, to ensure you get the most relevant and updated premium content.

  • 1000 monthly credits

  • Cancel anytime