Code Room
CodingMediumcod-g1106
Subject Anti entropy convergence rounds across a replica setLevel Mid–Senior~30 minCommon in Distributed systems interviewsIndustries Technology

Question

A set of replicas runs pairwise anti-entropy to converge on the freshest version of a single key. Each replica i starts with an integer version `versions[i]` (higher is fresher). A `schedule` lists pairwise sync rounds in order; each round is [i, j] meaning replicas i and j exchange and both adopt max(version_i, version_j). After running every scheduled round in order, return the number of replicas that hold the globally maximum version. This models how many replicas have converged to the latest write after a given anti-entropy schedule.

Implement
converged_count(versions: list[int], schedule: list[list]) → int
Examples
in[[5,1,1],[[0,1],[1,2]]]out3
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.