Reported September 2024
ZipRecruiterstring

Match Panel Code Splits

Reported by candidates from ZipRecruiter's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live ZipRecruiter OA. Under 2s to a working solution.
Founder's read

Strip the story and this ZipRecruiter OA from September 2024 is a string slicing problem with a bounds check. For each code, try every split point, read the left part as an index, read the right part as a pattern, and see if the pattern sits in the panel at that exact spot. No search, no clever data structure. The catch is the panel can hit 100000 characters, so sloppy comparisons cost you. If you blank on the details during the live assessment, StealthCoder runs invisibly as a safety net and gives you the loop. But the logic is short enough to own tonight.

The problem

panel is a digit string. For each digit string in codes, split it every possible way into a nonempty leading index and nonempty trailing pattern, in increasing index-length order.
Emit the pattern when it occurs in panel starting at the decoded zero-based index; otherwise emit not found. Concatenate all results in code and split order.

Function
matchPanelCodes(panel: String, codes: String[]) → String[]

Examples
Example 1
panel = "012345"
codes = ["223"]
return = ["23","not found"]
2|23 matches at index 2; 22|3 is out of range.
Example 2
panel = "012345"
codes = ["0445"]
return = ["not found","45","not found"]
03|45 matches at decoded index 3.

Constraints
1 <= panel.length <= 100000
Every code has length at least two.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The reduction: for a code of length n, split at i from 1 to n-1. Left = code[0:i] parsed as an integer, right = code[i:]. Check that idx + len(right) <= len(panel), then compare panel.startswith(right, idx). If true, emit right. Otherwise emit "not found". Results append in code order, then split order, which is exactly your loop nesting. Pitfalls: parsing a long left part as an integer can overflow in fixed-width languages, so if the left length exceeds the digits of panel.length, treat it as out of range right away. Leading zeros are fine, "03" is index 3. Don't use substring searching across the whole panel, you only check one position. Use startswith or a bounded compare, never slice-and-copy a huge panel. Example 1 confirms 22|3 is out of range. StealthCoder is your hedge if the live OA rattles you on the overflow edge.

Memorize the pattern. If you can't, run StealthCoder. The proctor sees the IDE. They don't see what's behind it.

If this hits your live OA

You can drill Match Panel Code Splits cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass ZipRecruiter's OA.

ZipRecruiter reuses patterns across OAs. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Match Panel Code Splits FAQ

What's the trick in Match Panel Code Splits?+

There's no real trick. Loop every split point, parse the left side as an index, and do one bounded comparison of the right side against the panel at that index. Check bounds first. The work is just careful handling of edge cases, not algorithm design.

How hard is this ZipRecruiter OA question really?+

Easy on algorithm, medium on detail. The pattern is plain string handling. Most lost points come from out-of-range indexes, integer overflow on long left parts, and getting the output order wrong. Read both examples closely before you code.

How do I avoid overflow when parsing the index?+

Panel length is at most 100000, so any valid index has at most 6 digits. If the left part is longer than that after stripping leading zeros, it's out of range, so emit not found without parsing. Otherwise parsing is safe in any language.

What's the time complexity I should aim for?+

Each split costs up to the length of the right part for the comparison, so a code of length n costs about O(n^2) worst case. That's fine as long as you never copy or scan the full panel per split. Use a bounded startswith at the index.

How do I prep for this in 48 hours?+

Write the solution once from scratch using both examples as tests. Then test edge cases: leading zeros in the index, a pattern that runs past the panel end, and a code of length exactly two. Check your output order matches code order, then split order.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with ZipRecruiter.

OA at ZipRecruiter?
Invisible during screen share
Get it