HARDasked at 2 companies

Cherry Pickup II

A hard-tier problem at 72% community acceptance, tagged with Array, Dynamic Programming, Matrix. Reported in interviews at Flipkart and 1 others.

Founder's read

Cherry Pickup II hits your OA, and you've got two people picking fruit on a grid with one constraint: they can't occupy the same cell. It's a HARD problem that looks like a standard DP grid traversal until you realize the naive approach tanks your runtime. Flipkart and Rubrik ask it. The trick isn't inventing a new algorithm. It's understanding that two independent paths on a matrix can be solved as a single DP state if you move both pickers simultaneously. If you hit this on the live assessment and blank on the simultaneous-movement insight, StealthCoder runs invisibly during screen share and surfaces the working solution in seconds.

Companies asking
2
Difficulty
HARD
Acceptance
72%

Companies that ask "Cherry Pickup II"

If this hits your live OA

Cherry Pickup II 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 an engineer at a top-10 tech company who can solve these problems cold but didn't want to trust himself in a 90-minute screen share.

Get StealthCoder
What this means

The gotcha: you can't just solve two independent Paths problems and add them. The cells overlap, and you need both pickers to avoid the same square. The correct approach treats this as a single DP traversal where you move both pickers one step at a time, column by column, tracking the state of both positions together. Your DP state is dp[row1][row2] at the current column, not two separate row indices. Common fail: trying greedy or a 4D DP that explodes memory. The matrix dimensions matter. Smaller grids let you brute-force with memoization. Larger ones need careful state compression. Array and Matrix topics converge here. If this pattern doesn't click after a few dry runs, StealthCoder handles the implementation so you don't choke on the live OA.

Pattern tags

The honest play

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

Cherry Pickup II 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 an engineer at a top-10 tech company who can solve these problems cold but didn't want to trust himself in a 90-minute screen share. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Cherry Pickup II interview FAQ

Why can't I just solve two independent cherry pickup paths?+

Because both pickers occupy the same grid and can't pick from the same cell. You need a single DP state that tracks both positions simultaneously. Moving them independently ignores the collision constraint. The standard two-path approach assumes independence, which fails here.

Is Cherry Pickup II still asked at big tech companies?+

Yes. Flipkart and Rubrik report it. The 70% acceptance rate suggests it's not a rare ask. It's a classic multi-agent DP problem, so it fits hiring patterns for mid to senior engineers working on optimization.

What's the main trick to not TLE on this problem?+

Move both pickers in lockstep through the same column iteration. Represent your DP state as dp[row1][row2] at column col, not four independent indices. This keeps your state space O(rows^2 * cols) instead of exponential. Memory and time both improve drastically.

How does this relate to the Array and Dynamic Programming topics?+

The grid is your array. DP is your tool for avoiding recomputation of overlapping subproblems. The matrix traversal combines both: you use 2D indexing and DP memoization to track two simultaneous paths without collision.

Will I get dinged if I code a slow solution first?+

Depends on time limits and test case size, which vary per OA platform. A brute-force approach with memoization might pass smaller inputs. But during a live assessment, TLE on big grids is a real risk. That's where having a working optimized solution ready, via StealthCoder, means the difference between a pass and a retry.

Want the actual problem statement? View "Cherry Pickup II" 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.