An Apache Cassandra interview should test how a candidate reasons about distributed data, not how many database slogans they can repeat. Cassandra is a distributed wide-column database designed for applications that need to spread data and traffic across many nodes and remain available under defined failures. It offers configurable replication and consistency, but those choices involve trade-offs. The questions below use an original example of a multi-region device-event service so that each answer explains a design decision and what evidence would verify it.
As of November 2026, Apache Cassandra 5.0 is the project’s latest generally available major line, with 5.0.9 listed by Apache as the latest maintenance release. An interviewer should confirm the deployed version and topology before asking for version-sensitive details. These are original practice interview questions, not confidential certification exam items or claims about what a particular employer will ask.
Cassandra architecture and distributed responsibilities
1. What problem is Cassandra designed to solve, and when might it be a poor fit?
Cassandra is appropriate when data can be modeled around known access patterns, the workload benefits from horizontal partitioning and replication, and the application can accept explicit consistency choices. For example, a device telemetry system may ingest large volumes of time-ordered events while serving predictable queries by device and time window. It may be a poor fit for a small transactional application requiring arbitrary joins, strong multi-table relational constraints or frequent ad hoc reporting. The decision depends on data access, operational capacity and failure requirements, not a declaration that NoSQL is always faster than SQL.
2. What are a node, cluster, datacenter, keyspace and coordinator?
A node is a Cassandra server instance. A cluster is a cooperating group of nodes, and a datacenter is a logical grouping used for placement and locality, often aligned with operational failure boundaries. A keyspace defines replication behavior and groups tables. For each client request, a coordinator node receives the operation and communicates with the replicas responsible for the partition; it does not need to be the permanent owner of that partition. An interviewer may ask how a chosen coordinator affects latency and how driver awareness of datacenters helps avoid unnecessary cross-region traffic.
3. Does Cassandra have a single master or a guaranteed absence of failures?
Cassandra does not use a traditional primary database server for all ordinary requests. Multiple nodes can coordinate work, and data are replicated according to configured placement. That removes one category of central write bottleneck, but it does not make an application invulnerable to outages. Insufficient replicas, misconfigured topology, unavailable networks, exhausted storage or incorrectly selected consistency levels can still make requests fail. A strong answer explains which failures the topology tolerates at the requested consistency level and how the application will detect degraded operation.
Primary keys, partitions and query-driven data modeling
4. How do partition and clustering keys affect a query?
The partition key determines the token used to place a partition’s data on replica nodes, while clustering columns order and distinguish rows within a partition. Consider events queried by one device during a recent date range. A key such as (device_id, event_day) can bound partition size, and event_time can be a clustering column within that partition. This design works for that query, but not automatically for a query that finds every device with a particular error code across all time. Cassandra data modeling starts with the required queries and the partitions they should touch.
5. What makes a partition key good or bad?
A useful key distributes load while allowing expected requests to read a bounded number of partitions. A key using only one busy tenant could concentrate writes and produce an oversized, hot partition; a key that changes for every individual event may spread writes but make a device’s history difficult to retrieve efficiently. Interviewers should ask about row count per partition, event size, retention, skew and frequency of access. The appropriate bucket width or key components follow measured workload characteristics rather than one universal partition-size rule.
6. Why can deliberate denormalization be useful in Cassandra?
Because Cassandra is designed for query-driven tables rather than general relational joins, a service may maintain separate tables for events_by_device_day and recent_events_by_region if both views are truly required. This duplicates information and increases write work, so the application must manage updates, retention and possible inconsistencies between those views. Contrast this with PostgreSQL’s relational constraints and joins, which support a different modeling style. Denormalization is an informed trade-off, not permission to store unbounded copies without ownership or lifecycle rules.
CQL, conditional updates and practical query limitations
7. Is Cassandra Query Language the same as SQL?
CQL uses familiar-looking syntax for creating keyspaces and tables, inserting rows and selecting data. However, it does not supply the same general join, foreign-key and arbitrary grouping model expected from a relational SQL engine. An interviewer should ask whether a proposed SELECT is supported efficiently by the primary-key design and whether the WHERE clause restricts the expected partitions. A query that depends on broad filtering or scanning many partitions can be inappropriate even if it looks like a simple SQL report.
8. What are lightweight transactions, and when should they be used?
Cassandra supports conditional statements such as INSERT … IF NOT EXISTS through lightweight transactions (LWT), using a consensus protocol to coordinate the conditional decision. They can be useful for a uniqueness or compare-and-set requirement, but incur different latency and coordination costs than ordinary writes. A good response identifies the actual invariant, explains why a condition is necessary and considers whether the application’s data model could avoid the operation. LWT does not turn Cassandra into a general-purpose relational multi-row transaction system.
9. How would you review a CQL query that is unexpectedly slow?
Start with the table’s primary key and the query’s filter, rather than adding indexes immediately. Determine how many partitions are read, whether a broad partition is involved, and whether the data are ordered by the intended clustering columns. Inspect request latency, coordinator and replica health, compaction pressure and read patterns using approved monitoring. An index can be appropriate for selected workloads, including newer Cassandra indexing capabilities, but its benefit depends on the actual predicate, cardinality and operational cost. Changing the query or schema may be more effective than forcing an index.
Replication and tunable consistency
10. What does replication factor mean?
Replication factor describes how many copies of each partition Cassandra places within the configured topology. With NetworkTopologyStrategy it can be defined per datacenter. For a keyspace with replication factor three in one datacenter, three replicas are assigned to a token’s data in that datacenter, subject to the topology and node placement rules. This does not mean that any three failing nodes are automatically harmless: which replicas fail and which consistency level a request requires will determine success. Replication is for availability and resilience; it is not a historical backup.
11. How do ONE, QUORUM, LOCAL_QUORUM and ALL differ?
A consistency level defines the replica acknowledgments required for an operation. ONE typically requires one responding replica; ALL requires all replicas involved; QUORUM requires a majority of the replicas for the applicable replication scope. LOCAL_QUORUM requires a majority in the coordinator’s local datacenter for an appropriately configured multi-datacenter keyspace. For replication factor three within that local scope, LOCAL_QUORUM needs two local replicas. A strong answer states the assumed topology and explains the latency and availability consequences rather than labeling one setting universally correct.
12. Does choosing quorum guarantee every possible application invariant?
For some read/write combinations, an overlapping replica set supports useful visibility guarantees under the assumed replication and failure conditions. It does not automatically solve every race, cross-partition invariant, client retry or concurrent update scenario. Cassandra uses timestamp-based reconciliation for ordinary replicated writes and has special semantics for conditional operations. An interviewer should ask about timeouts, idempotency, clock behavior, retry policies and the exact consistency required by the business operation. The correct guarantee must be tied to a concrete request pattern, not merely the phrase “eventual consistency.”
Write paths, SSTables, compaction and tombstones
13. What happens during a typical Cassandra write?
The client sends a mutation to a coordinator, which forwards it to the replicas selected by placement and the requested consistency. A replica records the change in the commit log and updates an in-memory memtable; the memtable is later flushed to immutable SSTables on disk. A successful acknowledgment depends on the configured write path and consistency level. A complete answer should also consider what happens when a replica is unavailable and how the cluster later reconciles missed updates.
14. What are SSTables and why is compaction necessary?
SSTables are immutable files used for persisted data. New values and deletions can leave multiple SSTable versions that must be reconciled during reads. Compaction combines files, reduces fragmentation and helps reclaim data that are eligible for removal, subject to strategy and safety conditions. Different compaction strategies produce different write-amplification, read-amplification and space trade-offs. An interviewer may ask for operational evidence—SSTable counts, disk utilization, pending compactions and read latency—before accepting a proposal to change strategy.
15. What is a tombstone and why can TTL cause operational problems?
A tombstone represents a deletion or expiration that replicas must observe so an older value is not accidentally revived. TTL expiration can produce tombstones, and broad reads over tombstone-heavy data may be expensive. The gc_grace_seconds setting interacts with repair and deletion safety; reducing it without proving that replicas are synchronized can risk resurrecting previously deleted values. A responsible answer distinguishes logical deletion from immediate physical removal, explains regular repair requirements and uses representative load measurements before tuning retention.
Failures, repair, observability and security
16. Are hinted handoff and read repair substitutes for scheduled anti-entropy repair?
No. Hints are best-effort records of writes a temporarily unavailable replica missed, and read repair can resolve inconsistencies encountered on reads. Neither guarantees that all divergent replicas will eventually be reconciled under every failure pattern. Cassandra’s anti-entropy repair compares data across replicas and synchronizes differences. Operators must plan repair scope and frequency based on workload, retention and cluster condition; repair can consume significant disk, network and CPU resources. It should not be treated as a free background checkbox.
17. What would you monitor before a cluster incident becomes a severe outage?
Monitor read and write latency, timeouts, unavailable requests, node status, disk space, pending compactions, repair health, dropped messages, garbage collection and client retry patterns. A single high CPU reading does not establish the root cause. Compare symptoms by node, datacenter and partition or table where possible, then examine the time sequence of deployments, configuration changes and load spikes. Approved tools such as nodetool and application metrics can help, but operational commands should follow a documented playbook rather than be executed impulsively during production incidents.
18. How do replication, backup and security controls differ?
Replication keeps data available across assigned replicas; it can also propagate an accidental delete. A backup provides recoverable historical state, but only a tested restoration demonstrates that recovery is practical. Cassandra snapshots, backup storage and retention must be designed around a documented recovery point and recovery time objective. Security adds separate boundaries: authenticate clients and nodes appropriately, encrypt data in transit where required, restrict network access and use roles with narrowly scoped privileges. A replicated cluster without verified recovery and least privilege is not a complete reliability design.
Scenario interview: demonstrate trade-offs, not memorized definitions
19. Design Cassandra storage for device events retained for ninety days.
Start by defining the actual queries: most recent events for one device, events for a selected day, and perhaps a regional alert summary. For the device query, use a bounded partition such as device identifier plus day and clustering by event time; choose bucket granularity based on expected event rate and partition growth. Define the replication strategy for the required datacenters and select consistency levels according to the application’s tolerance for delay or unavailability. Use a test workload to check read latency, partition distribution and retention effects. If regional summaries are required, evaluate a separate query-specific table or downstream analytical system rather than promising that Cassandra will efficiently scan every raw event for an arbitrary report.
20. A replica goes offline during writes and returns later. How should the team respond?
First establish which datacenter and replica sets are affected, which consistency levels clients requested and whether the observed writes were acknowledged. Returning a node to service does not prove it contains every update it missed. Hints may reduce divergence, but planned repair and monitoring remain necessary. Avoid running an unrestricted cluster-wide repair without checking operational cost and the correct procedure for the deployment. Verify data convergence with a bounded, authorized sample and document timeouts, failed client operations and any unresolved recovery work. A strong candidate explains what can be established from evidence rather than claiming zero data loss automatically.
For practice, use a disposable Cassandra cluster with synthetic events and write a short answer to each question including assumptions, trade-offs and the observation that would verify the claim. The strongest interview response is not the longest definition: it connects data modeling, replica behavior, operational safety and the application’s actual workload. These twenty original questions can help structure that reasoning without reproducing proprietary interview banks or confidential exam content.