Two5

Menu

  • 01PlayHow it works
  • 02ArenasThe first four
  • 03ResearchResearch notes
  • 04FAQQuick answers
Join the waitlist

Two5/Guides

Algorithm puzzles: computational thinking without writing code

An algorithm puzzle asks you to follow or invent a reliable procedure. You do not need a compiler. You need a rule you can apply the same way every time, a way to tell when you are done, and a trace that shows the state after each step.

Published 2026-10-27

A procedure is the whole puzzle

Computational thinking here means three habits: break the job into steps, notice what has to stay true after each step, and stop when a condition is met. College students see this in data-structures courses. You can practise the same habits on paper before anyone asks you to write a program.

Two5’s Computer Science category — Binary Blitz, Code Trace, and Bug Hunt — is planned as a later expansion, not part of the first playable set. The puzzles below stand on their own.

Puzzles

Trace every step. The answer is the final state, not a function name.

  1. Easy

    A shelf holds 16 books, sorted A to Z, one title per slot. You may open the middle of the remaining range. How many openings do you need, at worst, to find one title or learn it is absent?

    Answer and reasoning

    Answer. 4 openings.

    Each opening cuts the range in half: 16 → 8 → 4 → 2 → 1. After four openings a single slot remains. That is binary search on 16 items. log2(16) = 4.

  2. Medium

    Start at 1. If the current number is odd, double it. If it is even, add 3. Stop when the number is greater than 20. What values do you visit, and where do you stop?

    Answer and reasoning

    Answer. 1, 2, 5, 10, 13, 26. You stop at 26.

    1 is odd, so double to 2. 2 is even, so add 3 to get 5. 5 doubles to 10. 10 adds 3 to get 13. 13 doubles to 26. 26 is greater than 20, so stop. The trap is swapping the odd and even rules.

  3. Medium

    A stack starts empty. You may only put a mark on top or remove the top mark. Process ( [ ] ) { }. After each closer, the top mark must be its pair. Does the line match, and what is left on the stack at the end?

    Answer and reasoning

    Answer. It matches. The stack is empty.

    Push (, push [, pop ] matches [, pop ) matches (, push {, pop } matches {. Nothing remains. The line ( [ ) ] fails when ) tries to close [.

  4. Harder

    You have eight coins. One is heavier. A balance scale tells you which side is heavier, or that they match. What is the fewest weighings that always finds the heavy coin?

    Answer and reasoning

    Answer. Two weighings.

    Split into three groups as evenly as you can: 3, 3, and 2. Weigh 3 against 3. If one side is heavier, the heavy coin is in that trio and one more weighing of two of them finds it (the third is heavy if those two match). If the trios match, the heavy coin is one of the two left out, and one weighing separates them.

Why this is not a coding test

Naming an algorithm is optional. The puzzle is finished when the trace is consistent. That is also why these pages are not a course: there is no syllabus, no grader, and no claim that finishing four puzzles prepares you for an interview. If you want the same kind of trace inside a scored round later, that is the Computer Science expansion on the Two5 waitlist, not a feature you can open today.

On Two5

Want code-trace puzzles in a short scored round? That category is not in the first release. Join the waitlist and you will hear when the Computer Science expansion is actually ready.

Join the waitlist
  • The research note on Two5 Computer Science

Keep going

  • Logic puzzles with answers: a practical way to solve them
  • Math puzzles for adults: number challenges that make you think
TWO5.

Think sharp. Play smart.

Made to challenge your mind
PlayArenasHow it worksFAQsGuidesResearchAboutContact
PrivacyTermsCookies

TWO5. All rights reserved.

Play with purpose.