FastPrepTask Manager with Timed Assignments
Problems/Task Manager with Timed Assignments

Task Manager with Timed Assignments

Ramp logoRamp● HardFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Ramp online assessment. The report gives the full method rules of four levels: creating tasks, searching and listing by priority, users with assignment quotas limited by time, completion, and overdue queries. We added a fixed list of operations so it can be written the same way in every language. Our version is about 97% the same as the reported question.

Process a finite sequence of timestamped operations for an in-memory task manager. Timestamps are strictly increasing. Return one string-list row for every operation.

Tasks

  • ["ADD_TASK", timestamp, name, priority]: create a task and return its ID. IDs are task_id_1, task_id_2, and so on. Equal names and priorities are allowed.
  • ["UPDATE_TASK", timestamp, taskId, name, priority]: replace a task's name and priority. Return a one-element lowercase boolean row.
  • ["GET_TASK", timestamp, taskId]: return one compact JSON string, {"name":"NAME","priority":P}, or an empty row when missing.
  • ["SEARCH_TASKS", timestamp, nameFilter, maxResults]: return up to maxResults IDs whose names contain the case-sensitive filter. Sort by priority descending, then numeric creation order ascending. A nonpositive limit returns an empty row.
  • ["LIST_TASKS_SORTED", timestamp, limit]: return up to limit IDs with the same priority and creation-order sort.

Users and Timed Assignments

  • ["ADD_USER", timestamp, userId, quota]: create a user whose quota is the maximum number of simultaneously active assignments. Return a one-element lowercase boolean row.
  • ["ASSIGN_TASK", timestamp, taskId, userId, finishTime]: create an assignment active on the half-open interval [timestamp, finishTime). It fails when the task or user is missing, finishTime <= timestamp, the user's quota is full, or that task already has an active assignment. A task may be assigned again after its prior assignment completes or expires.
  • ["GET_USER_TASKS", timestamp, userId]: return the user's currently active task IDs in numeric creation order, or an empty row for a missing user.
  • ["COMPLETE_TASK", timestamp, taskId, userId]: complete the matching active assignment and immediately free its quota slot. Return a one-element lowercase boolean row.
  • ["GET_OVERDUE_ASSIGNMENTS", timestamp, userId]: return one task ID for every assignment to that user whose finishTime <= timestamp and which was not completed. Order by finish time ascending and then assignment creation order. A task assigned in multiple expired intervals can appear more than once.

Runner Interface

manageTasks accepts String[][] operations and returns String[][].

Function

manageTasks(operations: String[][]) → String[][]

Examples

Example 1

operations = [["ADD_TASK","1","Alpha","5"],["ADD_TASK","2","Beta","7"],["ADD_TASK","3","Alpha detail","7"],["GET_TASK","4","task_id_1"],["SEARCH_TASKS","5","Alpha","2"],["LIST_TASKS_SORTED","6","2"],["UPDATE_TASK","7","task_id_1","Alpha high","9"],["LIST_TASKS_SORTED","8","3"]]return = [["task_id_1"],["task_id_2"],["task_id_3"],["{\"name\":\"Alpha\",\"priority\":5}"],["task_id_3","task_id_1"],["task_id_2","task_id_3"],["true"],["task_id_1","task_id_2","task_id_3"]]

Search keeps only case-sensitive matches. Priority orders results first, and the numeric task sequence breaks the tie between tasks 2 and 3.

Example 2

operations = [["ADD_TASK","1","One","1"],["ADD_TASK","2","Two","2"],["ADD_USER","3","u","1"],["ASSIGN_TASK","4","task_id_1","u","10"],["ASSIGN_TASK","5","task_id_2","u","8"],["GET_USER_TASKS","9","u"],["GET_USER_TASKS","10","u"],["ASSIGN_TASK","11","task_id_2","u","14"],["COMPLETE_TASK","12","task_id_2","u"],["ASSIGN_TASK","13","task_id_1","u","20"],["GET_USER_TASKS","14","u"]]return = [["task_id_1"],["task_id_2"],["true"],["true"],["false"],["task_id_1"],[],["true"],["true"],["true"],["task_id_1"]]

