White Room White Room DSA

Distinguish yourself
in the AI era.

Are you prepared for your future?

Core Catalog

Companies don't just filter on LeetCode anymore. Practice real implementation-style problems: systems, debugging, APIs, concurrency, and codebase tasks from real interviews.

Browse problems

I'm single.

Harder 6 Exclusive 10s 256 MB

Implement the class SPSCQueue, which is a lock-free single-producer single-consumer queue.

Signature
SPSCQueue(capacity)
  • capacity specifies the maximum amount of elements that may exist in the queue at any time.

  • capacity must be a power of 2 and greater than 2. Throw an exception if it isn't.

Signature
push(element)
  • Attempts to enqueue element.

  • Returns true if the enqueue succeeds.

  • Returns false if the queue is full at the operation's linearization point (no spurious failures).

Signature
pop(out)
  • Attempts to dequeue an element and store it in out.

  • Returns true if the dequeue succeeds.

  • Returns false if the queue is empty at the operation’s linearization point (no spurious failures).

  • Exactly one producer thread and exactly one consumer thread may call push/pop concurrently.

    • The implementation must be lock-free (no std::mutex, no condition variables, etc.). Using a lock may result in a compilation error.

    • The grader uses stress tests to detect corruption (duplicates/missing) and deadlocks, but does not formally verify linearizability.

    • Type constraints (standard version):

      • You may assume the stored type T is default-constructible.
    • You may assume the queue will not be destroyed during concurrent push or pop operations.

    • You do not need to write any input/output parsing.

    • A queue constructed with capacity = N must allow N successful push calls before reporting full.

    • Because there are only two threads, there is very little opportunity for data corruption, allowing incorrect solutions to pass the judge. Therefore, this problem has been marked as unrated.

Accepted 1,471/3,128
Acceptance 47%
12345678910111213141516171819202122232425262728293031323334
#include <atomic>
#include <vector>
#include <stdexcept>
throw std::invalid_argument("capacity must be a power of two and greater than two");
}
private:
std::vector<int> buffer_;
std::atomic<size_t> head_{0};
std::atomic<size_t> tail_{0};
};

A roadmap that motivates problem solving

Handpicked by Codeforces Masters+ and ICPC/IOI participants from quant and FAANG+ companies. A focused alternative to NeetCode, TLE, and A2Z, with problems that teach you to derive solutions from first principles.

Open the full roadmap

Drag to explore. Select a topic to open it.

Noob 0
Easy 1
Easy+ 2
Normal 3
Normal+ 4
Hard 5
Harder 6
Insane 7
Expert 8
Master 9

WhiteBox users have received offers from

More than a problem bank

The problems are just the start. The rest is what actually gets you the offer.

An adaptive AI coach that remembers you.

Set a goal three months out and it builds the plan. Every session goes into memory: what you solved, what you keep getting wrong, where your level actually sits. Come back in a week and it already knows.

See White Room

Gain alpha on how to get good.

Most advice on getting good is a playbook for how interviews worked in 2021, or an influencer selling a shortcut. Our guides teach you how to learn efficiently, so every hour you put in builds habits that still work in 2026.

Read the guides

Grow inside our community.

An environment shapes the outcome of your growth. People waste time on wrong resources, editorials written by beginners, and unqualified influencers. Join candidates who have been through FAANG+, quant, and elite startup interviews so your habits, resources, and feedback all point toward the offer.

Join our Discord

Interview intel you can actually solve.

Send us your latest interview round, and we'll turn quality reports into runnable WhiteBox problems.

From interview reports 4 reports

Know your limits. (Easy version)

10s 256 MB
Easy 1.5 BasicsData StructuresNetworking Akuna Capital

This is the easy version of RateLimiter. The only difference between this and the hard version are the constraints. Solving one problem does not guarantee solving the other.

Implement RateLimiter, which tracks a bounded number of events in a rolling time window.

Signature
RateLimiter(seconds, capacity)
  • seconds defines the length of the rolling time window.

  • capacity is the maximum number of events that may exist within the window at any moment.

  • At all times, the RateLimiter should only account for events whose timestamps fall within the most recent seconds

Signature
add(count, timestamp)
  • Adds count new events occurring at time timestamp.

  • If adding all count events would cause the total number of active events in the window to exceed capacity, only add as many as possible and discard the remainder.

  • All events added by a single call to add are considered to occur at the same instant.

  • You may assume calls to add are made with non-decreasing timestamps.

  • Calls to add should not return anything.

