FastPrepTime-Based Key-Value Database
Problems/Time-Based Key-Value Database

Time-Based Key-Value Database

Illumio logoIllumio● MediumFULLTIMEONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Illumio onsite interview. The report describes a time-based database coding task and asks the candidate to design its API. It does not give the exact rules for timestamps, lookups, or how a batch is run. Our version is about 90% the same as the reported question.

Process operations on a time-based key-value database.

Each operation is one of:

  • ["SET", key, value, timestamp]: store value for key at the integer timestamp.
  • ["GET", key, timestamp]: return the value stored for key at the greatest timestamp less than or equal to the requested timestamp. Return the empty string when no such value exists.

SET timestamps are strictly increasing for each individual key. GET timestamps may arrive in any order. Return one string for every GET operation, in operation order.

Function

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

Examples

Example 1

operations = [["SET","foo","bar","1"],["GET","foo","1"],["GET","foo","3"],["SET","foo","bar2","4"],["GET","foo","4"],["GET","foo","5"]]return = ["bar","bar","bar2","bar2"]

The first two reads use the value stored at timestamp 1. Once bar2 is stored at timestamp 4, reads at 4 and later return it.

Example 2

operations = [["GET","missing","2"],["SET","a","one","3"],["SET","b","two","5"],["GET","a","2"],["GET","a","10"],["GET","b","5"]]return = ["","","one","two"]

A missing key and a query before a key's first timestamp both return the empty string. Keys keep independent histories.

Constraints

  • 1 <= operations.length <= 20000
  • Every operation has a valid name and arity.
  • Keys and stored values are non-empty strings.
  • 0 <= timestamp <= 10^9
  • SET timestamps are strictly increasing for each key.

More Illumio interview questions

  • Exclusive Function TimePHONE SCREEN · Seen Oct 2026
  • Lexicographic Dependency OrderPHONE SCREEN · Seen Oct 2026
  • Least Recently Used CachePHONE SCREEN · Seen Aug 2026

Similar questions at other companies

  • Time-Based Key-Value StoreOracle · PHONE SCREEN · ONSITE INTERVIEWOracle interview questions
  • Time-Based Key-Value StoreCockroach Labs · PHONE SCREEN · ONSITE INTERVIEW
  • Time-Indexed Key-Value StoreTogether AI · ONSITE INTERVIEW
  • Globally Versioned Key-Value StoreLyft · ONSITE INTERVIEWLyft interview questions
  • Versioned Key-Value Store with Suffix TruncationNuro · ONSITE INTERVIEWNuro interview questions
  • Future-Effective Employee SalaryRippling · ONSITE INTERVIEWRippling interview questions
  • Key-Value Store with Hit CounterDatabricks · ONSITE INTERVIEWDatabricks interview questions
  • Transaction Event StoreCapital One · ONSITE INTERVIEWCapital One interview questions
  • Time Based Key-Value StoreNavan · ONSITE INTERVIEWNavan interview questions
  • Versioned Social NetworkOpenAI · PHONE SCREEN · ONSITE INTERVIEWOpenAI interview questions
All Illumio interview questionsSee Illumio hiring insights
Saved
class Solution {
    public String[] runTimeDatabase(String[][] operations) {
        // Write your code here.
    }
}
Checking account…