Skip to main content

38 Best Cassandra Interview Questions and Answers [Q/A]

What is Cassandra?
Answers: - The Cassandra is a free open source data storage system. It is developed by “Facebook”. It is used for “inbox search” and designed for storing and managing huge amounts of data.

The Cassandra is a NOSQL database which has high scalability and availability.

It is highly scalable, high-performance distributed database system and used for “Real Time” data store system for online and it is no single point of failure.

The Cassandra is a right choice when we need scalability and high availability without compromising performance.


Cassandra is written in which language?
Answers: -The Cassandra had written using “Java” language.

JMX stands for?
Answers: - The “JMX” stands for “Java Management Extension”.

“What is” Cassandra vs. Mongodb?

What is the advantage of Cassandra?
Answers: - The main advantage as following as,
1.      It’s is a free Open Source.
2.      It’s supported User Defined types.
3.      The idea is based on wide column store of BigTable and DynamoDB.
4.      Its extensible record stores and also store data in records with an ability to hold very large numbers of dynamic columns.
5.      It’s Implementation using Java language.
6.      It’s using Server operating systems like BSD, Linux, OS X, and Windows.
7.      Its schema free and secondary indexes restricted.
8.      The APIs and other methods access by proprietary protocols.
9.      It’s used sharding methods for partitioning.

When should you use Cassandra?
Answers: - The Cassandra is a NoSQL database and does not provide ACID and relational data property and its high scalability and availability and also no single point of failure.

How many types of NoSQL databases?
Answers: - Right now, 4 Types of NoSQL databases as,
1.      Document Stores (MongoDB, Couchbase)
2.      Column Stores (Cassandra)
3.      Key Value Stores (Redis, Volgemort)
4.      Graph Stores (Neo4j, Giraph)

What do you understand by Commit log in Cassandra?
Answers: - In Cassandra, commit log is a crash recovery mechanism. Each and every write operations are written to the commit log.

Define composite type in Cassandra?
Answers: - Composite type allows us to defining a key or a column name with a concatenation of data of different type in Cassandra.
Here are 2 types of Composite Types as,
1.      Row Key
2.      Column Name

How Cassandra stores data?
Answers: - In Cassandra, all the data stored as bytes. When you specify validators, Cassandra ensures those bytes are encoded or not as per your requirement.
This comparator orders the column based on the ordering specific to the encoding, while composite are just byte arrays with a specific encoding and for each components it stores a two byte length followed by the byte encoded components followed by a termination bit.

What is SSTable?
Answers: - The SStable consist two files that are,
1.      Index file.
2.      Data file.

What do you understand by Node in Cassandra?
Answers: - In Cassandra, the “Node” is the place where data is stored.

What is bloom filter?
Answers: - The Bloom filter is an off heap data structure and is used to check to data availability in the SSTable before performing any “I/O disk” operations.

What is Thrift?
Answers: - The Thrift is the name of the Remote Procedure Call (RPC) client and it used to communicate with the Cassandra server.

What are the main components of Cassandra Data Model?
Answers: - The Cassandra Data Model consists of 4 major components as following as,
1.      Cluster: - These are made-up of multiple nodes and keyspaces.
2.      Keyspace: - It’s a namespace and used to group multiple column families, especially one per partition.
3.      Column: - It’s consists of a column name, value and timestamp also.
4.      Column family: - It’s is used to refer to multiple columns with row key reference.

What is a column family in Cassandra?
Answers: - The Column family in Cassandra is referred for a collection of rows.

What is a cluster in Cassandra?
Answers: - “A Cluster is a container that contains one or more data centres.”
A “Cluster” is a container for the key-spaces and the “Cassandra” database is segmented over multiple machines that are work together.
It is also “Outermost container” which arranges the nodes in a ring format and assigns data to them and these nodes have a replica which used to handling the data in case of failure.

List out the other components of Cassandra?
Answers: - The COLLECTIONS list of the other components is,
1.      Cluster
2.      Node
3.      SSTable
4.      Mem-table
5.      Data Centre
6.      Commit log
7.      Bloom Filter
8.      And so on..

