Unify Stock-Trading Profit Variants

Quick Overview

Implement one stock-profit interface for limited transactions, unlimited transactions, and per-sale fees. Model cash and holding states, handle zero or negative-value edge cases, and optimize the finite-cap dynamic program when the transaction limit cannot bind.

Unify Stock-Trading Profit Variants

Company: Amazon

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: easy

Interview Round: Technical Screen

Overview: Implement one stock-profit interface for limited transactions, unlimited transactions, and per-sale fees. Model cash and holding states, handle zero or negative-value edge cases, and optimize the finite-cap dynamic program when the transaction limit cannot bind.

|Home/Coding & Algorithms/Amazon
Amazon logo
Amazon
Jul 4, 2026
easySoftware EngineerTechnical ScreenCoding & Algorithms
3
0
Loading...

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...