PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Akuna Capital

Compute max profit across dated stock quotes

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's ability to reason about time-series and transaction-constrained optimization, including handling unsorted inputs, duplicate records, and constructing an explicit sequence of trades under ordering and no-short-selling constraints.

  • Medium
  • Akuna Capital
  • Coding & Algorithms
  • Software Engineer

Compute max profit across dated stock quotes

Company: Akuna Capital

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Take-home Project

You are given an unsorted list of price records for multiple stocks, each record as (date, symbol, price). Dates may be repeated across different symbols. Design an algorithm to compute the maximum profit and an explicit trading plan under these rules: ( 1) You can hold at most one share across all symbols at any time. ( 2) You may perform unlimited buy/sell transactions, but every buy must occur on a strictly later date than the previous sell (no same-day buy-and-sell for profit), and short selling is not allowed. ( 3) Assume prices are daily closes; if duplicates or missing dates occur, specify how you handle them. Return: (a) the maximum achievable profit, and (b) the sequence of trades (for each trade, list buy date, buy symbol, buy price, sell date, sell price). Explain your algorithm, prove correctness, and analyze time and space complexity. Discuss edge cases such as unsorted input, duplicate (date, symbol) rows, and non-monotonic dates.

Quick Answer: This question evaluates a candidate's ability to reason about time-series and transaction-constrained optimization, including handling unsorted inputs, duplicate records, and constructing an explicit sequence of trades under ordering and no-short-selling constraints.

Related Interview Questions

  • Find minimum swaps to sort array with duplicates - Akuna Capital (hard)
  • Heapify an array into a max-heap - Akuna Capital (Medium)
  • Implement a ring buffer - Akuna Capital (Medium)
  • Break a palindrome to smallest non-palindrome - Akuna Capital (Medium)
  • Compute min operations to transform integers - Akuna Capital (Medium)
Akuna Capital logo
Akuna Capital
Sep 6, 2025, 12:00 AM
Software Engineer
Take-home Project
Coding & Algorithms
9
0

You are given an unsorted list of price records for multiple stocks, each record as (date, symbol, price). Dates may be repeated across different symbols. Design an algorithm to compute the maximum profit and an explicit trading plan under these rules: (

  1. You can hold at most one share across all symbols at any time. (
  2. You may perform unlimited buy/sell transactions, but every buy must occur on a strictly later date than the previous sell (no same-day buy-and-sell for profit), and short selling is not allowed. (
  3. Assume prices are daily closes; if duplicates or missing dates occur, specify how you handle them. Return: (a) the maximum achievable profit, and (b) the sequence of trades (for each trade, list buy date, buy symbol, buy price, sell date, sell price). Explain your algorithm, prove correctness, and analyze time and space complexity. Discuss edge cases such as unsorted input, duplicate (date, symbol) rows, and non-monotonic dates.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

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