What do you understand by Cluster in Cassandra?
Answers: - “A Cluster is a container that contains one or more data centres.”
A “Cluster” is a container for the key-spaces and the “Cassandra” database is segmented over multiple machines that are work together.

What do you mean by “Data Centre” in Cassandra?
Answers: - The Cassandra “Data centre” is a collection of nodes and these nodes have a replica which used to handling the data in case of failure.

What is a keyspace in Cassandra?
Answers: - A Cassandra keyspace is a namespace which used to determine the data replication on nodes and the “cluster” lies of one keyspace per node.

What is the syntax to create keyspace in Cassandra?
Answers: - The keyspace is a namespace which used to determine the data replication on nodes.

Syntax: -  CREATE KEYSPACE <identifier> WITH <properties>

What are the values stored in the Cassandra Column?
Answers: - In Cassandra, basically used 3(three) values that is
1.      Column Name
2.      Value
3.      Time Stamp

When you can use Alter keyspace?
Answers: - The “ALTER KEYSPACE” is used to change the properties like “number of replicas” and “durable write” of a keyspace.

What is Cassandra Cqlsh?
Answers: - The “Cassandra Cqlsh” is a query language which used to enables the users to communicate with database.

For this, we can do following things that is
1.      Define a Schema
2.      Insert a Data and
3.      Execute a Query

What is mandatory while creating a table in Cassandra?
Answers: - In the Cassandra database, the “primary key” is mandatory key while we creating a table and we can create one or more columns of a table.

What we need to be taken care while adding a Column?
Answers: - In the Cassandra database, while adding a new column you must need and follow the below points,
1.      The “Column name” is not conflicting with an “existing column” names and
2.      The “Table” is not defined with compact storage option.

Elaborate on Cassandra - CQL?
Answers: - In Cassandra database, the “CQL” collections are helping us to store multiple values in a single variable.

The CQL collections are
1)     List: - It’s used for maintained the data order and stored values multiple times.
2)     SET: - It’s used for store and returned to sorted orders.
3)     MAP: - It’s a data type and used to store a key value pair of elements.

How Cassandra writes data?
Answers: - The Cassandra writes the data in 3 components that is,
1.      Commit-log Write
2.      Memtable Write
3.      SStable Write

What is Memtable in Cassandra?
Answers: - The “Cassandra” writes the data to in-memory structure that is known as Memtable.

1.      It is an in-memory cache with the content stored as the key column.
2.      By the “key”, Memtable data are sorted.
3.      Each and every column contains a separates Memtable and also is used to retrieves column data from the key.

How Cassandra writes changed data into Commit-log?
Answers: - The following ways as,
1.      The Cassandra concatenates (write operations) changed data to commit-log.
2.      The commit-log acts as a “crash recovery log” for the data.
3.      The “commit-log” writes operation will be never considered successful.

What is the use of “void close ()” method?
Answers: - This “void close()” method is used to close the current instance of the session.

What is the Replication Factor?
Answers: - The “Replication Factor” is a unit of the “number of existing data copies”. It’s an essential to increase the replication factor to log into cluster.

What is the use of “ResultSet execute” method?
Answers: - This “ResultSet execute()”method is used to execute a query and It requires a statement object also.

How Cassandra delete Data?
Answers: - The “SSTables” are immutable. So we can’t remove a row from SSTables.

When a row needs to be deleted, the “Cassandra” assigns the column value with a special value called “Tombstone” and when the data is read, “Tombstone” value is considered as “deleted”.

So we can say that cannot delete data from the Cassandra database.

Stayed Informed - Apache Cassandra vs. Mongodb

I hope you are enjoying with this post! Please share with you friends. Thank you!!
By Anil Singh | Rating of this article (*****)

Popular posts from this blog

39 Best Object Oriented JavaScript Interview Questions and Answers

