Dynamodb Interview Questions

The use of SQL databases started plummeting with the advent of DynamoDB. The DynamoDB is pretty much being used as the replacement of SQL database. This replacement was made due to the key advantage which is, the DynamoDB is extremely fast and is highly scalable.

With the increase of use of this NoSQL database service, the industry demands candidates with DynamoDB knowledge. It is high time for the aspirants who seek bright future in the back-end field to be well-aware of this database. And, if you already are acknowledged with DynamoDB and your interview is heading near, then this list of few DynamoDB interview questions will help you crack the interview.

#1 List types of secondary indexes supported by Amazons DynamoDB?

Two types of indexes are supported by Amazon DynamoDB. They are:
  • Global Secondary index – It is an index with a partition or a partition sort key that is different from those on the table. The global secondary index is considered to be global because queries on the index can span all the items in a table, across all the partitions.
  • Local secondary index – An index that has the same partition key as that of the table but different sort key. It is considered to be “local” because every partition of the index is scoped to a table partition that has the same partition key.

#2 List the APIs provided by Amazon DynamoDB?

  • CreateTable
  • UpdateTable
  • DeleteTable
  • DescribeTable
  • ListTables
  • PutItem
  • BatchWriteItem
  • UpdateItem
  • DeleteItem
  • GetItem
  • BatchGetItem.
  • Query
  • Scan

#3 List some benefits of using Amazon DynamoDB?

Here is the list of some of the benefits of using Amazon DynamoDB:
  • It is a managed service where there is no need to hire the experts or worry about installation, setup, cluster etc.,
  • It is scalable.
  • It provides the users high throughput at very low latency.
  • It is durable and highly available.
  • It is flexible and allows dynamic tables creation that includes multi-valued attributes.
  • It is cost-effective.

#4 What is DynamoDB Auto Scaling?

DynamoDB is a superintended feature that scales up and down the read and write capacity of a DynamoDB or a global secondary index automatically.

#5 Please explain key-value store?

It is a database service that provides and supports storing, updating and querying the objects that are identified using key and values that constitutes the actual content that is being stored.

#6 Does DynamoDB support in-place atomic updates?

Amazon DynamoDB supports quick in-place atomic updates, where the numeric attribute’s increment and decrement can be done in arrow using just one API call or similarly, you can add or remove sets, lists, or maps. Also Prepare: Frequently Asked Amazon Interview Questions

#7 What Amazon DynamoDB BatchWriteItem API does?

The Amazon DynamoDB BatchWriteItem inserts, deletes and replaces multiple items across multiple tables in just one request, but not in one transaction.
With maximum total request size of 16 MB, it supports batches of up to 25 items to insert or delete.

#8 Does Amazon DynamoDB support conditional operations?

For an operation to be completed on an item, you have to specify a condition.
You can define a ConditionExpression that can be constructed from the following:
  • Comparison operators: =, <>, <, >, <=, >=, BETWEEN, and IN
  • Logical operators: NOT, AND, and OR. 

You can also construct a free-form conditional expression that combines multiple conditional clauses which also includes nested clauses.

#9 Explain what is DynamoDB Mapper Class?

It is the entry point to DynamoDB.The DynamoDB Mapper class provides access to a DynamoDB endpoint and enables the user to access to their data in various tables, execute queries and scan against tables, and perform CRUD operations on items.

#10 Can I delete local secondary indexes?

Currently, the Amazon DynamoDB is incapable of removing the local secondary indexes from the table once they are created, but it is possible to delete the entire table.

#11 What are the non-relational Databases?

The Non-Relational databases are NoSQL databases.
These databases are categorized into four groups, and they are:
  • Key-value stores
  • Graph stores
  • Column stores
  • Document stores

#12 How to delete a Global Secondary Index in Amazon DynamoDB?

A Global secondary index can be deleted from the console or through an API call.

Select the table from which you want to delete the Global Secondary index on the console, select the “indexes” tab under “Table items” and then click on the “Delete” button which is next to the delete index.

A Global Secondary Index can also be deleted using the Update Table API call.

Also Prepare: Frequently Asked Amazon DevOps Engineer Interview Questions

#13 List the Data Types supported by DynamoDB?

DynamoDB supports four scalar data types, and they are:
  • Number
  • String
  • Binary
  • Boolean

DynamoDB supports collection data types such as:

  • Number Set
  • String Set
  • Binary Set
  • Heterogeneous List
  • Heterogeneous Map

DynamoDB also supports Null values.

#14 What are local secondary indexes?

An index with the same partition key as the table but different sort key is called local secondary index.

A local secondary index is considered to be “local” because every partition of a local secondary index is scaled to a table partition which contains the same partition key.

#15 How to create local secondary indexes?

A Local secondary index needs to be created at the time of creating a table that can’t be added currently.
So, later when you create a local secondary index, try specifying the following two parameters.
  • Indexed Sort Key : The attribute on which indexing and querying are performed.
  • Projected Attributes : It is the list of attributes from the table that can directly be copied into the local secondary index. Without projected attributes, the local secondary index contains only primary keys and secondary keys.
Ask a Question