MEDIUMasked at 3 companies

Maximum Points You Can Obtain from Cards

A medium-tier problem at 56% community acceptance, tagged with Array, Sliding Window, Prefix Sum. Reported in interviews at Flipkart and 2 others.

Founder's read

Maximum Points You Can Obtain from Cards is a medium-difficulty array problem that appears in interviews at Flipkart, DE Shaw, and Uber. The premise is simple: you're given an array of card values and can take k cards from either end. You need to maximize points. It's a deceptive problem because the greedy approach (always take the highest value card) fails, and many candidates waste time chasing it. The acceptance rate sits at 55%, which means nearly half the people hitting it live blank or timeout. If you haven't internalized the sliding window inversion, StealthCoder runs invisibly during your assessment and surfaces the solution before you've wasted fifteen minutes.

Companies asking
3
Difficulty
MEDIUM
Acceptance
56%

Companies that ask "Maximum Points You Can Obtain from Cards"

If this hits your live OA

Maximum Points You Can Obtain from Cards 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 by a working FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know.

Get StealthCoder
What this means

The trick is inverting the problem. Instead of picking k cards from the ends, think about which n minus k consecutive cards you want to leave in the middle, then minimize their sum. That transforms the problem into a sliding window over a contiguous subarray. Build a prefix sum for speed, slide a fixed-size window across the middle segment, find the minimum subarray sum, then subtract it from the total. Most candidates get stuck trying to track all possible combinations of left and right picks, or they jump straight to recursion without spotting the window. The problem is designed to test whether you can reframe constraints. If you're already comfortable with prefix sums and the sliding window pattern, it's under five minutes. If not, you'll second-guess yourself. This is exactly the scenario StealthCoder protects against: when the pattern doesn't click in the live environment, the overlay delivers a working solution.

Pattern tags

The honest play

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

Maximum Points You Can Obtain from Cards 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 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.

Maximum Points You Can Obtain from Cards interview FAQ

Is this problem actually as hard as the medium tag suggests?+

The 55% acceptance rate says yes. The difficulty isn't the code, it's seeing the inversion. Once you frame it as 'minimize the middle, maximize the ends,' it's straightforward sliding window. Most failures come from picking the wrong approach in the first few minutes.

Does Flipkart, DE Shaw, or Uber ask it often?+

All three are confirmed to have asked it. This isn't a niche problem. If you're interviewing at any of those shops, you should have the pattern down cold before you hit the live session.

What's the connection between sliding window and prefix sum here?+

Prefix sum lets you compute any subarray sum in O(1) after O(n) preprocessing. The sliding window then runs in O(n) total, scanning all valid middle segments. Together they give you a clean O(n) solution with no nested loops.

Will a brute-force two-pointer approach pass?+

No. Trying all combinations of left and right picks is O(n squared) or worse. The judge will timeout. You need to see the inversion and land on O(n) with prefix sum and sliding window.

What happens if I freeze on this in a live OA?+

You either skip it and lose points, or you spend 20 minutes going in circles. This is where a safety net matters. StealthCoder reads the problem on screen and gives you a working solution in seconds, invisible to the proctor.

Want the actual problem statement? View "Maximum Points You Can Obtain from Cards" 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.