Top 23 Cassandra Interview Questions & Answers

Download PDF

1) Explain what is Cassandra?

Cassandra is an open source data storage system developed at Facebook for inbox search and designed for storing and managing large amounts of data across commodity servers. It can server as both

2) What is the use of Cassandra and why to use Cassandra?

Cassandra was designed to handle big data workloads across multiple nodes without any single point of failure.  The various factors responsible for using Cassandra are

3) Explain what is composite type in Cassandra?

In Cassandra, composite type allows to define key or a column name with a concatenation of data of different type. You can use two types of Composite Type

4) How Cassandra stores data?

5) Mention what are the main components of Cassandra Data Model?

The main components of Cassandra Data Model are

Cassandra Interview Questions

6) Explain what is a column family in Cassandra?

Column family in Cassandra is referred for a collection of Rows.

7) Explain what is a cluster in Cassandra?

A cluster is a container for keyspaces. Cassandra database is segmented over several machines that operate together. The cluster is the outermost container which arranges the nodes in a ring format and assigns data to them.  These nodes have a replica which takes charge in case of data handling failure.

8) List out the other components of Cassandra?

The other components of Cassandra are

9) Explain what is a keyspace in Cassandra?

In Cassandra, a keyspace is a namespace that determines data replication on nodes. A cluster consist of one keyspace per node.

10) What is the syntax to create keyspace in Cassandra?

Syntax for creating keyspace in Cassandra is

CREATE KEYSPACE <identifier> WITH <properties>

11) Mention what are the values stored in the Cassandra Column?

In Cassandra Column, basically there are three values

12) Mention when you can use Alter keyspace?

ALTER KEYSPACE can be used to change properties such as the number of replicas and the durable_write of a keyspace.

13) Explain what is Cassandra-Cqlsh?

Cassandra-Cqlsh is a query language that enables users to communicate with its database. By using Cassandra cqlsh, you can do following things

14) Mention what does the shell commands “Capture” and “Consistency” determines?

There are various Cqlsh shell commands in Cassandra. Command “Capture”, captures the output of a command and adds it to a file while, command “Consistency” display the current consistency level or set a new consistency level.

15) What is mandatory while creating a table in Cassandra?

While creating a table primary key is mandatory, it is made up of one or more columns of a table.

16) Mention what needs to be taken care while adding a Column?

While adding a column you need to take care that the

17) Mention what is Cassandra- CQL collections?

Cassandra CQL collections help you to store multiple values in a single variable. In Cassandra, you can use CQL collections in following ways

18) Explain how Cassandra writes data?

Cassandra writes data in three components

Cassandra first writes data to a commit log and then to an in-memory table structure memtable and at last in SStable

19) Explain what is Memtable in Cassandra?

20) Explain what is SStable consist of?

SStable consist of mainly 2 files

21) Explain what is Bloom Filter is used for in Cassandra?

A bloom filter is a space efficient data structure that is used to test whether an element is a member of a set. In other words, it is used to determine whether an SSTable has data for a particular row. In Cassandra it is used to save IO when performing a KEY LOOKUP.

22) Explain how Cassandra writes changed data into commitlog?

Data will not be lost once commitlog is flushed out to file

23) Explain how Cassandra delete Data?

SSTables are immutable and cannot remove a row from SSTables.  When a row needs to be deleted, Cassandra assigns the column value with a special value called Tombstone. When the data is read, the Tombstone value is considered as deleted.

 

YOU MIGHT LIKE: