brain teasers

Painfully Easy

I flip a penny and a dime and hide the result from you. “one of the coins came up heads”, i announce. what is the chance that the other coin also came up heads?

Solution

Assuming complete honesty on the part of the flipper, wouldn’t the solution be 33%?

There are four possible scenarios:

HH
TH
HT
TT

Obviously the TT possibility can be discounted because it does not result in one of the two being heads.

This lees us with three possibilities, only one of which has the other coin also being heads. 

Therefore one third.

I think.

I usually get these wrong.

2026 Update: The Simplest Problems Are Often Traps

“Painfully easy” problems test whether candidates overcomplicate simple tasks. Here are classic “easy but commonly messed up” problems in interviews:

from collections import Counter

# Problem 1: FizzBuzz — often overcomplicated
def fizzbuzz(n: int) -> list:
    """Check divisibility by 15 FIRST (both 3 and 5), then 3, then 5."""
    result = []
    for i in range(1, n + 1):
        if i % 15 == 0:
            result.append("FizzBuzz")
        elif i % 3 == 0:
            result.append("Fizz")
        elif i % 5 == 0:
            result.append("Buzz")
        else:
            result.append(str(i))
    return result

# Elegant one-liner
def fizzbuzz_clean(n: int) -> list:
    return [
        ('' if i % 3 else 'Fizz') + ('' if i % 5 else 'Buzz') or str(i)
        for i in range(1, n + 1)
    ]

# Problem 2: Check if two strings are anagrams
def are_anagrams(s: str, t: str) -> bool:
    """Counter comparison handles Unicode correctly."""
    return Counter(s.lower()) == Counter(t.lower())

# Problem 3: Find the only element that appears once
def single_number(nums: list) -> int:
    """XOR trick: all others appear exactly twice, so they cancel."""
    result = 0
    for num in nums:
        result ^= num
    return result

# Problem 4: Two sum on a SORTED array — use two pointers, not hash map
def two_sum_sorted(nums: list, target: int) -> tuple:
    left, right = 0, len(nums) - 1
    while left < right:
        s = nums[left] + nums[right]
        if s == target:
            return (left, right)
        elif s < target:
            left += 1
        else:
            right -= 1
    return None

# Test
print(fizzbuzz(15)[-3:])  # ['13', '14', 'FizzBuzz']
print(are_anagrams("listen", "silent"))  # True
print(are_anagrams("Astronomer", "Moon starer"))  # False (includes space)
print(single_number([2, 2, 1]))  # 1
print(two_sum_sorted([1, 2, 3, 4, 6], 6))  # (1, 3)

Why “easy” problems are interview traps:

  • FizzBuzz: 25% of candidates fail due to wrong condition order — checking i % 3 before i % 15 causes “Fizz” output for multiples of 15
  • Anagrams: Forgetting case sensitivity, whitespace handling, or Unicode edge cases
  • Two sum (sorted): Reaching for a hash map when two pointers are O(1) space

The lesson: “painfully easy” questions test whether you can recognize the simplest correct solution and execute it cleanly under pressure. Clean code, correct edge cases, and no over-engineering matter more than clever algorithms for simple problems.

newsletter

What's actually being asked right now

Interview patterns & comp trends, straight to your inbox.

No spam. Unsubscribe anytime.

newsletter

What's actually being asked right now

Interview patterns & comp trends, straight to your inbox.

No spam. Unsubscribe anytime.

1972 Soviet postage stamp commemorating the Mars 2 probe

worth a read

Mars For The Rest of Us — a weekly-or-more deep dive on the technical side of Mars exploration: rocket propulsion, microbiology, mission architecture, and everything in between. Written by Maciej Ceglowski.

Read it on Substack →
Scroll to Top