Coursera·Software Engineer·Technical Phone Screen
- Given a list of ranked ballots where each ballot is an ordered list of candidate names, implement Instant Runoff Voting. Each round, count the first active candidate on each ballot. If someone clears 50%, they win. Otherwise eliminate the candidate with the fewest votes, breaking ties by keeping the lexicographically smallest name alive. Return the winner.
“My first instinct was to mutate the ballots directly and I immediately regretted it.”