HARDasked at 2 companies

Strange Printer

A hard-tier problem at 61% community acceptance, tagged with String, Dynamic Programming. Reported in interviews at NetEase and 1 others.

Founder's read

Strange Printer shows up in live OAs at companies like NetEase and Cisco, and it's the kind of problem that tanks candidates who try to code the obvious approach first. You're given a string and need to figure out the minimum number of turns to print it on a weird printer that prints one character at a time but can jump backward and overwrite. Most people immediately think greedy or brute-force recursion and hit a wall. The acceptance rate sits at 60 percent, which means a solid chunk of strong engineers still get tripped up here. If this problem lands in your OA and you blank on the DP pattern, StealthCoder surfaces a working solution in seconds, invisible to the proctor.

Companies asking
2
Difficulty
HARD
Acceptance
61%

Companies that ask "Strange Printer"

If this hits your live OA

Strange Printer is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built by a senior engineer who knows the OA is theater. This is the script.

Get StealthCoder
What this means

The trick is realizing you can print character groups out of order. Instead of printing left to right, you can defer printing a character and come back to it later, saving turns. The key insight is memoized recursion with substring analysis: for a given range, find the minimum turns by either printing everything fresh or by matching the rightmost character to an earlier occurrence and combining the subproblems. A lot of candidates miss that the optimal solution prints one character, then solves overlapping substrings, which is why DP on string intervals matters here. The naive greedy approach fails because you can't always minimize greedily character by character. When you're live in the OA and this pattern doesn't click immediately, StealthCoder is the hedge that gives you a clean DP template and working logic without exposing what you're doing.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

Strange Printer recycles across companies for a reason. It's hard-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built by a senior engineer who knows the OA is theater. This is the script. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Strange Printer interview FAQ

Is Strange Printer really asked at FAANG-tier companies?+

It's confirmed at NetEase and Cisco in the dataset. It's a hard problem, so expect it more in senior rounds or backend-focused loops. The 60 percent acceptance rate suggests companies use it to filter, not just screen.

What's the core insight I'm missing if I can't solve it?+

Most candidates try printing characters in order. The real trick is that you can print a character, jump back, print it again while overwriting, and jump forward again. This out-of-order printing is what DP on intervals models. Substring matching is your friend.

How does the DP state actually work?+

State is usually a substring: the minimum turns to print s[i:j+1]. For each substring, you either print everything fresh, or you find where the last character appears earlier, print that prefix, then combine the overlapping middle and suffix. Memoization prevents exponential blowup.

Is this pure DP or does it need other techniques?+

It's DP on intervals, so you need substring/range thinking and memoization or tabulation. String and DP are the confirmed topics. No graph, no greedy shortcuts, no math tricks. It's about the recurrence itself.

How much time should I spend on this in an OA?+

If you don't see the pattern in 10-15 minutes, it's a sign the insight isn't clicking that day. Hard-level string DP problems have high variance in interview settings. Knowing your limit and moving on or calling for a hint is smarter than losing 45 minutes.

Want the actual problem statement? View "Strange Printer" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.