Pick the Surviving Partition After a Cluster Network Split

Last updated: November 29, 2026

Quick Overview

Given n cluster nodes, the list of links that are still healthy, and the set of nodes that can reach an external witness, return the nodes that should keep serving I/O: a strict majority partition if one exists, otherwise an exact half that can reach the witness, otherwise nothing.

Nutanix
Coding & Algorithms
Software Engineer
Nutanix
November 29, 2026
Software Engineer
Technical Screen
Coding & Algorithms
Medium

0

0

0 solved


Given n cluster nodes, the list of links that are still healthy, and the set of nodes that can reach an external witness, return the nodes that should keep serving I/O: a strict majority partition if one exists, otherwise an exact half that can reach the witness, otherwise nothing.

Two-node clusters and Metro Availability rely on a witness VM to break ties, because a naive split could let both sides accept writes and diverge. The interviewer checks connected components, a correct majority rule, and whether you can explain why at most one side may ever win.

What the Interviewer Expects
  • Finds partitions with union-find or BFS
  • Uses strict majority (2 * size > n)
  • Consults the witness only for an exact half split
  • Guarantees at most one partition is returned
  • Explains why minority partitions must stop accepting writes
Key Topics to Cover
union-find
connected components
quorum
split brain
witness
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • Links can be asymmetric (A hears B but B does not hear A). How does the model change?
  • How does the witness guarantee it only grants one side, even under retries?
  • What should a node in a losing partition do with in-flight writes?
  • How would weighted votes (some nodes count more) change the check?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Nodes are 0..n-1; links are undirected. Exactly one partition, or none, may continue. Majority wins outright. An exact 50/50 split is resolved by the witness, which grants its vote to one side only; i...

High-Level Design

Build components with union-find over the healthy links. Scan components for one whose size exceeds n/2; there can be at most one. If none, collect components of exactly n/2 that contain a node reachi...


Submit Your Answer
Markdown supported

Related Questions