← Back to list

Interview questions on Cassandra for Developers

1. What is NoSQL?

Nitish Prabhu · 2018-06-09 14:35 · 1 claps · 3.8 min read
#cassandra #nosql #interview-questions #cassandra-interview #cassandra-developers
Open on Medium ↗

Interview questions on Cassandra for Developers

1. What is NoSQL?

NoSQL databases are highly flexible & scalable database management systems which allow to store and process unstructured as well as semi-structured data which is not possible through RDBMS tools.

2. What are the types of NoSQL Database?

  • Document DataBases: Pair each key with a complex data structure known as a document. Documents can contain many different key-value pairs, or key-array pairs, or even nested documents such as MongoDB.
  • Graph DataBases: Used to store information about networks of data, such as social connections. Graph stores include Neo4J and Giraph.
  • Key-value DataBases: Every single item in the database is stored as an attribute name (or ‘key’), together with its value such as Redis.
  • Wide-column DataBases: Such as Cassandra and HBase are optimized for queries over large datasets, and store columns of data together, instead of rows.

3. What are the limitations of SQL?

  • Scalability: Needs to distribute on multiple servers which will be difficult to handle.
  • Complexity: Data needs to be fit into the already designed table; if not, needs to design structure which is complex.

4. What are the benefits of NoSql?

  • Highly Scalable: NoSQL databases are designed to expand horizontally which requires adding one more machine into the pool of resource for scaling.
  • Maintaining server is less expensive: It supports the feature like automatic repair, easier data distribution.
  • Lesser Server Cost
  • Integrated Caching

5. Why Cassandra?

Because it provides continuous availability, linear scalability and operational simplicity across many commodity servers with no single point of failure.

6. What are the features of Cassandra?

  • Scalable architecture: Cassandra provides Masterless design which treats all nodes are same which results in no single point of failure.
  • Multiple data centre replication: It provides support for replication across multiple data centres for writes/reads.
  • Linear scale performance: Performance can be enhanced by adding new nodes without any downtime/application interruption.
  • Data Compression: Data can be compressed up to 80% without performance expenses.

7. What is CQL?

CQL — Cassandra Query Langauge is a way of interacting with Cassandra. CQL does not support joins/sub-queries.

8. How to copy Cassandra data to file & vice-versa?

  • To copy data from Cassandra to File:
  • To copy data from File to Cassandra

9. What is CAP Theorem?

CAP stands for Consistency, Availability & Partition tolerance. It is impossible for a distributed system to simultaneously provide CAP guarantees.

10. What are the significance of CAP?

  • Consistency: Data is updated among all nodes at the same time. i.e DATA is same among all the nodes.
  • Availability: A guarantee for every request acknowledge a response whether it is a success or not.
  • Partition Tolerance: A system continues to operate despite of system failure.

11. Where does Cassandra stand with CAP theorem?

Cassandra supports Availability & Partition tolerance considerd to be more important. Regarding consistency, Cassandra extends the concept of eventual consistency by offering tunable consistency for any given read or write operation.

12. What is column-oriented data model?

A columnar database is a database management system (DBMS) that stores data in columns instead of rows. pros: Efficiently write/read data to/from disk storage, could become really fast.

13. How Cassandra writes Data?

When data is written to Cassandra, data will be logged to commit log and stores data to a write-back cache called memtable. Once it reaches a configurable limit, data will be flushed stored into SSTables in sorted order.

14. How Cassandra reads Data?

  • When a read request comes, Cassandra checks memtable. If memtable has data, then data will be merged with data from SSTable.
  • Bloom filters check partition key cache if enabled. Otherwise, it goes directly to the compression offset map if a partition key is found in the partition key cache, or checks the partition summary if not;
  • If the partition summary is checked, then the partition index is accessed. Later locates the data on disk using the compression offset map & fetches the data from the SSTable on disk.

15. What is bloom filters?

A structure stored in memory that checks if row data exists in the memtable before accessing SSTables on disk.

16. How Cassandra maintains data?

  • The Cassandra write process stores data in files called SSTables and SSTables are immutable.
  • Instead of overwriting existing rows with inserts or updates, Cassandra writes new timestamped versions of the inserted or updated data in new SSTables.
  • Cassandra does not perform deletes by removing the deleted data: instead, Cassandra marks it with tombstones.

17. What is compaction?

  • To keep the database healthy, Cassandra periodically merges SSTables and discards old data and this process is called compaction.
  • Because Cassandra may write many versions of a row in different SSTables. Each version may have a unique set of columns stored with a different timestamp.

18. What is upsert?

A change in the database that updates a specified column in a row if the column exists or inserts the column if it does not exist.

19. How Cassandra deletes data?

When a delete request comes, the data being added to the partition in the DELETE command will be marked as a tombstone (deletion marker). During compaction, marked columns will be deleted.

20. What is tombstone?

A marker in a row that indicates a column was deleted. During compaction, marked columns are deleted.

21. What is Keyspace?

A keyspace in Cassandra is a namespace that defines data replication on nodes. A cluster contains one keyspace per node.

22. What is partition key, clustering key, Primary key ?

  • Partition Key: The hash value of Partition key is used to determine the specific node in a cluster to store the data.
  • Primary Key: It is composed of partition keys.(and clustering keys)
  • Clustering Key: It is used to sort the data in each of the partitions.

23. How to flush tables from memtable? By using nodetool as follows. nodetool flush {key-space} [table-name]

24. What is nodetool?

The nodetool utility is a command line interface for managing a cluster.


메타데이터
post_id
e4ebddcfa40d
slug
interview-questions-on-cassandra-for-developers-e4ebddcfa40d
url
https://medium.com/@cosmicconvallis/interview-questions-on-cassandra-for-developers-e4ebddcfa40d
canonical_url
https://medium.com/@cosmicconvallis/interview-questions-on-cassandra-for-developers-e4ebddcfa40d
author_url
https://medium.com/@cosmicconvallis
status
ok
fetched_at
2026-07-26 23:43:52