PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|Home/Coding & Algorithms/Amazon

Maximize points with limited coworker skips

Last updated: Mar 29, 2026

Quick Overview

This question evaluates algorithmic problem-solving and optimization under sequential-turn constraints, testing competency in dynamic programming, combinatorial reasoning, and time/space complexity analysis.

  • Medium
  • Amazon
  • Coding & Algorithms
  • Software Engineer

Maximize points with limited coworker skips

Company: Amazon

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Take-home Project

You and a coworker must unload a sequence of warehouses. For warehouse i there are c[i] items (non‑negative integers). Turns alternate starting with you: on your turn you remove exactly m items; on the coworker’s turn they remove exactly n items (m,n are positive integers). If your move empties a warehouse (i.e., the last removal that makes its remaining items ≤ 0 is yours), you earn 1 point for that warehouse; otherwise you earn 0. You must alternate turns, except you may spend up to k total skip tokens across all warehouses: spending one token on the coworker’s upcoming turn causes them to skip that turn and you immediately take the next turn instead; skips may be used multiple times on the same warehouse or spread across warehouses, but the total number of skips used across all warehouses must be ≤ k. Determine the maximum total points you can earn, and design an algorithm to compute it efficiently. State the time and space complexity.

Quick Answer: This question evaluates algorithmic problem-solving and optimization under sequential-turn constraints, testing competency in dynamic programming, combinatorial reasoning, and time/space complexity analysis.

Related Interview Questions

  • Count Connected Components in an Undirected Graph - Amazon (medium)
  • Find Unique Target-Sum Pairs - Amazon (easy)
  • Find Valid IP Addresses in Files - Amazon (medium)
  • Implement Optimal Bucket Batching - Amazon (hard)
  • Implement Cache and Rotate Matrix - Amazon (medium)
Amazon logo
Amazon
Aug 13, 2025, 12:00 AM
Software Engineer
Take-home Project
Coding & Algorithms
1
0

You and a coworker must unload a sequence of warehouses. For warehouse i there are c[i] items (non‑negative integers). Turns alternate starting with you: on your turn you remove exactly m items; on the coworker’s turn they remove exactly n items (m,n are positive integers). If your move empties a warehouse (i.e., the last removal that makes its remaining items ≤ 0 is yours), you earn 1 point for that warehouse; otherwise you earn 0. You must alternate turns, except you may spend up to k total skip tokens across all warehouses: spending one token on the coworker’s upcoming turn causes them to skip that turn and you immediately take the next turn instead; skips may be used multiple times on the same warehouse or spread across warehouses, but the total number of skips used across all warehouses must be ≤ k. Determine the maximum total points you can earn, and design an algorithm to compute it efficiently. State the time and space complexity.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Amazon•More Software Engineer•Amazon Software Engineer•Amazon Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.