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

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Puzzle Bank
  • SystemVerilog Language Puzzles25
  • Difficulty Guide
  • Full Topic Map
  • Interview-Day Tips
  • 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
  • Interview Prep: Puzzle Rounds5
  • DV Puzzle Cheatsheet
Loading lesson

‹Classic Brain Teasers
  1. Topics
  2. DV Interview Puzzles
  3. Logic & Aptitude Puzzles
  4. Classic Brain Teasers
  5. Measure 4 Liters with 3L and 5L Jugs

VLSI DV Interview Puzzles · All levels

Measure 4 Liters with 3L and 5L Jugs

You have unmarked 3-liter and 5-liter jugs plus unlimited water. Measure exactly 4 liters.

On this page

    Puzzle

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

    You have unmarked 3-liter and 5-liter jugs plus unlimited water. Measure exactly 4 liters.

    Hint

    Create a 2-liter remainder first, then use it as an offset.

    Step-by-step solution

    Diagram
    1) Fill 5L jug and pour into 3L jug => 5L now has 2L left.
    2) Empty 3L jug.
    3) Pour the 2L from 5L into 3L jug.
    4) Fill 5L jug again.
    5) Pour from 5L into 3L until 3L is full; it needs 1L to go from 2L to 3L.
    6) So 5L jug is left with exactly 4L.

    Answer

    Answer: Sequence leaves 4 liters in the 5L jug after creating 2L in the 3L jug and topping it up.

    Why candidates get it wrong

    Trying to directly make 4L in one move instead of using intermediate remainders.

    Interviewer follow-up

    Can you derive a general solvability rule for jug sizes a and b?

    Related topics

    • Back to Classic Brain Teasers

    • Logic & Aptitude Puzzles section

    Previous

    158 / 210

    Next: Bridge and Torch (1, 2, 7, 10 Minutes)

    Up next

    Up nextBridge and Torch (1, 2, 7, 10 Minutes)

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • 9 Balls, 1 Heavier, 2 Weighings
    • 2 Eggs and 100 Floors
    • 100 Prisoners and One Light Switch