FastPrepKey-Value Store GET and PUT QPS
Problems/Key-Value Store GET and PUT QPS

Key-Value Store GET and PUT QPS

Databricks logoDatabricks● HardFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Databricks phone screen. The report leaves out the finite list of operations and how to write the output in any language. Our version is about 95% the same as the reported question.

Implement a key-value store that reports separate GET and PUT request rates over the trailing 300 seconds.

The function receives the server start time and a finite list of operations. Operations use nondecreasing integer-second timestamps and are processed in input order:

  • PUT|t|key|value stores or overwrites a string value and produces no output.
  • GET|t|key counts as a GET and produces VALUE:value when the key exists or NULL otherwise.
  • GET_LOAD|t counts as neither GET nor PUT and produces GET:a/b|PUT:c/d.

For a load query at time t, count requests in the half-open interval (t - 300, t]. Divide each count by min(t - serverStartTime, 300). Every GET_LOAD timestamp is strictly greater than the server start time. Write each fraction in lowest terms with a positive denominator; write zero as 0/1.

A request at the same timestamp as a GET_LOAD is included only when it appears earlier in the input.

Function

runLoadAwareStore(serverStartTime: long, operations: String[]) → String[]

Examples

Example 1

serverStartTime = 0operations = ["PUT|1|a|x","GET|2|a","GET|2|missing","GET_LOAD|3","GET_LOAD|301"]return = ["VALUE:x","NULL","GET:2/3|PUT:1/3","GET:1/150|PUT:0/1"]

The first load uses three seconds of uptime. At time 301, the PUT at time 1 is outside (1, 301], while both GET requests at time 2 remain in the window.

Constraints

  • 0 <= serverStartTime <= 10^9
  • 1 <= operations.length <= 200000
  • Operation timestamps are in [serverStartTime, 10^9] and are nondecreasing.
  • Every GET_LOAD time is greater than serverStartTime.
  • Keys and values contain 1 to 40 ASCII letters, digits, underscores, or hyphens.

More Databricks Phone Screen questions

  • Rolling Hit CounterPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Minimize CommuteOA · PHONE SCREEN · Seen Oct 2026
  • Top-K Values per Key in MapReducePHONE SCREEN · Seen Oct 2026
  • Customer Revenue with Direct ReferralsPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • File Encryption Tree OptimizationPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Encrypted File Count and Minimum TimePHONE SCREEN · Seen Sep 2026
  • Circuit Breaker Database FailoverPHONE SCREEN · Seen Aug 2026
  • Find First Anagram IndexPHONE SCREEN · Seen Aug 2026
  • Ordered IP FirewallPHONE SCREEN · Seen Aug 2026
  • Snapshot Set IteratorPHONE SCREEN · ONSITE INTERVIEW · Seen Jul 2026

Similar questions at other companies

  • Completions API Rate LimiterCursor · PHONE SCREENCursor interview questions
  • Per-Client Sliding-Window Rate LimiterGeneral Motors · OA
  • Metric Counter with a Fake ClockSnap Inc. · ONSITE INTERVIEWSnap Inc. interview questions
  • Per-Client Sliding-Window Rate LimiterNike, Inc. · ONSITE INTERVIEWNike, Inc. interview questions
  • 15-Minute Chat Session TrackerOpenAI · PHONE SCREEN · ONSITE INTERVIEWOpenAI interview questions
  • Dynamic Least-Loaded Job DispatcherCresta · PHONE SCREENCresta interview questions
  • Windowed Key-Value MapConfluent · PHONE SCREEN · ONSITE INTERVIEWConfluent interview questions
  • Rate Limiter with a Sliding Window per ClientStackAdapt · PHONE SCREENStackAdapt interview questions
  • Per-Client API Rate LimiterDocker · PHONE SCREEN
  • Per-Client Sliding-Window Rate LimiterCVS Health · PHONE SCREEN

Databricks interview experiences

  • Databricks Senior SWE Onsite AI Rounds: 1 Experience
All Databricks interview questionsSee Databricks hiring insights
Saved
class Solution {
    public String[] runLoadAwareStore(long serverStartTime, String[] operations) {
      // write your code here
    }

}
Checking account…