The first assignment occupies the only quota slot through timestamps below 10. Expiration and completion each free the slot immediately.

Example 3

operations = [["ADD_TASK","1","One","1"],["ADD_TASK","2","Two","1"],["ADD_USER","3","u","2"],["ASSIGN_TASK","4","task_id_1","u","7"],["ASSIGN_TASK","5","task_id_2","u","10"],["COMPLETE_TASK","6","task_id_1","u"],["GET_OVERDUE_ASSIGNMENTS","7","u"],["GET_OVERDUE_ASSIGNMENTS","10","u"],["COMPLETE_TASK","11","task_id_2","u"],["ASSIGN_TASK","12","task_id_2","u","13"],["GET_OVERDUE_ASSIGNMENTS","14","u"]]return = [["task_id_1"],["task_id_2"],["true"],["true"],["true"],["true"],[],["task_id_2"],["false"],["true"],["task_id_2","task_id_2"]]

Completing task 1 before its finish time prevents it from becoming overdue. Task 2 expires twice without completion, so both overdue assignments remain in history.

Constraints

  • 1 <= operations.length <= 10^4.
  • Operation timestamps are distinct, strictly increasing integers in [0, 10^9].
  • Priorities and quotas are integers in [0, 10^9]; limits fit in signed 32-bit integers.
  • Every successful assignment has timestamp < finishTime <= 10^9.
  • Task names have 1 to 80 ASCII letters, digits, spaces, underscores, or hyphens. User IDs have 1 to 40 ASCII letters, digits, underscores, or hyphens.
  • Name filters contain at most 80 printable ASCII characters and may be empty.

More Ramp interview questions

  • Count Overlapping Square PairsOA · Seen Nov 2026
  • Count User Mentions in Chat MessagesOA · Seen Nov 2026
  • Accept or Decline QueriesOA · Seen Sep 2026
  • Recipe Management SystemOA · Seen Mar 2026
  • Bank Requests with Delayed CashbackOA · Seen Dec 2025
  • Convert Snake Case Variables to Camel CaseOA · Seen Apr 2025
  • Correct Apartment Bedroom CountsOA · Seen Feb 2025
  • Retryable URL MazePHONE SCREEN · Seen Oct 2026
  • Detect Recurring Transactions with Tunable TolerancesONSITE INTERVIEW · Seen Jul 2026
  • Find a User’s Airport from Flight HistoryPHONE SCREEN · Seen Sep 2025

Similar questions at other companies

  • In-Memory File SystemAirbnb · OAAirbnb interview questions
  • Power Cell BankOptiver · OAOptiver interview questions
  • Four-Level Banking System with Scheduled PaymentsZipRecruiter · OAZipRecruiter interview questions
  • Task Management SystemCoinbase · OACoinbase interview questions
  • Task Management SystemAnthropic · OAAnthropic interview questions
  • Progressive Parcel Tracking OperationsKlaviyo · OAKlaviyo interview questions
  • Versioned Recipe SystemThe Trade Desk · OA
  • Document and Layer OperationsFigma · OAFigma interview questions
  • Worker Management with Promotions and Double-Paid TimeInstacart · ONSITE INTERVIEWInstacart interview questions
  • Document Enrichment Stream AggregatorBloomberg LP · PHONE SCREENBloomberg LP interview questions

Ramp interview experiences

  • Ramp interviews · November 2026
  • Ramp AI Coding Round, Experienced SWE Onsite: 3 Experiences
  • Ramp SWE New Grad OA and Phone Screen: 7 Experiences
  • Ramp Mobile and Android Interview Questions: 6 Experiences
All Ramp interview questionsSee Ramp hiring insights
Saved
class Solution {
    public String[][] manageTasks(String[][] operations) {
      // write your code here
    }

}
Checking account…