Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.
CQL is Cassandra's query language for defining schemas and reading or modifying data.
Question 13 of 60 · CQL data types · Easy
Which CQL data type is commonly used to store a character string?
Not quite. Try another option.
Answer: text
The text data type stores UTF-8 character strings.
Question 14 of 60 · Creating keyspaces and tables · Easy
Which CQL statement creates a new table?
Not quite. Try another option.
Answer: CREATE TABLE
CREATE TABLE defines a table, its columns, and its primary key.
Question 15 of 60 · Insert operations · Easy
Which CQL command adds a row to a Cassandra table?
Not quite. Try another option.
Answer: INSERT INTO
INSERT INTO writes column values to a Cassandra table and can also replace existing values with the same primary key.
Question 16 of 60 · Update operations · Easy
Which clause identifies the row to modify in a CQL UPDATE statement?
Not quite. Try another option.
Answer: WHERE
The WHERE clause specifies the primary-key values of the row that should be updated.
Question 17 of 60 · Delete operations · Easy
What does Cassandra initially create when data is deleted?
Not quite. Try another option.
Answer: A tombstone marker
Cassandra records a tombstone to mark deleted data, which can later be removed during compaction.
Question 18 of 60 · Select operations · Easy
Which CQL statement retrieves rows from a table?
Not quite. Try another option.
Answer: SELECT
SELECT retrieves specified columns and rows from a Cassandra table.
Question 19 of 60 · Filtering · Easy
Which CQL phrase permits a query that may require server-side filtering?
Not quite. Try another option.
Answer: ALLOW FILTERING
ALLOW FILTERING permits certain queries that Cassandra would otherwise reject because they may scan substantial data.
Question 20 of 60 · Compaction · Easy
What is the main purpose of compaction in Cassandra?
Not quite. Try another option.
Answer: Merging SSTables on disk
Compaction combines SSTables, removes obsolete data, and can discard eligible tombstones.
Question 21 of 60 · Installation of Apache Cassandra · Medium
After installing Cassandra on a single server, cqlsh reports Connection refused on port 9042. What should an administrator check first?
Not quite. Try another option.
Answer: Verify that Cassandra is running and inspect system.log for startup errors
Port 9042 is used by Cassandra's native transport. A stopped process or startup/configuration error should be investigated before performing cluster operations.
Question 22 of 60 · Cassandra Architecture · Medium
A client sends a write request to a Cassandra node that is not a replica for the target partition. What does that node normally do?
Not quite. Try another option.
Answer: It acts as coordinator and forwards the write to the appropriate replicas
Any Cassandra node can act as the coordinator. It identifies the replicas, forwards the operation, and waits for acknowledgments required by the consistency level.
Question 23 of 60 · Peer-to-peer architecture · Medium
A Cassandra cluster receives more traffic, so two nodes are added. Which behavior best reflects Cassandra's peer-to-peer architecture?
Not quite. Try another option.
Answer: Token ownership is redistributed, and relevant data is streamed to the new nodes
Cassandra has no master node. New peers receive token ranges and stream the data needed to assume responsibility for those ranges.
Question 24 of 60 · Gossip protocol · Medium
Node A has outdated information about whether Node C is reachable. How is this information normally corrected in Cassandra?
Not quite. Try another option.
Answer: Nodes periodically exchange endpoint state and generation information through gossip
Gossip distributes node state and topology information. Cassandra's failure detector uses this exchanged state to estimate whether peers are reachable.
Question 25 of 60 · Replication and consistency levels · Medium
A keyspace has a replication factor of . A write uses consistency level QUORUM, and one replica is unavailable. What is the expected result if the other two replicas acknowledge the write?
Not quite. Try another option.
Answer: The write succeeds because QUORUM requires two replica acknowledgments
For replication factor , quorum is . Therefore, one unavailable replica can be tolerated.
Question 26 of 60 · Read and write paths · Medium
A write is acknowledged before its data appears in an SSTable. Which explanation is correct?
Not quite. Try another option.
Answer: The write was recorded in the commit log and memtable before acknowledgment
Cassandra first appends a write to the commit log and updates the memtable. The memtable is flushed to an SSTable later.
Question 27 of 60 · Read and write paths · Medium
A requested partition may have values in a memtable and several SSTables. How does a replica produce the current result?
Not quite. Try another option.
Answer: It merges relevant versions and reconciles timestamps and tombstones
The read path may consult memtables and multiple SSTables. Cassandra reconciles versions using timestamps while respecting tombstones.
Question 28 of 60 · Keyspace · Medium
A production cluster has data centers named dc1 and dc2. It needs three replicas in dc1 and two in dc2. Which keyspace definition is appropriate?
Not quite. Try another option.
Answer: CREATE KEYSPACE app WITH replication = {'class':'NetworkTopologyStrategy','dc1':'3','dc2':'2'};
NetworkTopologyStrategy allows a separate replication factor to be configured for each data center.
Question 29 of 60 · Primary key · Medium
A readings table is queried by device_id and day, followed by a time range on recorded_at. Which primary key best supports this access pattern?
device_id and day form a composite partition key, while recorded_at is a clustering column that supports ordered range queries.
Question 30 of 60 · Partition key · Medium
An orders table uses country as its partition key, but almost all orders come from two countries. What is the most likely problem?
Not quite. Try another option.
Answer: A few partitions and nodes will receive a disproportionate amount of traffic
A low-cardinality, uneven partition key can create hot partitions and poor load distribution. A higher-cardinality key or bucketing strategy is preferable.
Question 31 of 60 · Clustering columns · Medium
A table has PRIMARY KEY ((sensor_id), recorded_at). Which clause stores rows within each sensor partition in descending timestamp order?
Not quite. Try another option.
Answer: WITH CLUSTERING ORDER BY (recorded_at DESC)
Clustering columns determine row order inside a partition. CLUSTERING ORDER BY configures ascending or descending storage order.
Question 32 of 60 · Wide rows · Medium
A time-series table stores all events for a customer in one partition, causing some partitions to grow continuously. Which redesign is most appropriate?
Not quite. Try another option.
Answer: Add a time bucket such as month to the composite partition key
Time bucketing bounds partition size while preserving efficient customer-and-time-range queries, reducing the risks of extremely wide partitions.
Question 33 of 60 · Select operations · Medium
A table has PRIMARY KEY ((store_id), sale_date, sale_id). Which query follows the primary-key order and efficiently retrieves sales for one store over a date range?
Not quite. Try another option.
Answer: SELECT * FROM sales WHERE store_id=? AND sale_date>=? AND sale_date<=?;
The query specifies the complete partition key and applies a range condition to the first clustering column, matching Cassandra's efficient query pattern.
Question 34 of 60 · CQL data types · Medium
An application needs identifiers that are unique and also contain timestamp information so events can be ordered by generation time. Which CQL data type is most suitable?
Not quite. Try another option.
Answer: timeuuid
timeuuid stores a version-1 UUID containing time information. It supports uniqueness and chronological ordering through CQL functions.
Question 35 of 60 · Creating keyspaces and tables · Medium
An application must retrieve a user directly by a unique email address without using an index or ALLOW FILTERING. Which table definition best supports the query?
Not quite. Try another option.
Answer: CREATE TABLE users_by_email (email text PRIMARY KEY, user_id uuid, name text);
Making email the partition key allows Cassandra to locate the row directly from WHERE email = ?, following query-driven data modeling.
Question 36 of 60 · Insert operations · Medium
A row with primary key id=10 already contains name='Ana' and city='Pune'. What happens after INSERT INTO users (id, name) VALUES (10, 'Anita');?
Not quite. Try another option.
Answer: The name becomes Anita, while the existing city value remains unchanged
Cassandra inserts are upserts. Supplied columns are updated for an existing primary key, while unspecified columns remain unchanged.
Question 37 of 60 · Update operations · Medium
A table is defined with PRIMARY KEY ((account_id), item_id). Which statement correctly updates the quantity of one item?
Not quite. Try another option.
Answer: UPDATE cart SET quantity=4 WHERE account_id=20 AND item_id=7;
An update must identify the row using the complete primary key. Primary-key columns themselves cannot be changed with UPDATE.
Question 38 of 60 · Delete operations · Medium
What normally happens internally when a non-key column is deleted from a Cassandra row?
Not quite. Try another option.
Answer: A tombstone is written and may be removed later during compaction
Cassandra records deletions with tombstones because SSTables are immutable. A tombstone can be purged during a later compaction when it is safe to do so.
Question 39 of 60 · Indexing · Medium
A large production table is frequently queried by a low-cardinality status column, and each status may match millions of rows across the cluster. What is generally the most scalable design?
Not quite. Try another option.
Answer: Create a query-specific table partitioned by status and an additional bucket
Broad index or filtering queries can contact many nodes and return huge result sets. A bucketed, query-specific table provides bounded partitions and predictable access.
Question 40 of 60 · Compaction · Medium
An administrator starts a major compaction and observes a temporary increase in disk usage. What is the most likely explanation?
Not quite. Try another option.
Answer: New SSTables coexist with old SSTables until the compaction completes successfully
Compaction writes merged SSTables before deleting the replaced SSTables. Administrators must therefore ensure sufficient temporary disk space.
Question 41 of 60 · Installation of Apache Cassandra · Hard
A new Cassandra node must join an existing production cluster that uses virtual nodes and NetworkTopologyStrategy. Which configuration is essential before starting the node for the first time?
Not quite. Try another option.
Answer: Use the existing cluster name, reachable seed addresses, a routable listen address, and the cluster's topology-compatible snitch
The node must identify the same cluster, discover peers through reachable seeds, advertise a unique routable address, and report topology consistently. Seeds assist discovery; they do not control token ownership or replication.
Question 42 of 60 · Cassandra Architecture · Hard
A client sends a write at consistency level QUORUM to node N1, but N1 is not a replica for the target partition. What role does N1 perform?
Not quite. Try another option.
Answer: It becomes the coordinator, forwards the mutation to replicas, and waits for the required acknowledgements
Any node can coordinate a request. The coordinator locates replicas from token metadata, sends the mutation, and enforces the requested consistency level without becoming a replica.
Question 43 of 60 · Peer-to-peer architecture · Hard
Which failure scenario most directly demonstrates Cassandra's peer-to-peer design?
Not quite. Try another option.
Answer: A seed node fails after cluster formation, but other nodes continue coordinating reads and writes
Seeds are discovery contacts, not masters. After nodes discover one another, any available node can coordinate requests, so losing a seed does not inherently stop the cluster.
Question 44 of 60 · Gossip protocol · Hard
Node A receives gossip state for node B with an older generation but a larger heartbeat version than the state it already stores. Which state should A treat as newer?
Not quite. Try another option.
Answer: The stored state, because a newer generation takes precedence over heartbeat versions from older generations
A generation identifies a node process incarnation and normally changes on restart. Heartbeat versions are compared within the same generation, so a larger heartbeat from an older generation is still stale.
Question 45 of 60 · Replication and consistency levels · Hard
A keyspace uses NetworkTopologyStrategy with replication factors east: 3 and west: 3. A coordinator in east performs a write. Which acknowledgement requirements are correct?
Not quite. Try another option.
Answer: QUORUM requires 4 acknowledgements overall, while LOCAL_QUORUM requires 2 acknowledgements from east
Global QUORUM is . LOCAL_QUORUM uses only the local replication factor, giving acknowledgements from east.
Question 46 of 60 · Read and write paths · Hard
At a replica, which sequence correctly describes a normal Cassandra write before an acknowledgement is returned?
Not quite. Try another option.
Answer: Append to the commit log, update the memtable, acknowledge, and later flush an immutable SSTable
The commit log provides durability and the memtable holds the in-memory mutation. Memtables are flushed later as immutable SSTables; compaction is not part of the acknowledgement path.
Question 47 of 60 · Read and write paths · Hard
A partition has versions in a memtable and several SSTables, including a row tombstone newer than some stored cells. How is a read result produced?
Not quite. Try another option.
Answer: Relevant sources are merged by timestamps, and the tombstone suppresses cells with older timestamps
Cassandra reconciles data from memtables and relevant SSTables using timestamps and deletion markers. Bloom filters and indexes reduce unnecessary SSTable access, but they do not determine which value wins.
Question 48 of 60 · Cassandra Data Model · Hard
An application must list a customer's orders for one month in descending creation time without joins or server-side filtering. Which modeling approach best follows Cassandra's query-first design?
Not quite. Try another option.
Answer: Create an orders-by-customer-month table partitioned by customer and month, with creation time as a clustering column
Cassandra tables should be shaped around access patterns. The composite partition localizes the requested month, while the clustering column provides storage order without a join or distributed sort.
Question 49 of 60 · Primary key · Hard
Given PRIMARY KEY ((account_id, day), event_time, event_id), which interpretation is correct?
Not quite. Try another option.
Answer: account_id and day form the composite partition key; event_time and event_id are ordered clustering columns
The inner parentheses define the composite partition key. Columns following that group are clustering columns, ordered first by event_time and then by event_id.
Question 50 of 60 · Clustering columns · Hard
For a table with PRIMARY KEY ((tenant_id, bucket), ts, event_id), which query can normally execute without ALLOW FILTERING?
Not quite. Try another option.
Answer: WHERE tenant_id=? AND bucket=? AND ts>=? AND ts<? ORDER BY ts DESC
The complete partition key is restricted, and the first clustering column is queried by a contiguous range. Later clustering columns generally cannot be restricted after a range or without restricting preceding clustering columns.
Question 51 of 60 · Wide rows · Hard
A sensor writes 10,000 measurements per second indefinitely. Why is PRIMARY KEY (sensor_id, measured_at) usually inferior to PRIMARY KEY ((sensor_id, day), measured_at)?
Not quite. Try another option.
Answer: The unbucketed design creates an ever-growing partition, while daily buckets bound partition size at the cost of multi-day fan-out
A Cassandra wide row is a partition containing many clustered rows. Time bucketing limits partition growth and compaction pressure, but queries spanning multiple buckets must issue multiple partition reads.
Question 52 of 60 · CQL data types · Hard
A user-defined type address must be stored as values in a map keyed by timestamp, while allowing individual map entries to be updated. Which CQL type is appropriate?
Not quite. Try another option.
Answer: map<timestamp, frozen<address>>
A UDT used as a collection element must be frozen, while leaving the map itself non-frozen permits updates to individual entries. Freezing the entire map would require replacing it as one value.
Question 53 of 60 · Creating keyspaces and tables · Hard
Which CQL definitions correctly create a two-data-center keyspace and a table whose rows are partitioned by tenant and month?
Not quite. Try another option.
Answer: CREATE KEYSPACE ks WITH replication={'class':'NetworkTopologyStrategy','dc1':3,'dc2':2}; CREATE TABLE ks.events (tenant text, month date, ts timestamp, v text, PRIMARY KEY ((tenant,month),ts));
NetworkTopologyStrategy assigns replication factors per data center. The nested primary-key parentheses make (tenant, month) the partition key and ts the clustering column.
Question 54 of 60 · Insert operations · Hard
A row already contains note='old'. CQL executes INSERT INTO t (id, value) VALUES (1, 'new') USING TIMESTAMP 5000 AND TTL 60. Which statement is correct?
Not quite. Try another option.
Answer: value receives timestamp 5000 and a 60-second TTL, while the omitted note column remains unchanged
CQL INSERT is an upsert. It writes the supplied non-key cells without replacing omitted cells, and the TTL applies to the newly written cells rather than the entire logical row.
Question 55 of 60 · Update operations · Hard
An application executes UPDATE accounts SET balance=900, version=8 WHERE id=42 IF version=7. What distinguishes this operation from a normal update?
Not quite. Try another option.
Answer: It is a lightweight transaction using consensus to apply the mutation only if the condition is current
The IF clause invokes Cassandra's lightweight transaction mechanism. It uses Paxos-style consensus, returns an applied status, and has substantially more coordination cost than a regular update.
Question 56 of 60 · Delete operations · Hard
A cell was written with timestamp 100 and deleted with timestamp 200. Before the tombstone is purged, replicas receive writes for the same cell at timestamps 150 and 250. What is the visible result after reconciliation?
Not quite. Try another option.
Answer: The timestamp-250 value is visible, while the timestamp-150 value remains shadowed by the tombstone
Deletes are timestamped tombstone mutations. The tombstone wins over older data, but a later write with a greater timestamp can supersede it.
Question 57 of 60 · Select operations · Hard
A table uses PRIMARY KEY ((sensor_id, day), ts) and CLUSTERING ORDER BY (ts DESC). A query reads ten sensor partitions for one day and needs at most three newest rows from each partition. Which clause expresses that requirement?
Not quite. Try another option.
Answer: PER PARTITION LIMIT 3
PER PARTITION LIMIT 3 caps results independently for each physical partition. A plain LIMIT caps the result set as a whole and does not guarantee three rows from every partition.
Question 58 of 60 · Filtering · Hard
A large table is partitioned by user_id, but an analyst repeatedly queries WHERE country=? AND status=? ALLOW FILTERING. Which assessment is most accurate?
Not quite. Try another option.
Answer: ALLOW FILTERING permits potentially large scans; a query-specific table is usually more predictable than relying on filtering or a broad index
ALLOW FILTERING authorizes Cassandra to perform work that may scale with scanned data rather than returned rows. Secondary indexes can also fan out or perform poorly for unsuitable cardinality, so denormalized query tables are often safer.
Question 59 of 60 · Cassandra Administration · Hard
A replica has been offline longer than gc_grace_seconds, and healthy replicas may already have compacted away tombstones for data still present on that replica. What is the safest action before returning it to service?
Not quite. Try another option.
Answer: Remove its stale data and replace or rebuild the node from current replicas before serving requests
Once deletion tombstones have been purged elsewhere, the stale replica's old values can appear live again and propagate. Rebuilding from clean current state avoids this resurrection risk.
Question 60 of 60 · Compaction · Hard
A time-series table receives mostly time-ordered writes, uses daily buckets, and expires data with a uniform TTL. Which compaction decision best fits the workload?
Not quite. Try another option.
Answer: Use TimeWindowCompactionStrategy and minimize late writes that place old timestamps into newer SSTables
TimeWindowCompactionStrategy groups similarly aged data, allowing fully expired SSTables to be dropped efficiently. Late or out-of-order writes can mix age ranges and reduce that benefit.
That's unit 6
Answer a few questions and your score shows up here.
Nearly through. Did unit 6 of INT312 save you a night before the exam?
LPU Notes is free. A student pays for the servers.
Did unit 6 of INT312 save you a night before the exam?
Then you can help keep it free for the next batch. Ads cover part of the server bill;
the rest comes out of a student's own pocket: the domain, the storage, and keeping
the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.