Reported February 2024
Palantirstring

Get Phone Numbers

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

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

Palantir's February OA featured a phone number extraction problem that caught candidates off guard because it looks simple until you start handling edge cases. You're likely parsing a string or list to identify and return valid phone numbers in a specific format. The trick isn't the algorithm; it's catching all the variations: missing digits, bad formatting, leading zeros, country codes. StealthCoder sits quietly on your second monitor during the live OA in case you blank on regex or validation logic and need a pattern refresh in real time.

Pattern and pitfall

This is a string parsing and validation problem disguised as a simple filter. You'll walk through input, check each candidate against format rules (likely checking digit count, position, allowed characters), and return matches. The common miss is incomplete validation: candidates catch obvious junk but miss subtle cases like spaces in the middle of a number, or country code prefixes they didn't account for. The pattern hinges on understanding what constitutes 'valid' in Palantir's eyes, which the problem statement defines. Build your validation rules first, then iterate. If you get stuck on edge cases mid-interview, having a reference pattern available beats guessing.

If you see this problem in your OA tomorrow, the play is to recognize the pattern in 30 seconds. StealthCoder buys you that recognition.

If this hits your live OA

You can drill Get Phone Numbers 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. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken.

Get StealthCoder

Related leaked OAs

⏵ The honest play

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

Palantir reuses patterns across OAs. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Get Phone Numbers FAQ

Is this a regex problem or a manual parse?+

Both work. Regex is faster if you're comfortable with it; manual character-by-character validation is safer if regex isn't your strong suit. Read the problem statement carefully for what format Palantir expects before choosing your approach.

What's the most common pitfall?+

Candidates assume all phone numbers follow one format and miss variations: leading zeros, country codes, spaces, hyphens, parentheses. Test against the exact format the problem specifies, not your intuition about what a phone number looks like.

Do I need to handle international numbers?+

Depends on the problem statement. If it doesn't mention them, assume domestic format. If it does, the problem will tell you which country codes to accept or how to validate them. Don't invent rules.

How much time should I spend on this?+

Phone number parsing is usually a 15-25 minute problem if you read the spec carefully upfront. Spend 5 minutes understanding the exact format rules, then code. Rush the spec, waste 15 minutes debugging edge cases.

Is this still a common Palantir question?+

Parsing and validation problems are part of Palantir's screening. Format might change, but the skill tested remains: careful attention to specification and handling messy real-world data.

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

OA at Palantir?
Invisible during screen share
Get it