Master the fundamental concepts of build a simple key-value store through this focused micro-challenge.
LSM trees buffer writes in a memtable, usually a skip list or red-black tree, before flushing immutable SSTables to disk. RocksDB and LevelDB use skip lists for concurrent inserts with reader-writer friendly locking.
Expected O(log n) search with simpler concurrency than balanced trees. Each level skips forward with coin-flip height.
cLoading…
Keep the relevant documentation open while you implement. When your output disagrees with the reference, trace one failing case by hand before changing random lines.
You will implement a skip list memtable supporting insert and lookup. This exercise requires maintaining sorted order and expected logarithmic search steps.
Document one invariant you will assert in tests and how you would detect its violation from observable symptoms.
Write a C program that implements a skip list memtable for key-value pairs.
Requirements:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github