Signature
check()
  • Returns the number of events currently within the active time window.
  • Events expire automatically once they fall outside the time window.

  • The implementation should correctly handle multiple additions at the same timestamp.

  • How you store events internally is up to you.

Built on how people actually learn.

You get good at solving problems by solving them, even when reading solutions feels more productive. Here’s what the studies found, and where it shows up in WhiteBox.

Passive learning feels better. Active learning works better.

Most people watch the video solution, feel like they learned it, and make very little progress. The lecture students in this study fell for the same thing: they felt they learned more and scored lower.

Active doesn’t mean struggling alone. Asking Tsuki, the AI chat on every plan, for the minimal hint to unblock yourself instead of the answer is scaffolding in Lev Vygotsky’s Zone of Proximal Development: just enough support to solve a problem slightly beyond what you can do alone.

Read: Is NeetCode / Strivers A2Z bad?

Active class versus a passive lecture

Active class versus a passive lectureActive class versus a passive lecture. Test of learning: +0.46. Feeling of learning: −0.56.−0.5 SDLecture+0.5 SDTest of learning+0.46Feeling of learning−0.56
149 students in introductory physics, taught the same material both ways. Deslauriers et al. (2019), PNAS

Get stuck before you read the editorial. You’ll understand it better.

You’ve probably been told to open the editorial after 20 to 30 minutes. An editorial is not a timer, and struggling is not wasted time: exhausting your own ideas is what builds the reasoning.

The Core Catalog trains synthesis instead of recall. A problem combines several ideas instead of dressing up one pattern, so you can’t finish it by matching it against something you memorized. We are not training you to be a lookup table, we are training you to produce the insight yourself.

Read: Is pattern matching a trap?

Understanding of the concept, out of 10

Understanding of the concept, out of 10Understanding of the concept, out of 10. Taught first: 3.84. Tried the problem first: 6.33.0246810Taught first3.84Tried the problem first6.33
75 ninth graders learning standard deviation, tested right after the lesson. Kapur (2014), Cognitive Science

You can’t memorize your way through a follow-up question.

The usual mistake is studying one topic at a time. You always know which technique the problem wants, so you never face unseen problems, which are exactly what an interview gives you. Students told the formula first kept up on ordinary word problems and fell behind on one that looked new.

Daily quests pay XP for solving a problem at your level on CSES, AtCoder, Codeforces or LeetCode, a different one each day, and White Room DSA deals problems you haven’t seen. Both hand you the problem and nothing else. We don’t spoil which technique it wants.

Read: Meta-learning, and what Chinese OI gets right about learning algorithms

Score on a new kind of problem, three weeks later

Score on a new kind of problem, three weeks laterScore on a new kind of problem, three weeks later. Told the formula first: 23.0%. Invented it first: 53.5%.0%25%50%75%100%Told the formula first23.0%Invented it first53.5%
128 eighth graders learning density and speed in physics. Schwartz et al. (2011), Journal of Educational Psychology

These studies tested ways of learning. None of them tested WhiteBox.

Choose your WhiteBox plan.

Take DSA Premium for the practice loop and unlimited resume reviews, or Ultra Premium for the whole prep system with the coach. Open any plan to see the screens you are buying.

Free

$0 /mo

Everything WhiteBox has to offer for free.

  • 48 original implementation problems in the Core Catalog
  • 912 curated DSA problems in the algorithm roadmaps
  • 1,900+ quiz questions across algorithms and domain knowledge
  • Algorithm roadmaps that map out what to learn next
  • Interview intel from real candidates, free forever
  • Daily quests, streaks, and the global leaderboard
  • Tsuki AI chat for hints and explanations
  • 36 in-depth guides and writeups, always free
  • Progress that persists across every session

DSA Premium

$0 /mo

Billed annually at $79. Save 27%.

One lunch to get the full DSA improvement loop.

  • Everything in Free
  • Adaptive DSA practice: a hand of unseen problems picked for your level
  • Problems pulled from AtCoder, CSES, Codeforces, LeetCode, USACO, and oj.uz
  • Solve history, rolling difficulty, and per-topic weak spots
  • A weekly check-in that re-aims the next block of practice
  • A shared learner profile with inspectable practice evidence
  • Judge sync, so solves you make elsewhere still count
  • Unlimited AI resume reviews

Outside the US? Reach out on Discord for regional pricing.