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. Bridge and Torch (1, 2, 7, 10 Minutes)
On this page

    VLSI DV Interview PuzzlesAll levels

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

    Four people need to cross a bridge at night with one torch. At most two cross at once; pair speed is slower person's time. Times are 1, 2, 7, 10 minutes. Minimize total time.

    Puzzle

    Difficulty: Medium · Puzzle 5 of 6 · Topic: Classic Brain Teasers

    Four people need to cross a bridge at night with one torch. At most two cross at once; pair speed is slower person's time. Times are 1, 2, 7, 10 minutes. Minimize total time.

    Hint

    Compare two strategies for moving the two slowest across.

    Step-by-step solution

    Diagram
    1) Optimal pattern uses the two fastest as shuttles.
    2) Send 1 and 2 across: +2.
    3) Send 1 back: +1 (total 3).
    4) Send 7 and 10 across together: +10 (total 13).
    5) Send 2 back: +2 (total 15).
    6) Send 1 and 2 across: +2 (total 17).
    7) Alternate strategy (the fastest person escorts each slow person: 1+10 across, 1 back, 1+7 across, 1 back, 1+2 across) costs 10+1+7+1+2 = 21, so 17 is better. A Dijkstra search over all (torch side, who is where) states confirms 17 is the minimum.

    Answer

    Answer: Minimum total crossing time is 17 minutes.

    How this was checked

    Checked by running a model of the rule in a Python model. A computational check: Dijkstra over every (who is on which side, torch side) state gives 17 for 1, 2, 7, 10 (escort strategy 21) and 17 for 1, 2, 5, 10 (escort strategy 19).

    Why candidates get it wrong

    Greedy 'always send the fastest person with each slow person' costs 21 here, not 17; sending the two slowest together pays for the 10-minute walk only once.

    Interviewer follow-up

    For times 1, 2, 5, 10, what is the optimal total and why? Model answer: 17 again. Pair strategy costs 2+1+10+2+2 = 17, the escort strategy costs 10+1+5+1+2 = 19. The pair strategy wins when 2*t2 < t1 + t(n-1), i.e. 2*2 < 1+5 here; with 1, 2, 7, 10 it wins by an even larger margin (17 vs 21).

    Say it out loud

    The idea is to pay for the two slowest people only once, by sending them together. So the one-minute and two-minute people cross first, which costs 2, then the one-minute person returns, costing 1, for a total of 3. Then the seven and the ten cross together for 10, total 13, the two-minute person comes back for 2, total 15, and finally the one and two cross for 2. The answer is 17 minutes. The trap is the greedy plan where the fastest escorts everyone, which costs 21.

    Related topics

    • Back to Classic Brain Teasers

    • Logic & Aptitude Puzzles section

    Previous

    165 / 293

    Next: 100 Prisoners and One Light Switch

    Up next

    Up next100 Prisoners and One Light Switch

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • 9 Balls, 1 Heavier, 2 Weighings
    • 2 Eggs and 100 Floors
    • Burning Ropes to Measure 45 Minutes