← Questions

Customer revenue with referral credit and bottom-k query

0
DatabricksUberCodingLast asked Sep 2026

A coding interview question asked in Databricks's algorithms (two rounds) round and at Uber, last asked Sep 2026. It tests design, sorted-set and binary-search.

Build an in-memory system that tracks how much revenue each customer brings in, including revenue from the customers they referred. Customers get integer ids starting at 0, in the order they are added.

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

  • Databricks · Algorithms (two rounds) · Last asked Sep 202660 min · Live coding in CoderPad or similar
  • Uber · Coding · Last asked Apr 202660 min · Two rounds; one is often object-oriented design (a parking lot, a meeting scheduler, an expression evaluator) · No AI, except a newer AI-assisted debugging round in some senior loops

What it tests

design · sorted-set · binary-search · trees

Your code and the AI tutor open when you unlock this question.