← Questions
Thread-safe key-value store with atomic batch writes
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Design and implement an in-memory string key-value store used by many threads at once, with get, put, delete and write_batch. A batch is an ordered list of puts and deletes (the same key may appear twice; apply them in order). Validate the whole batch first and reject it if it is empty or holds an invalid key. A valid batch must be atomic: no reader or writer ever sees only part of it. Explain your locking scheme, how you avoid deadlocks, how reads stay fast, and how you would test the concurrency.
No official answer yet. Draw yours on the right; publish it and it shows under Community.
Nothing published yet. Publish your canvas and it shows here for others to open and remix.
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing
