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

Time-Based Key-Value Store

Oracle logoOracle● MediumFULLTIMEPHONE SCREENONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Oracle phone screen. The report names the usual simple time-based key-value store. It does not list the operations, the edge cases, examples, or the input limits. We used the usual rules for that task. Our version is about 82% the same as the reported question.

Process timestamped set and get operations on a time-based key-value store.

  • A set stores the supplied value for its key and timestamp and returns "null".
  • A get returns the value for its key with the greatest stored timestamp that is at most the query timestamp. If no such value exists, return the empty string.

Process operations in their array order and return one result per operation.

Function

runTimeMap(operations: String[], keys: String[], values: String[], timestamps: int[]) → String[]

Examples

Example 1

operations = ["set","get","get","set","get"]keys = ["foo","foo","foo","foo","foo"]values = ["bar","","","bar2",""]timestamps = [1,1,3,4,4]return = ["null","bar","bar","null","bar2"]

Each query returns the latest value for foo whose stored timestamp does not exceed the query timestamp.

Example 2

operations = ["get","set","get"]keys = ["x","x","x"]values = ["","one",""]timestamps = [2,5,4]return = ["","null",""]

Neither query has a stored version at or before its timestamp.

Constraints

  • 1 <= operations.length <= 100000, and all four input arrays have the same length.
  • Each operation is exactly "set" or "get".
  • 1 <= key.length, value.length <= 100.
  • 1 <= timestamp <= 10^9.
  • For each key, timestamps supplied to set are strictly increasing.

More Oracle Phone Screen questions

  • Remove Parentheses from a Plus-Minus ExpressionPHONE SCREEN · Seen Nov 2026
  • Trapping Rain WaterPHONE SCREEN · Seen Oct 2026
  • Shortest Window by Distinct-Value SumPHONE SCREEN · Seen Oct 2026
  • Detect a Cycle in a Directed GraphPHONE SCREEN · Seen Oct 2026
  • Remove Adjacent Duplicates in String IIPHONE SCREEN · Seen Oct 2026
  • Sum Root-to-Leaf Binary NumbersPHONE SCREEN · Seen Oct 2026
  • Longest All-Present Attendance StreakPHONE SCREEN · Seen Oct 2026
  • Next PermutationPHONE SCREEN · Seen Sep 2026
  • Valid ParenthesesPHONE SCREEN · Seen Sep 2026
  • Valid Parenthesis StringPHONE SCREEN · Seen Sep 2026

Similar questions at other companies

  • Consistent-Hash Packet RouterAmazon · PHONE SCREEN
  • Snapshot Map with Sparse Version HistorySnorkel AI · PHONE SCREEN
  • Time-Based Key-Value StoreCockroach Labs · PHONE SCREEN · ONSITE INTERVIEW
  • Time Map with Sum and AverageConfluent · PHONE SCREENConfluent interview questions
  • Structured Log Stream with QueriesOpenAI · PHONE SCREENOpenAI interview questions
  • 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
  • Time-Based Key-Value StoreVerkada · PHONE SCREENVerkada interview questions

Oracle interview experiences

  • Oracle SWE Onsite Interview Experience: 1 Experience
All Oracle interview questionsSee Oracle hiring insights
Saved
class Solution {
    public String[] runTimeMap(String[] operations, String[] keys, String[] values, int[] timestamps) {
        // Write your code here.
    }
}
Checking account…