Maximize Withdrawals Signed Before Their SLA Deadlines

Last updated: November 29, 2026

Quick Overview

Each large withdrawal needs a signing ceremony of known duration, only one ceremony runs at a time, and each request has a deadline. Choose the largest set of requests that can all finish on time and the order to sign them.

Coinbase
Coding & Algorithms
Software Engineer
Coinbase
November 29, 2026
Software Engineer
Onsite
Coding & Algorithms
Hard

0

0

0 solved


Each large withdrawal needs a signing ceremony of known duration, only one ceremony runs at a time, and each request has a deadline. Choose the largest set of requests that can all finish on time and the order to sign them.

Coinbase Prime and custody withdrawals from cold storage go through slow, multi-party approval and signing, and clients have contractual timing expectations. The interviewer looks for the exchange-argument greedy: process by deadline, keep a max-heap of durations and drop the longest when time runs over.

What the Interviewer Expects
  • Sort requests by deadline (earliest deadline first)
  • Keep a max-heap of chosen durations and running elapsed time
  • When elapsed exceeds the current deadline, drop the longest chosen job
  • Explain why dropping the longest is safe via an exchange argument
  • Return the chosen set in deadline order
Key Topics to Cover
greedy
heaps
scheduling
exchange argument
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • What if requests have different values and you maximize total value instead of count?
  • How would you handle two parallel signing teams?
  • What changes if new requests arrive while you are signing?
  • How would you prioritize when some deadlines are regulatory and others are soft?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Input: (id, duration, deadline) in minutes, start at time 0, one job at a time, no preemption. Output: ids of a maximum-size feasible set, ordered so each finishes by its deadline....

High-Level Design

For a fixed set, earliest-deadline-first order is feasible if any order is, so scan by deadline. Add each request to the chosen set and to elapsed time. If elapsed now exceeds this deadline, remove th...


Submit Your Answer
Markdown supported