Distinguish yourself
in the AI era.
Are you prepared for your future?
Companies don't just filter on LeetCode anymore. Practice real implementation-style problems: systems, debugging, APIs, concurrency, and codebase tasks from real interviews.
I'm single.
You may already be familiar with the lock-free MPSC (multi-producer, single-consumer) queue shown on our homepage. This problem tests whether you understand how to generalize those ideas to SPSC concurrency.
Implement the class SPSCQueue, which is a lock-free single-producer single-consumer queue.
SPSCQueue(capacity)capacityspecifies the maximum amount of elements that may exist in the queue at any time.capacitymust be a power of 2 and greater than 2. Throw an exception if it isn't.
push(element)Attempts to enqueue
element.Returns
trueif the enqueue succeeds.Returns
falseif the queue is full at the operation's linearization point (no spurious failures).
pop(out)Attempts to dequeue an element and store it in
out.Returns
trueif the dequeue succeeds.Returns
falseif 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/popconcurrently.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
Tis default-constructible.
- You may assume the stored type
You may assume the queue will not be destroyed during concurrent
pushorpopoperations.You do not need to write any input/output parsing.
A queue constructed with
capacity = Nmust allowNsuccessfulpushcalls 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.
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.
Mock interviews on demand.
Friends always busy? Run a realistic interview with an AI interviewer that asks, follows up, and pushes back like the real thing.
Every session ends with a structured grade, so you know exactly what to fix before it counts.
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.
Interview intel you can actually solve.
Send us your latest interview round, and we'll turn quality reports into runnable WhiteBox problems.
One, Two, Skip a few...
Implement SkipList, a probabilistic sorted data structure that supports fast search, insertion, and deletion by maintaining multiple layers of linked lists with express lanes.
This problem focuses on layered data structure mechanics and correct PRNG-driven level generation.
SkipList(seed)seedis anunsigned 32-bit integer.- Initializes an empty skip list with the given PRNG seed.
- The skip list should support up to 16 levels (levels 0 through 15).
- Level 0 is the bottom level containing all elements.
Each time a new value is successfully inserted (not a duplicate), generate its level as follows:
- Advance the PRNG state before using it:
seed = seed * 1103515245 + 12345- Count consecutive set bits starting from the least significant bit.
- The generated level is that count, capped at 15.
- Duplicate inserts must not advance the PRNG state.
insert(x)- Insert integer
xif it does not already exist. - Return
truewhen a new value is inserted andfalsefor duplicates. - A newly inserted node appears on every level from 0 through its generated level.
search(x)- Return whether
xexists in the skip list. - Search should use express lanes from high levels before descending.
erase(x)- Remove
xif it exists. - Return
trueif a node was removed andfalseotherwise.
display()- Return one line per non-empty level, highest level first.
- Each line is formatted as
Level k: v1 v2 ....
- Values are signed 32-bit integers.
- Up to
2 * 10^5operations may be issued. - The structure must keep values sorted on every level.
- Removing a value must remove it from all levels where it appears.
Everything in one place.
We built the interview prep platform we wished existed. Here's what sets WhiteBox apart.
Choose your WhiteBox plan.
White Room, mock interviews, resume review, and the full prep system come with Premium. Launch pricing is available now.
Free
Get the core catalog and community intel. No card, no trial timer.
- 100+ implementation problems and quizzes
- 700+ handpicked DSA problems, zero filler
- 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
- In-depth guides and writeups, always free
- Progress that persists across every session
Premium
Most popularOne lunch for the complete WhiteBox experience.
- Everything in Free
- White Room: an AI coach that plans your whole prep around your goal
- Exclusive interview problems from our community members
- AI mock interviews with rubric scoring
- AI resume reviews with actionable feedback
- A private Discord channel (on request)
- A Premium badge and card frame to show it off
Outside the US? Reach out on Discord for regional pricing.