Debug School

Akanksha
Akanksha

Posted on

Top 30 Cassandra Interview Questions with Answers

1. What is Cassandra?

A. A relational database
B. A NoSQL database
C. A key-value store
D. A file storage system
Answer: B. A NoSQL database

2. Which organization originally developed Cassandra?

A. Apache Software Foundation
B. Google
C. Facebook
D. Microsoft
Answer: C. Facebook

3. Cassandra is known for its ability to handle:

A. ACID transactions
B. Complex joins
C. High write throughput
D. In-memory processing
Answer: C. High write throughput

4. Which query language is used in Cassandra?

A. SQL
B. CQL (Cassandra Query Language)
C. NoSQL
D. PL/SQL
Answer: B. CQL (Cassandra Query Language)

5. What is a Cassandra cluster?

A. A collection of related tables
B. A group of connected nodes
C. A data center
D. A schema in Cassandra
Answer: B. A group of connected nodes

6. Cassandra uses a peer-to-peer architecture for distributed data storage. (True/False)

Answer: True

7. Which data model is used by Cassandra?

A. Relational
B. Document
C. Key-Value
D. Column-family
Answer: D. Column-family

8. What is the default consistency level in Cassandra?

A. ONE
B. ALL
C. LOCAL_QUORUM
D. LOCAL_ONE
Answer: A. ONE

9. Which is NOT a component of Cassandra's architecture?

A. Node
B. Shard
C. Commit Log
D. MemTable
Answer: B. Shard

10. What is a SSTable in Cassandra?

A. A storage engine
B. A secondary index
C. An in-memory table
D. An immutable on-disk data file
Answer: D. An immutable on-disk data file

11. Which consistency level is recommended for most read and write operations in Cassandra?

A. ONE
B. QUORUM
C. ALL
D. LOCAL_ONE
Answer: B. QUORUM

12. Which tool is used for monitoring and managing a Cassandra cluster?

A. CassandraCLI
B. cqlsh
C. nodetool
D. cassandra-admin
Answer: C. nodetool

13. Which data model is suitable for time-series data in Cassandra?

A. Column-family
B. Key-Value
C. Document
D. Relational
Answer: A. Column-family

14. What is the purpose of compaction in Cassandra?

A. To improve write performance
B. To improve read performance
C. To reclaim disk space
D. To manage data distribution
Answer: C. To reclaim disk space

15. What does the replication factor control in Cassandra?

A. The number of columns in a table
B. The number of nodes in the cluster
C. The number of data centers
D. The number of copies of data across nodes
Answer: D. The number of copies of data across nodes

16. Which data type in Cassandra is used to represent a time or date?

A. timestamp
B. date
C. time
D. datetime
Answer: A. timestamp

17. What is a composite key in Cassandra?

A. A key made up of multiple columns
B. A primary key with only one column
C. A key for indexing data
D. A hidden key used for internal operations
Answer: A. A key made up of multiple columns

18. Which consistency level ensures that data is consistent across all replicas before a read is returned?

A. ONE
B. LOCAL_QUORUM
C. SERIAL
D. ALL
Answer: D. ALL

19. What is a snitch in Cassandra?

A. A tool for repairing data
B. A network security feature
C. A gossip protocol
D. A component for determining node locations and network topology
Answer: D. A component for determining node locations and network topology

20. Which of the following is NOT a common compaction strategy in Cassandra?

A. SizeTieredCompactionStrategy
B. DateTieredCompactionStrategy
C. TimeWindowCompactionStrategy
D. RangeCompactionStrategy
Answer: D. RangeCompactionStrategy

21. Which consistency level in Cassandra ensures that at least one replica has acknowledged a write operation?

A. ONE
B. QUORUM
C. LOCAL_ONE
D. ALL
Answer: A. ONE

22. What is the purpose of the gossip protocol in Cassandra?

A. To exchange cluster state information
B. To compress data
C. To create secondary indexes
D. To perform read operations
Answer: A. To exchange cluster state information

23. Which of the following is NOT a valid compaction strategy in Cassandra?

A. DateTieredCompactionStrategy
B. SizeTieredCompactionStrategy
C. RangeCompactionStrategy
D. KeyTieredCompactionStrategy
Answer: D. KeyTieredCompactionStrategy

24. What is the purpose of the commit log in Cassandra?

A. To record schema changes
B. To maintain data consistency
C. To log write operations
D. To create secondary indexes
Answer: C. To log write operations

25. Which replication strategy in Cassandra is suitable for multiple data centers?

A. SimpleStrategy
B. NetworkTopologyStrategy
C. LocalStrategy
D. ReplicationFactorStrategy
Answer: B. NetworkTopologyStrategy

26. Which statement is true regarding Cassandra's support for joins?

A. Cassandra supports complex joins like SQL databases.
B. Cassandra does not support joins.
C. Cassandra supports joins only in CQL.
D. Cassandra supports joins using the JOIN keyword.
Answer: B. Cassandra does not support joins.

27. What is the purpose of the nodetool repair command in Cassandra?

A. To repair hardware failures
B. To repair data inconsistencies between nodes
C. To repair query performance issues
D. To repair the commit log
Answer: B. To repair data inconsistencies between nodes

28. Which of the following statements about data modeling in Cassandra is true?

A. You should create a table for each query you want to perform.
B. Denormalization is discouraged in Cassandra.
C. Complex relationships between data can be easily represented.
D. Cassandra supports a fixed schema.
Answer: A. You should create a table for each query you want to perform.

29. What does the COMPACT STORAGE option do in Cassandra?

A. Enables compression for SSTables.
B. Compacts the commit log.
C. Enables read repair.
D. Reduces the storage overhead for wide rows.
Answer: D. Reduces the storage overhead for wide rows.

30. What is a counter column in Cassandra used for?

A. Counting the number of nodes in a cluster.
B. Counting the number of rows in a table.
C. Counting the number of columns in a table.
D. Counting events or occurrences.
Answer: D. Count events or occurrences.

Top comments (0)