PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Coinbase

Maximize profit with transaction fee

Last updated: Mar 29, 2026

Quick Overview

This question evaluates algorithm design and optimization skills, focusing on reasoning about stateful dynamic programming or greedy strategies to maximize stock-trading profit when each sell incurs a transaction fee.

  • Medium
  • Coinbase
  • Coding & Algorithms
  • Software Engineer

Maximize profit with transaction fee

Company: Coinbase

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Onsite

Given an array of daily stock prices and a fixed transaction fee charged on each sell, compute the maximum profit achievable with any number of buy–sell transactions. Provide an O(n) time, O( 1) or O(n) space algorithm, prove correctness, and describe how you would handle edge cases such as empty input or strictly decreasing prices.

Quick Answer: This question evaluates algorithm design and optimization skills, focusing on reasoning about stateful dynamic programming or greedy strategies to maximize stock-trading profit when each sell incurs a transaction fee.

Related Interview Questions

  • Implement an In-Memory Database - Coinbase (hard)
  • Implement a Coin-Constrained Jump Strategy - Coinbase (hard)
  • Implement Game Physics and Block Mining - Coinbase (hard)
  • Compute Total Manual Distance - Coinbase (medium)
  • Implement a Flappy Bird Jump Agent - Coinbase
Coinbase logo
Coinbase
Aug 8, 2025, 12:00 AM
Software Engineer
Onsite
Coding & Algorithms
2
0

Given an array of daily stock prices and a fixed transaction fee charged on each sell, compute the maximum profit achievable with any number of buy–sell transactions. Provide an O(n) time, O(

  1. or O(n) space algorithm, prove correctness, and describe how you would handle edge cases such as empty input or strictly decreasing prices.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Coinbase•More Software Engineer•Coinbase Software Engineer•Coinbase 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.