Admit Outbound Calls Under Per-Account Concurrency Limits

Last updated: November 29, 2026

Quick Overview

Given call requests (call_id, account, start, duration) and a per-account limit on simultaneous calls, return the ids of calls that must be rejected because the account already has the maximum number of calls in progress.

Retell AI
Coding & Algorithms
Software Engineer
Retell AI
November 29, 2026
Software Engineer
Phone Screen
Coding & Algorithms
Medium

0

0

0 solved


Given call requests (call_id, account, start, duration) and a per-account limit on simultaneous calls, return the ids of calls that must be rejected because the account already has the maximum number of calls in progress.

Retell plans include a cap on concurrent calls per workspace, and the dialer has to enforce it exactly as calls start and end. This checks event-ordered simulation with a heap per tenant and careful tie handling at boundaries.

What the Interviewer Expects
  • Process requests in start-time order with a deterministic tie-break
  • Keep a min-heap of end times per account
  • Release calls that ended at or before the new start
  • Fall back to a default limit for unknown accounts
  • State O(n log n) complexity
Key Topics to Cover
heaps
event simulation
multi-tenant limits
concurrency control
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
  • Instead of rejecting, queue calls and start them when a slot frees; what changes?
  • How would you enforce this across many dialer servers with a shared store?
  • How do you handle calls whose duration is unknown at start time?
  • How would you add a global carrier-level cap on top of per-account caps?
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

Durations are known for this offline version. A call ending at time t frees its slot for a call starting at t. Requests tied on start time are processed by call_id for determinism. Output rejected ids...

High-Level Design

Sort requests. For each account keep a min-heap of end times of admitted calls. Before admitting, pop every end time <= start; if the heap size is still at the limit, reject, otherwise push `start +...


Submit Your Answer
Markdown supported

Related Questions