Learn the vocabulary of maximizing conflict-free one-to-one assignments across two sides of a graph.
0 / 5 completed
1 / 5
A teammate explains that an algorithm assigns applicants to jobs, where each applicant and each job forms its own side of a two-sided graph, maximizing the number of valid assignments so that no applicant or job is matched more than once. What problem is being solved?
Bipartite matching is exactly this: given a graph with two disjoint sides, such as applicants and jobs, where edges represent valid pairings, the algorithm finds the maximum number of pairings such that no applicant or job is matched more than once. A hash collision is an unrelated hash-table concept about two keys sharing a bucket. This maximize-one-to-one-pairings-across-two-sides approach is exactly why bipartite matching is used for assignment problems like matching applicants to jobs or students to schools.
2 / 5
During a design review, the team models resident-to-hospital assignments as a bipartite matching problem, specifically so the maximum possible number of residents are placed without any resident or hospital slot being double-booked. Which capability does this provide?
Bipartite matching here provides a provably maximum, conflict-free one-to-one assignment across both sides, since the matching algorithm guarantees no resident or hospital slot is used more than once. Assigning residents to hospitals in an arbitrary order and hoping no conflicts arise can leave both residents and hospital slots unfilled unnecessarily. This provably-maximum-conflict-free behavior is exactly why bipartite matching is favored for assignment problems like resident-to-hospital placement.
3 / 5
In a code review, a dev notices a resident-placement script assigns residents to hospitals in the order they appear in a list, skipping any hospital that's already taken, instead of running a bipartite matching algorithm to find the maximum possible number of placements. What does this represent?
This is a missed bipartite-matching opportunity, since running a proper matching algorithm would find the maximum possible placements instead of settling for whatever a simple in-order assignment produces. A cache eviction policy is an unrelated concept about discarded cache entries. This in-order-greedy-assignment pattern is exactly the kind of suboptimal outcome a reviewer flags once maximizing total placements is the goal.
4 / 5
An incident report shows a placement run left dozens of qualified residents unplaced even though compatible open hospital slots existed, because the assignment script matched residents to hospitals strictly in list order without backtracking. What practice would prevent this?
Running a bipartite matching algorithm over the resident-hospital compatibility graph finds the maximum possible number of conflict-free placements instead of whatever in-order assignment happens to produce. Continuing to assign residents to hospitals strictly in list order regardless of how many compatible slots go unfilled is exactly what caused the unplaced residents described in this incident. This proper-matching approach is the standard fix once maximizing total placements is confirmed to be the goal.
5 / 5
During a PR review, a teammate asks why the team reaches for a bipartite matching algorithm instead of a simple greedy in-order assignment, given that the greedy approach is much easier to implement and explain. What is the reasoning?
A bipartite matching algorithm trades some implementation complexity for a provably maximum set of conflict-free assignments, while a greedy in-order assignment is simpler but can leave compatible pairs unmatched depending on processing order. This is exactly why a bipartite matching algorithm is favored when maximizing total assignments genuinely matters, while a greedy in-order assignment might suffice only when near-optimal placement is acceptable.