Most Popular 37 Key Questions for JavaScript Interviews. What is Object in JavaScript? What is the Prototype object in JavaScript and how it is used? What is "this"? What is its value? Explain why "self" is needed instead of "this". What is a Closure and why are they so useful to us? Explain how to write class methods vs. instance methods. Can you explain the difference between == and ===? Can you explain the difference between call and apply? Explain why Asynchronous code is important in JavaScript? Can you please tell me a story about JavaScript performance problems? Tell me your JavaScript Naming Convention? How do you define a class and its constructor? What is Hoisted in JavaScript? What is function overloadin...

25 Best Vue.js 2 Interview Questions and Answers

What Is Vue.js? The Vue.js is a progressive JavaScript framework and used to building the interactive user interfaces and also it’s focused on the view layer only (front end). The Vue.js is easy to integrate with other libraries and others existing projects. Vue.js is very popular for Single Page Applications developments. The Vue.js is lighter, smaller in size and so faster. It also supports the MVVM ( Model-View-ViewModel ) pattern. The Vue.js is supporting to multiple Components and libraries like - ü   Tables and data grids ü   Notifications ü   Loader ü   Calendar ü   Display time, date and age ü   Progress Bar ü   Tooltip ü   Overlay ü   Icons ü   Menu ü   Charts ü   Map ü   Pdf viewer ü   And so on The Vue.js was developed by “ Evan You ”, an Ex Google software engineer. The latest version is Vue.js 2. The Vue.js 2 is very similar to Angular because Evan ...

iOS Interview Questions and Answers – iOS 10, 11, 12, 13, 14

What Is iOS? The iOS is a mobile operating system created and developed by Apple Inc . The iOS runs on the iPhone, iPad, iPod Touch and Apple TV and the Initial release of iOS is 29 June 2007. The iOS is written in C++, Objective-C, Swift and the default user interface is Cocoa Touch . What does iOS stand for? The iOS stands for iPhone Operating System , or just “i” + Operating System. What does iOS mean? Basically, iOS is a truncated way of saying ‘iPhone OS’, or ‘iPhone Operating System’. How do I download new iOS apps? You can download apps onto any iOS device from Apple’s App Store. Is iOS is an Operating system? Yes! It is operating system.   How do I update my iPhone or iPad to the latest version of iOS? Your Apple device should automatically detect when an iOS update is available to download and inform you with a pop-up message. Is multitasking function is supported by the iOS? Yes! The iOS supported multitasking. Which JSON ...

55 Best TypeScript Interview Questions and Answers - JavaScript!

What Is TypeScript? By definition, "TypeScript is a typed superset of JavaScript that compiles to plain JavaScript." TypeScript is a superset of JavaScript which provides optional static typing, classes and interfaces. => The TypeScript was first made public in the year 2012. => Typescript is a modern age JavaScript development language. => TypeScript is a strongly typed, object oriented, compiled language. => TypeScript was designed by Anders Hejlsberg (designer of C#) at Microsoft. => TypeScript is both a language and a set of tools. As an Example of TypeScript, class Hello {     msg : string ;      constructor ( message : string ) {          this . msg = message ;      }       getMsg () {          return "Hello, " + this . msg ;      } } TypeScript introduced a great deal...

.NET Core MVC Interview Questions and Answers

» OOPs Interview Questions Object Oriented Programming (OOP) is a technique to think a real-world in terms of objects. This is essentially a design philosophy that uses a different set of programming languages such as C#... Posted In .NET » .Net Constructor Interview Questions A class constructor is a special member function of a class that is executed whenever we create new objects of that class. When a class or struct is created, its constructor is called. A constructor has exactly the same name as that of class and it does not have any return type… Posted In .NET » .NET Delegates Interview Questions Delegates are used to define callback methods and implement event handling, and they are declared using the "delegate" keyword. A delegate in C# is similar to function pointers of C++, but C# delegates are type safe… Posted In .NET » ASP.Net C# Interview Questions C# was developed by Microsoft and is used in essentially all of their products. It is mainly used for ...