Join our Discord server!

Secure your dream offerwith ease

CRUSH TECHNICAL ROUNDS. BE THE OTHER CANDIDATE.

Implement a Lock-Free MPSC Queue Expert 8
Concurrency OS
Akuna Capital
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
namespace whitebox
{
template <typename T>
class MpscQueue {
public:
explicit MpscQueue(size_t capacity)
: capacity_(capacity), mask_(capacity - 1),
data_(capacity), seq_(capacity) {
assert((capacity & mask_) == 0 && "capacity must be a power of 2");
for (size_t i = 0; i < capacity_; ++i) {
seq_[i].store(i, std::memory_order_relaxed);
}
head_.store(0, std::memory_order_relaxed);
tail_.store(0, std::memory_order_relaxed);
}
bool push(const T& value) {
size_t pos = head_.load(std::memory_order_relaxed);
while (true) {
size_t tail = tail_.load(std::memory_order_acquire);
if (pos - tail >= capacity_) return false;
if (head_.compare_exchange_weak(
pos, pos + 1,
std::memory_order_acq_rel,
std::memory_order_relaxed)) {
auto& s = seq_[pos & mask_];
while (s.load(std::memory_order_acquire) != pos) {}
data_[pos & mask_] = value;
s.store(pos + 1, std::memory_order_release);
return true;
}
}
}
bool pop(T& out) {
size_t pos = tail_.load(std::memory_order_relaxed);
auto& s = seq_[pos & mask_];
if (s.load(std::memory_order_acquire) != pos + 1) return false;
out = std::move(data_[pos & mask_]);
s.store(pos + capacity_, std::memory_order_release);
tail_.store(pos + 1, std::memory_order_release);
return true;
}
private:
const size_t capacity_;
const size_t mask_;
std::vector<T> data_;
std::vector<std::atomic<size_t>> seq_;
std::atomic<size_t> head_;
std::atomic<size_t> tail_;
};
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
namespace blackbox
{
template <typename T>
class MpscQueue {
public:
explicit MpscQueue(size_t capacity)
: capacity_(capacity), mask_(capacity - 1),
data_(capacity), seq_(capacity) {
assert((capacity & mask_) == 0 && "capacity must be a power of 2");
for (size_t i = 0; i < capacity_; ++i) {
seq_[i].store(i, std::memory_order_relaxed);
}
head_.store(0, std::memory_order_relaxed);
tail_.store(0, std::memory_order_relaxed);
}
bool push(const T& value) {
size_t pos = head_.load(std::memory_order_relaxed);
while (true) {
size_t tail = tail_.load(std::memory_order_acquire);
if (pos - tail >= capacity_) return false;
if (head_.compare_exchange_weak(
pos, pos + 1,
std::memory_order_acq_rel,
std::memory_order_relaxed)) {
auto& s = seq_[pos & mask_];
while (s.load(std::memory_order_acquire) != pos) {}
data_[pos & mask_] = value;
s.store(pos + 1, std::memory_order_release);
return true;
}
}
}
bool pop(T& out) {
size_t pos = tail_.load(std::memory_order_relaxed);
auto& s = seq_[pos & mask_];
if (s.load(std::memory_order_acquire) != pos + 1) return false;
out = std::move(data_[pos & mask_]);
s.store(pos + capacity_, std::memory_order_release);
tail_.store(pos + 1, std::memory_order_release);
return true;
}
private:
const size_t capacity_;
const size_t mask_;
std::vector<T> data_;
std::vector<std::atomic<size_t>> seq_;
std::atomic<size_t> head_;
std::atomic<size_t> tail_;
};
}

Our users landed offers at

Why WhiteBox?

In 2026, top companies don't just ask Leetcode problems.
Stop hyperfocusing on algorithm puzzles. Start mastering implementation.

Gmail Inbox 2

Problems straight from the source.

We actively interview at top companies (FAANG+, quants) to keep our problems catalog fresh, and stay up to date with the interview meta.

You can also contribute your latest interview problems to the problems catalog and gain cool cosmetics & badges.

-2σ-1σμ+1σ+2σ

The best resources, curated by the best.

We notice that candidates waste months on the wrong resources. Most people are ignorant of resources beyond Leetcode and influencer courses. We collect and organize everything to help you skip the beginner phase and land your dream offer.

How we differ from other platforms

We built the interview prep platform we wished existed. Here's how we stack up.

WhiteBox
LeetCode/NeetCode
getcracked.io
Codeforces
Transferability Does it help you get a job?
Real, up-to-date interview problems & implement real, production systems and patterns
Pretty questionable—refer to FAQ
Good, but focuses on C++ domain knowledge & quant
Sharpens problem solving, but hard to navigate for beginners
Implementation Real systems, not toy problems
Concurrency, ML, API design, and other common implementation design patterns
Some behind paywall, and low quality
Some
Rare
Ranking How you stack up against other candidates
Custom elo rating and domain strength analysis
Based on problems solved (Are we deadass?)
Based on problems solved and success rate
Elo rating
Strength Analysis Know your weak spots
AI-powered weakness detection & analysis
None
None
None
Company Matching Where you'd be a good fit
AI-powered company matching
None
None
None
Community Who's behind it?
#1 getcracked.io user | ICPC / IOI medalists | FAANG+ pros
Toxic grind culture with tons of cheating and terrible editorial moderation
Gatekept, elitist paid community
Contest-focused, massive cheating issue
Structured Roadmap A clear path to mastery
Interactive skill tree with dependency mapping, progress tracking, and curated problem sets per topic
Questionable dependencies & never updated in 5 years.
None — just a problem list
None — figure it out yourself
Gamification Stay motivated
Unlockable cosmetics, profile badges, card frames, PP & flex on your friends
Basic streaks and ugly badges
None
None
Pricing Subscription cost
Generous free tier + only $12 for premium
$180/yr or $40/mo (LeetCode), $300 lifetime (NeetCode)
Strictly paid ($20/month)
Free

Pricing

Unlock exclusive interview problems, private Discord channel access, 1-on-1 advice and more.

Your price is locked in forever — future increases won't affect you.

Free

$0 /month

Level up your interview game with commonly asked interview implementation questions.

  • Non-premium questions
  • Public Discord access
  • Access to exclusive interview questions
  • Custom profile badge
  • Never worry about price hikes
  • 24/7 priority support

Lifetime

$167 /once

One payment, lifetime access. Get everything in Premium forever—no recurring fees.

  • Non-premium questions
  • Public Discord access
  • Access to exclusive interview questions
  • Custom Lifetime badge
  • Never worry about price hikes
  • 24/7 priority support

Frequently asked questions