QuizzesLSM-Tree vs B-Tree — Concept Check
intermediate
system-design

LSM-Tree vs B-Tree — Concept Check

Questions on LSM-Tree vs B-Tree. B-Trees are the default index structure in relational databases, optimised for reads. LSM-Trees (Log-Structured Merge-Trees) are optimised for write-heavy workloads, used in Cassandra, RocksDB, and LevelDB.

8 minutes 8 questions Pass at 70%
Time Limit
8 minutes - timer starts when you begin
Change Answers Freely
Revisit and change any answer before submitting
Full Review After Submit
Correct answers and explanations shown for every question
Auto-submit on timeout
Quiz submits automatically when time runs out

Questions in this quiz

8 questions on LSM-Tree vs B-Tree — Concept Check. Work through them here, then start the quiz to answer them and see your score.

  1. 1.A database system is experiencing high write latency. The workload is predominantly write-heavy. Which data structure should be considered to improve performance?

    • ALSM-Tree
    • BB-Tree
    • CBinary Search Tree
    • DHash Table
  2. 2.A company uses a database with frequent read operations and occasional writes. Which data structure is more suitable for this workload?

    • AHeap
    • BB-Tree
    • CLSM-Tree
    • DTrie
  3. 3.In an LSM-Tree, what is the main purpose of background compaction?

    • ATo convert sequential writes to random writes
    • BTo immediately delete old SSTables
    • CTo increase the size of the memtable
    • DTo merge SSTables and maintain read performance
  4. 4.A database using B-Trees is experiencing slow write performance. What is a likely cause?

    • ARandom I/O for writes
    • BSequential I/O for writes
    • CHigh CPU usage during compaction
    • DToo many SSTables
  5. 5.Which data structure is likely to cause higher write amplification due to compaction processes?

    • AB-Tree
    • BLSM-Tree
    • CHash Table
    • DLinked List
  6. 6.A developer claims that B-Trees are always better for all database workloads due to their fast read performance. What is a flaw in this reasoning?

    • AB-Trees are not suitable for any database workloads
    • BB-Trees do not support range queries
    • CB-Trees have random I/O for writes, which is not optimal for write-heavy workloads
    • DB-Trees require too much memory
  7. 7.In an LSM-Tree, what is the role of the memtable?

    • ATo handle read operations exclusively
    • BTo store the entire database in memory
    • CTo buffer writes in memory before flushing to disk
    • DTo manage transactions
  8. 8.A database system using LSM-Trees is experiencing increased CPU usage. What could be a contributing factor?

    • AIncreased read operations
    • BRandom I/O operations
    • CLow write throughput
    • DBackground compaction processes