Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutRoadmapCareersInternshipsFAQContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Puzzle Bank
  • SystemVerilog Language Puzzles25
  • Difficulty Guide
  • Full Topic Map
  • Interview-Day Tips
  • Study Route: One Week Before the Interview
  • Study Route: Two Weeks
  • Study Route: Four Weeks (Full Course)4
  • OOP & Testbench Puzzles25
  • Concurrency & Timing Puzzles25
  • Randomization & Constraint Puzzles25
  • SVA Assertion Puzzles25
  • Functional Coverage Puzzles25
  • Logic & Aptitude Puzzles25
    • Classic Brain Teasers
      • 9 Balls, 1 Heavier, 2 Weighings
      • 2 Eggs and 100 Floors
      • Burning Ropes to Measure 45 Minutes
      • Measure 4 Liters with 3L and 5L Jugs
      • Bridge and Torch (1, 2, 7, 10 Minutes)
      • 100 Prisoners and One Light Switch
    • Probability Puzzles
    • Digital Logic Puzzles
    • Debugging Riddles
    • Logic & Aptitude Puzzles: Tricky Q&A
  • Scenario & Debug Puzzles25
  • UVM Testbench Puzzles25
  • Clock, Reset & CDC Puzzles25
  • Bus and Interface Protocol Puzzles25
  • Interview Prep: Puzzle Rounds7
  • DV Puzzle Cheatsheet
Loading lesson

←Classic Brain Teasers
  1. Topics
  2. DV Interview Puzzles
  3. Logic & Aptitude Puzzles
  4. Classic Brain Teasers
  5. 9 Balls, 1 Heavier, 2 Weighings
On this page

    VLSI DV Interview PuzzlesAll levels

    9 Balls, 1 Heavier, 2 Weighings

    Nine identical-looking balls contain exactly one heavier ball. Using a balance scale and at most two weighings, identify the heavy ball.

    Puzzle

    Difficulty: Easy · Puzzle 1 of 6 · Topic: Classic Brain Teasers

    Nine identical-looking balls contain exactly one heavier ball. Using a balance scale and at most two weighings, identify the heavy ball.

    Hint

    First weighing should split candidates into three equal groups.

    Step-by-step solution

    Diagram
    1) Split into groups A, B, C with 3 balls each. Weigh A vs B.
    2) If A or B is heavier, heavy ball is inside that heavier trio. If equal, heavy ball is in C.
    3) Take the identified trio and weigh one ball vs one ball.
    4) If one side is heavier, that ball is the answer; if equal, the unweighed ball is heavier.
    5) Why two weighings are enough: each weighing has 3 outcomes (left heavy, right heavy, equal), so 3^2 = 9 distinguishable cases.

    Answer

    Answer: Use a 3-3-3 split, then a 1-vs-1 inside the identified trio; two weighings always isolate the heavy ball.

    How this was checked

    Checked by running a model of the rule in a Python model. A computational check: an exhaustive minimax over every pan split shows 9 balls need 2 weighings (10 would need 3), the 3-3-3 then 1-v-1 plan finds the heavy ball for all 9 positions, and a state search proves 12 balls (odd one heavier or lighter) need exactly 3 weighings, not 2.

    Why candidates get it wrong

    Treating it like binary search (4 and 5 balls per side) and needing 3 weighings; a balance gives ternary information, not binary.

    Interviewer follow-up

    If one ball could be either heavier or lighter among 12 balls, how many weighings are needed? Model answer: 3 weighings. 3^3 = 27 outcomes cover the 24 cases (12 balls x heavy/light). Weigh 4 v 4 first; if balanced the odd ball is among the other 4 and you have 2 weighings left (using known-good balls), if unbalanced you track the 8 'maybe heavy/maybe light' balls with 2 more weighings.

    Say it out loud

    A balance gives three outcomes, left heavy, right heavy or equal, so two weighings can separate 3 squared, which is nine, cases. I split the balls into three groups of three and weigh two groups against each other. The heavier side holds the heavy ball, and if they balance it is in the third group. Then I weigh two balls from that group of three; the heavier one is the answer, or if they balance it is the third ball. The trap is splitting four against four like binary search, which needs three weighings.

    Related topics

    • Back to Classic Brain Teasers

    • Logic & Aptitude Puzzles section

    Previous

    161 / 293

    Next: 2 Eggs and 100 Floors

    Up next

    Up next2 Eggs and 100 Floors

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • Burning Ropes to Measure 45 Minutes
    • Measure 4 Liters with 3L and 5L Jugs
    • Bridge and Torch (1, 2, 7, 10 Minutes)