Tag: dynamic-programming
Interview Questions
- Best contiguous stretch of daily returns
- Two trades with a per-trade commission
- At most k trades on one price path
- Two non-overlapping subarrays of any length
- Best two non-overlapping trades
- Allocate a fixed budget across strategies
- Count the ways to make change
- Fewest perfect squares that sum to n
- Count ordered ways to reach a target
- Rod cutting for maximum revenue
- Coin change, fewest coins for an amount
- Even or odd set bits for every number up to n
- Total set bits across 1..n
- Count set bits for every number up to n
- How many shapes can an order-matching tree take?
- How many ways to decode a trade-ticket code
- Longest common subsequence of two event logs
- Edit distance when substitutions cost more
- Fewest deletions to make two configs identical
- Longest identical block in two data streams
- Edit distance between two symbols
- Split positions into two equal-risk books
- Counting stair climbs without the exponential blow-up
- Tribonacci, three-way recursion but still linear
- Counting grid paths, top-down then bottom-up
- Binary strings with no two adjacent ones
- Fibonacci, from exponential to linear
- Fewest tests to locate a fragile price level
- Longest run-up-then-run-down in prices
- Longest shared pattern between two signal streams
- Longest palindromic subsequence
- Longest rising streak hidden inside a price series
- Longest choppy zigzag inside a price series
- Best cumulative gain run
- Minimum-cost path through a grid
- Counting grid paths around obstacles
- Grid path that may also step diagonally
- Minimum falling path through a matrix
- Maximum-value path through a grid
- Best compounding streak with sign flips
- Best profit when each trade pays a fee
- Best profit with at most two trades
- At most k trades, each charged a fee
- Split k trades across two assets
- Best profit with at most k trades
- Cheapest path through a fee grid
- Fewest hops to reach settlement
- Max PnL when consecutive-day trades are forbidden
- Can a signal tape be split into known patterns?
- Trading profit with a two-day cooldown
- Cooldown plus a transaction fee
- Trading with a minimum holding period
- Trading with a daily holding cost
- Max trading profit with a cooldown
- Pick non-overlapping trades for maximum profit