Construct the Longest New String
A medium-tier problem at 54% community acceptance, tagged with Math, Dynamic Programming, Greedy. Reported in interviews at Guidewire and 1 others.
Construct the Longest New String sits at 54% acceptance, which means half the engineers who see it in their assessment blank or time out. It's been asked at Guidewire and Zalando, and the trick isn't obvious from the problem statement alone. Most candidates try to brute-force or simulate without seeing the math pattern underneath. If this one hits your live OA and you haven't drilled the greedy insight, StealthCoder runs invisibly during screen share and surfaces a working solution in seconds so you can move on.
Companies that ask "Construct the Longest New String"
Construct the Longest New String 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. Made for the engineer who has done the work but might still blank with a webcam pointed at him.
Get StealthCoderThe problem combines Math, Dynamic Programming, and Greedy thinking, but the winning move is usually greedy and constraint-based, not a full DP table. The trap is treating it like a pure optimization problem when it's really about spotting the bottleneck. Most candidates simulate string concatenation directly, which blows up in time or space. The actual trick involves recognizing that you can count operations or states mathematically without building every intermediate string. Once you see the pattern (often a recurrence or a greedy choice rule), the solution becomes linear or near-linear. If you hit this live and the greedy insight doesn't click, StealthCoder provides a verified approach so you don't waste 20 minutes on a dead-end simulation.
Pattern tags
You know the problem.
Make sure you actually pass it.
Construct the Longest New String recycles across companies for a reason. It's medium-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. Made for the engineer who has done the work but might still blank with a webcam pointed at him. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Construct the Longest New String interview FAQ
Is this really a medium, or does 54% acceptance mean it's harder?+
54% suggests a genuine medium with a hidden trick. It's not a knowledge grind like a classic DP problem. You either see the greedy or math insight and solve it clean, or you get stuck in simulation. The acceptance rate reflects that divide.
Do I need Dynamic Programming to solve it?+
DP appears in the topic list, but the actual solution often works without a full table. Greedy and Math tend to be the dominant patterns. Knowing DP helps you think about subproblems, but don't default to memoizing every state.
What's the common failure mode?+
Simulating string construction directly or recursively without recognizing the mathematical constraint. Once you spot what limits the answer (character counts, operation counts, or a simple formula), the solution simplifies fast.
Is this still asked at FAANG-tier companies?+
It's reported at Guidewire and Zalando, both serious engineering orgs. That's smaller than megacap, but these are real assessments. It's the kind of problem that filters for pattern recognition over memorization.
How do I prepare if I don't see the trick?+
Focus on greedy and math insights, not DP machinery. Ask yourself what the limiting resource is. Write out a few small examples and look for a formula or a count-based rule. If you blank on it live, that's exactly when StealthCoder matters.
Want the actual problem statement? View "Construct the Longest New String" on LeetCode →