Citadel · CS Fundamentals
SDE OA Fundamentals Quiz
TrueInterview
October 27, 2026 · 3 min read
Requirements
You first work through a multiple-choice section of eight questions, and only then go on to two separate coding exercises. The quiz is about reasoning through each item and picking the right answer.
- Python debugging: a code fragment comes with three candidate changes; pick the one that correctly fixes it.
- JavaScript shuffle fairness: look at three shuffle implementations side by side and decide which of them are fair.
- JavaScript space complexity: weigh three implementations against each other, each of which finds the largest element in a sequence.
- Systems fundamentals: five questions covering caches, message queues, locks and replication control.
Notes
- The actual code fragments and answer options are not available; what is listed here are the concrete question formats and the topic areas worth preparing.
- The systems portion contains five questions spread over four named areas, but how many questions fall under each topic is not stated.
- One candidate judged the Python debugging item as a little harder than easy, the shuffle item as medium, and the largest-element space-complexity comparison as easy. These difficulty ratings are personal impressions.
General preparation guidance
- When choosing a debugging fix, follow the failing input step by step through the code, find the earliest invariant that breaks, and check every proposed repair against that failure as well as against neighboring boundary cases. A change can correct one input and still cause a regression elsewhere.
- In a uniform shuffle of distinct items, each permutation has probability . One way to build it is to move
idownward fromn - 1to1, pickjuniformly among0throughi, and swap the two positions. If the index draws are independent and uniform, there are equally likely sequences of choices, and each permutation corresponds to exactly one sequence. The loop runs in time with extra space. - A comparator passed to JavaScript sort has to return the same result for the same pair of inputs and has to respect ordering rules. Producing a new random comparison each time breaks that contract, so sorting with it is not a valid way to get a uniform shuffle. This is a general trap and says nothing about the quiz implementations, which are not available.
- Given a nonempty sequence of finite numbers, scanning once for the maximum while keeping only the best value so far costs time and extra space. When comparing implementations, account for any temporary arrays and recursion frames. Sorting in place does not by itself ensure constant extra space, and the time and space cost of JavaScript sort varies by implementation. Settle empty input and NaN behavior as a separate question.
- On the systems items, spell out your failure and consistency assumptions before selecting an answer: how outdated cache entries get invalidated, whether redelivering a message can apply an effect twice, which operations a given lock guards, and under what conditions a replica may return stale data. These are prompts for thinking about the named topics, not rebuilt quiz questions.
Preparation
- Spend 15 minutes on a short Python routine that has a known bug: trace a single failing input, then test three possible repairs against it and against two boundary cases. Note down why each repair you reject does not work.
- Spend 20 minutes implementing the swap shuffle with a shrinking range and listing every sequence of index choices for three distinct items. Tally the permutations they produce and explain why the result is uniform; running many random trials does not by itself prove it.
- Spend 10 minutes comparing three approaches: an iterative maximum scan, a recursive scan, and copying the data and then sorting it. Make a table of the peak extra storage each uses, counting copies and stack frames, and keep the algorithm's own storage separate from sort workspace that depends on the engine.
- Spend 20 minutes writing a failure scenario for each systems topic: reading a stale cache entry, a queue delivering the same message twice, a deadlock, and a replica that lags behind. For every scenario, give one mitigation and the assumptions it relies on.
Loading comments…