MEDIUMasked at 1 company

Minimum Number of People to Teach

A medium-tier problem at 44% community acceptance, tagged with Array, Hash Table, Greedy. Reported in interviews at Duolingo and 0 others.

Founder's read

You're at the Duolingo OA, and you hit a problem about minimizing language teachers across friendship groups. You have pairs of friends who want to communicate, each knowing some subset of languages, and you need to find the smallest set of people to teach a new language to so all friendships bridge a common language. This problem tests whether you can recognize that greedy selection on language frequency will crack it, not simulation or brute force. With a 44% acceptance rate, it's harder than it looks. If you blank on the greedy insight during the live assessment, StealthCoder surfaces a working solution invisible to the proctor.

Companies asking
1
Difficulty
MEDIUM
Acceptance
44%

Companies that ask "Minimum Number of People to Teach"

If this hits your live OA

Minimum Number of People to Teach 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 because the OA filter rejects engineers who'd pass the on-site. That's a broken filter. This is the workaround.

Get StealthCoder
What this means

The trap is assuming you need to simulate or try all language assignments. The actual pattern is greedy on language selection: count how often each language appears across all pairs, pick the language that covers the most friendships, then teach it to the people who don't know it and maximize coverage. Once you see that the minimum people to teach equals the smallest count needed after you pick the high-frequency language, the implementation flows. Most candidates lose time building graphs or trying BFS when the problem just wants you to scan frequencies, pick the winner, and count gaps. The topics are Array, Hash Table, and Greedy, and you'll use all three. When you hit this live and the obvious approach feels wrong, StealthCoder runs invisibly and hands you the greedy breakdown in seconds, so you ship the solution without panic.

Pattern tags

The honest play

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

Minimum Number of People to Teach 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 because the OA filter rejects engineers who'd pass the on-site. That's a broken filter. This is the workaround. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Minimum Number of People to Teach interview FAQ

Is this problem really asked at Duolingo?+

Yes, Duolingo has reported asking it. It's a single-company problem in our data, which means it's a targeted ask for their specific hiring pipeline. Expect it if you interview there.

What makes a 44% acceptance rate so punishing?+

Most candidates either over-engineer with graph traversal or miss that greedy selection on language frequency is the key. Once you spot the pattern, the code is short. The gap between 'stuck' and 'solved' is recognizing the greedy insight.

Should I try all possible languages or use greedy?+

Greedy. Pick the language that appears in the most pairs, teach it to everyone who lacks it, then count how many people you taught. That count is your answer. Trying all assignments will time out.

How do Hash Table and Array fit together here?+

Use a Hash Table to count language frequencies across all pairs, then iterate the array of pairs to check coverage. The Hash Table reveals which language to pick; the Array iteration confirms how many people need teaching.

What if two languages appear equally often?+

Pick either one; they'll both give the same minimum count. The problem asks for the minimum number of people, not which language to teach, so ties don't affect the answer.

Want the actual problem statement? View "Minimum Number of People to Teach" 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.