MEDIUMasked at 2 companies

Number of People Aware of a Secret

A medium-tier problem at 46% community acceptance, tagged with Dynamic Programming, Queue, Simulation. Reported in interviews at NCR and 1 others.

Founder's read

You're told a secret to exactly one person on day 1, and each person who knows it must tell everyone they haven't told yet within a deadline, or they forget. On each subsequent day, everyone who learned the secret yesterday has to act. The acceptance rate is 46%, which means roughly half the candidates who see this problem fail to ship. NCR and Arcesium both ask it. The trap is treating it as a simple math problem when it's actually a simulation where you have to track state per person and handle the forgetting mechanic. If this lands on your OA and you blank on the state machine, StealthCoder solves it in seconds while the proctor sees nothing.

Companies asking
2
Difficulty
MEDIUM
Acceptance
46%

Companies that ask "Number of People Aware of a Secret"

If this hits your live OA

Number of People Aware of a Secret is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built by an Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code.

Get StealthCoder
What this means

The problem requires you to simulate the spread of a secret day by day, tracking which people know the secret, when they learned it, and whether they forget if they don't tell anyone. The naive approach is to model this as a graph traversal, but the deadline and forgetting mechanic make it trickier. You need to track the exact day each person learns the secret and enforce the rule that if someone doesn't tell at least one other person within their deadline, they forget. A queue-based simulation where you process people in the order they learn the secret, combined with careful bookkeeping of state transitions, is the standard path. Dynamic programming can optimize edge cases where you're computing the final count without simulating every day. The 46% acceptance rate reflects that many candidates miss the forgetting rule or mishandle the deadline boundary condition. StealthCoder is your hedge if the simulation logic doesn't click during the live assessment.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

Number of People Aware of a Secret recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built by an Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Number of People Aware of a Secret interview FAQ

Is this problem really asked at FAANG or just mid-tier companies?+

The data shows NCR and Arcesium have both asked it, which suggests it's more mid-market and specialized finance tech than FAANG pipeline. That said, 46% acceptance means it's not trivial. It's a solid screening problem for companies that want to test simulation and state management skills.

What's the main trick that makes people fail?+

The forgetting mechanic. Many candidates model it as a simple graph spread and forget that if person X learns the secret but never tells anyone within the deadline, they lose it. That cascading forgetting is the core of the problem, not just counting reachable nodes.

Do I need dynamic programming or is simulation enough?+

Simulation with a queue is the foundation and will pass. Dynamic programming can optimize counting when you notice patterns in how many people know the secret on each day, but it's not required. Start with clean simulation and optimize only if you hit time limits.

How does this relate to the other topics listed?+

Queue handles the day-by-day ordering of who learns and acts. Simulation tracks state transitions. Dynamic Programming optimizes the counting if you spot structure. Together they form a complete solution, but queue and simulation are the real load-bearers.

If I haven't drilled this exact problem, what should I study?+

Focus on tracking state per entity over time and handling deadline rules. Practice problems involving queues, priority queues for ordered processing, and careful bookkeeping of when things happen. The pattern here shows up in event simulation and state-machine problems.

Want the actual problem statement? View "Number of People Aware of a Secret" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.