Interview Intel · HP

HP coding interview
questions, leaked.

3 problems reported across recent HP interviews. Top patterns: string, greedy, sliding window. The list below is what most reported candidates actually saw, plus the honest play if you can't grind all of it.

Founder's read

HP's coding assessment is small but dense. You're looking at three problems spanning string manipulation, greedy logic, and sliding window work. Two are easy, one medium, zero hard. The catch: the easy problems aren't warm-ups. Both pull from overlapping topics (string and greedy appear twice), so HP is testing pattern recognition across similar problem shapes. If you freeze on greedy during the live assessment, StealthCoder surfaces a working solution in seconds, invisible to the proctor. You won't need it often, but when you do, it's there.

Tracked problems
3
Easy
2/ 67%
Medium
1/ 33%
Hard
0/ 0%

Top problems at HP

leaked_problems.csv3 rows
#ProblemDiffFrequency
01Minimum Recolors to Get K Consecutive Black BlocksEASY
100.0
02Minimum Cost Homecoming of a Robot in a GridMEDIUM
91.0
03Longest PalindromeEASY
84.5

Frequencies derived from public community-tagged interview reports. Click a row to view on LeetCode.

The hedge

You have a week, maybe less. You can't out-grind the list above. StealthCoder runs invisibly during the actual HP OA. The proctor cannot see it. Screen share cannot detect it. Made by a working FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know.

Get StealthCoder
Topic distribution
What this means

String and greedy dominate the assessment. String appears in two of your three problems; greedy also shows up twice and is the conceptual core of at least one medium. Sliding window and array round out the distribution but aren't the focus. Hit string problems first, then shift to greedy logic. The easy problems aren't trivial; both demand clean implementation. The medium problem (Minimum Cost Homecoming) combines array thinking with greedy choice, so you'll need to reason about state transitions, not just data structures. Hash table is minimal exposure but shows up in one easy problem. During the live OA, you're unlikely to hit hard problems, so your preparation should focus on drilling the easy patterns until they're reflexive, then spend time on the greedy trade-offs in the medium. StealthCoder is your hedge if you blank on greedy logic mid-interview.

Companies with similar patterns

If you prepped for HP, these companies recycle ~60% of the same topics.

The honest play

You've seen the list. Now make sure you pass HP.

Memorizing every problem above in a week is a fantasy. StealthCoder is the hedge: an AI overlay that's invisible during screen share. It reads the problem on screen and surfaces a working solution in under 2 seconds. Made by a working FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know. Works on HackerRank, CodeSignal, CoderPad, and Karat.

HP interview FAQ

Should I spend more time on string or greedy for HP?+

Both are equally weighted in the assessment. String shows up twice, greedy also twice. Prioritize string first because two of your three problems are easy and string-heavy; getting those right quickly builds confidence. Then lock down greedy logic for the medium problem.

Do I need to practice sliding window separately for HP?+

No. Sliding window appears once and is bundled with string in the same problem. If you drill the string problems, sliding window will surface naturally. It's not a separate focus area here.

Is hash table worth preparing for this assessment?+

Yes, but it's secondary. Hash table appears in one easy problem (Longest Palindrome). Knock it out as a warm-up before the assessment, but don't spend disproportionate time on it. String and greedy are the real weights.

How much should I worry about the medium problem difficulty jump?+

The medium (Minimum Cost Homecoming) isn't a huge leap from the easy problems. It's more about holding multiple constraints in your head while making greedy choices. If you drill greedy logic during preparation, you'll handle it.

What's my study order for the night before HP?+

String problems first (you get two easy wins), then hash table (one easy), then spend the remaining time on the medium problem and greedy logic. You're unlikely to hit hard problems, so don't waste time on advanced patterns.

Problem frequencies sourced from public community-maintained interview-report repos. Problems, ratings, and trademarks are property of LeetCode and HP. StealthCoder is not affiliated with HP.