FastPrepIndexed In-Memory Table
Problems/Indexed In-Memory Table

Indexed In-Memory Table

Retell AI logoRetell AI● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Retell AI phone screen. The report names an in-memory table with an index that keeps state. It does not give the schema, the operations, or the output. The fixed list of operations below keeps the table and the secondary-index behavior. Our version is about 58% the same as the reported question.

Execute the commands in operations against an in-memory table. Each row has a unique integer id, a string tag, and a string value. The table maintains an equality index on tag.

  • INSERT:id:tag:value inserts a row and outputs true. If id already exists, it changes nothing and outputs false.
  • UPDATE:id:tag:value replaces the tag and value of an existing row and outputs true. If id is absent, it outputs false.
  • DELETE:id removes an existing row and outputs true. If id is absent, it outputs false.
  • FIND:tag outputs matching row IDs in ascending order using bracket notation such as [1,4]. It outputs [] when no row has that tag.

Return one string output for every command, in command order. Every lookup observes all preceding mutations.

Function

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

Examples

Example 1

operations = ["INSERT:2:blue:x","INSERT:1:blue:y","FIND:blue","UPDATE:2:red:z","FIND:blue","DELETE:1","FIND:blue"]return = ["true","true","[1,2]","true","[1]","true","[]"]

The first lookup uses the secondary index to return IDs 1 and 2 in sorted order. Updating row 2 removes it from the blue index, and deleting row 1 leaves that index empty.

Example 2

operations = ["INSERT:7:a:v","INSERT:7:b:w","UPDATE:9:a:x","DELETE:9","FIND:a"]return = ["true","false","false","false","[7]"]

Duplicate insertion and mutations of missing IDs fail without changing the existing row.

Constraints

  • 1 <= operations.length <= 100000.
  • Each command has exactly one documented format.
  • Every id is between 0 and 10^9.
  • Each tag and value contains 1 to 32 ASCII letters, digits, underscores, or hyphens and contains no colon.

More Retell AI Phone Screen questions

  • Stack Language EvaluatorPHONE SCREEN · Seen Sep 2026

Similar questions at other companies

  • Dasher Pay with Store Waits and Peak HoursDoorDash · PHONE SCREENDoorDash interview questions
  • Recipe Rating ServiceNubank · PHONE SCREEN
  • Redeemable Promotion OffersAffirm · PHONE SCREENAffirm interview questions
  • Rectangle Point Coverage CountsOpenAI · PHONE SCREEN · ONSITE INTERVIEWOpenAI interview questions
  • Invoice / Payment ReconciliationStripe · PHONE SCREEN · ONSITE INTERVIEWStripe interview questions
  • LRU CacheApple · PHONE SCREEN · ONSITE INTERVIEWApple interview questions
  • LRU Cache for Query ResultsAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Logger Rate Limiter with Every-Arrival HistoryGoogle · PHONE SCREENGoogle interview questions
  • LRU CacheAthenahealth · PHONE SCREEN
  • Collatz Conjecture with Shared MemoizationBloomberg LP · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions

Retell AI interview experiences

  • Retell AI Experienced SWE Interviews and Onsite: 1 Experience
All Retell AI interview questionsSee Retell AI hiring insights
Saved
class Solution {
    public String[] runIndexedTable(String[] operations) {
      // Write your code here.
    }
}
Checking account…