Never Seen This Problem Before? How to Approach an Unfamiliar Coding Interview Question

Never Seen This Problem Before? How to Approach an Unfamiliar Coding Interview Question

You read the prompt, scan your memory for a matching pattern, and find nothing. It isn't a sliding window you've drilled, it isn't a graph problem you remember, and it doesn't look like anything from your last two months of practice. Your stomach drops a little.

That moment is one of the most common in live coding rounds, and it's also one of the most misread. Candidates often assume an unfamiliar problem means they're about to fail. In practice, many interviewers deliberately pick problems you're unlikely to have memorized, because they want to see how you reason when you can't lean on recall. An unfamiliar question isn't a trap. It's the part of the interview that's actually measuring you.

This guide gives you a repeatable routine for those moments, so "I've never seen this" turns into "here's how I'm going to figure it out."

Why unfamiliar problems feel so much harder

Most practice builds recognition: you see a problem, you match it to a pattern, you apply the template. That's useful, but it creates a hidden dependency. When recognition fails, there's no fallback plan, so the mind spins looking for one.

The fix isn't to memorize more patterns (there will always be one you haven't seen). The fix is to practice a process that doesn't start with recognition at all. Interviewers reward that process directly, since it's what you'll actually do on the job when a ticket doesn't match any tutorial.

Step 1: Restate the problem in your own words

Before you think about algorithms, say the problem back in plain language: "So I'm given a list of meeting times, and I need to return the smallest number of rooms so nothing overlaps. Is that right?"

This does three things at once. It confirms you understood the prompt, it buys you thinking time without awkward silence, and it often strips away the unfamiliar framing. A lot of "new" problems are familiar ideas wearing an unusual story. Once you describe it in your own terms, the story falls away and the structure shows.

Follow the restatement with two or three clarifying questions about inputs: size limits, whether values can be negative or duplicated, what an empty input should return. Those answers shape which approaches are even reasonable.

Step 2: Shrink it until it's obvious

Take the smallest version of the problem you can solve by hand. If the input is an array, try length one, then two, then three. Write out the answers for each.

Small cases are where unfamiliar problems become familiar. You'll often notice that the answer for three elements depends on the answer for two, which hints at dynamic programming. Or you'll see that sorting the input first makes the small cases trivial, which hints at a greedy or two-pointer approach. You aren't guessing a pattern; you're discovering one from evidence.

Say what you're doing out loud: "Let me try a tiny example first so I can see what the answer looks like." Interviewers like watching this, because it's exactly how strong engineers approach unknown territory.

Step 3: Get a brute force on the table

Once you understand the small cases, describe the most straightforward correct solution, even if it's slow. "The naive way is to check every pair, which is O(n²). That works, so let me keep it as a baseline."

A brute force is not a confession of weakness. It proves you understand the problem, gives you something to test against, and gives the interviewer a clear starting point for hints. Many candidates skip this step on unfamiliar problems because they're hunting for the clever answer, and they end up with nothing written when time runs short.

You don't always need to code the brute force. Often it's enough to state it clearly, note its complexity, and then ask whether to implement it or try to improve it first.

Step 4: Look for the structure that removes repeated work

Now ask a simple question of your brute force: where is it doing the same work more than once? That single question unlocks a surprising number of unfamiliar problems.

You don't need to name the pattern to use it. Saying "I keep recomputing this sum, so let me store it" is just as strong as saying "prefix sums." Often the interviewer will happily supply the name.

Step 5: Narrate your reasoning, especially the uncertain parts

With an unfamiliar problem, it's tempting to go quiet until you're sure. Resist that. Thinking out loud is how the interviewer evaluates you, and silence on a hard problem reads as being stuck even when you're making progress.

Useful phrases for uncertain moments:

That last one matters. Committing to a solid approach and naming the possible improvement is almost always better than chasing a perfect answer you can't finish.

What to do if you're still stuck

Sometimes the routine still leaves you without a clear path. A few calm moves help:

Revisit the constraints. An input size of around 20 often allows exponential approaches. An input in the millions usually demands something close to linear. Constraints are hints the interviewer gave you for free.

Change the representation. Draw the input as a graph, a grid, a timeline, or a tree. A problem that looks like strings might really be about intervals or connections.

Ask a focused question. "I'm considering whether a greedy choice is safe here. Is there a case I should be thinking about?" A specific question shows reasoning. A vague "I'm stuck" doesn't. Taking a hint well is part of the evaluation, not a penalty.

Keep partial progress visible. A clearly explained brute force with correct complexity analysis and a solid test pass is a respectable outcome on a genuinely hard, unfamiliar problem.

How to practice for problems you can't predict

You can't memorize your way out of unfamiliar problems, but you can train the routine:

  1. Pick problems blind. Choose practice questions without reading the topic tag. The tag gives away the pattern, which is the exact skill you're trying to build.
  2. Time-box the recognition phase. Give yourself three minutes to restate, shrink, and find a brute force before allowing any thought about "which pattern is this."
  3. Practice out loud. Narrating under a timer feels awkward at first, which is precisely why it's worth rehearsing before the real thing.
  4. Review the process, not just the answer. After each session, ask which step unlocked the problem. Over time you'll learn which questions ("where's the repeated work?") pay off most often for you.

FAQ

Is it okay to tell the interviewer I haven't seen this problem before? Yes. Honesty is fine, and it's often welcome. Follow it immediately with your plan: "I haven't seen this one, so let me start with a small example." The plan is what makes the admission land well.

Should I code the brute force or wait for the optimal solution? State the brute force first, then ask. If time is tight or the improvement isn't clear, code the brute force. A working solution beats an unfinished clever one.

How long should I think before speaking? Short pauses are normal, but try to say something within 20 to 30 seconds, even if it's only "let me restate this" or "let me try a small case."

Build the routine before the round

The candidates who handle unfamiliar problems well usually aren't the ones who've seen every question. They're the ones who've rehearsed a process enough that it runs even when they're nervous. If you want a calmer way to practice that routine (restating, shrinking, narrating, and pacing yourself against the clock), Luna Interview is a Chrome side-panel interview practice copilot that sits beside your pad while you rehearse: https://lunainterview.xyz/

Treat the next unfamiliar problem as the part of the interview where you get to show how you think. With a routine in place, it often is.