Coursera·Software Engineer·Technical Phone Screen
- Given a list of ranked ballots, implement a simple plurality voting system that returns the candidate with the most first-choice votes, breaking ties by lexicographic order.
- Using the same ballot input, implement instant-runoff voting: repeatedly eliminate the candidate with the fewest votes each round until someone crosses 50%, handling ties by eliminating the lexicographically largest candidate.
“Pretty straightforward once you realize you only look at the first element of each ballot.”