Databricks Interview Questions
Practice the exact questions companies are asking right now.
Implement CIDR firewall matcher
Firewall Rule Matcher for IPv4 CIDR Rules Context and Assumptions You are to design and implement a firewall rule matcher that decides whether to acce...
Relate coefficients under linear feature transformation
Answer both parts. Part 1: Coefficients under feature transformation You have original predictors \(x_1, x_2\) and define transformed predictors: - \(...
Find top-5 most similar rows across datasets
You can solve this in SQL or Python. You are given two datasets with the same feature columns: Tables target_rows (rows you want to match) - target_id...
Find path in implicit Fibonacci tree
You are given a special family of binary trees called Fibonacci trees. The k‑th order Fibonacci tree T(k) is defined recursively: - T(1) is a single n...
Implement firewall matching with CIDR rules
Implement a simple IPv4 firewall rule matcher. Problem You are given an ordered list of firewall rules. Each rule has: - an action: ALLOW or DENY - a ...
Implement streaming RLE and bit-packed codec
You are implementing a simple compression scheme for sequences of 32‑bit signed integers. The codec should support two encoding strategies: 1. Run‑Len...
Design a digital game shop backend
Design the backend for a simple digital game shop where users can buy virtual items (e.g., games, in‑game currency, skins) using credits in their acco...
Design a multithreaded event logger
Design a multithreaded in-memory event logger for a server application. Requirements: - Many worker threads running in the process need to log events ...
Implement run-length encoding and decoding
You are given a string consisting of lowercase English letters. You need to implement run-length encoding (RLE) and its corresponding decoding. 1. Enc...
Implement a rate-limited hit counter
You are designing a hit counter that records the number of hits received in the past 5 minutes. Implement a class HitCounter with the following method...
Design a Slack-like messaging system
Design a Slack-like real-time team messaging system. Requirements: - Users can: - Create and join workspaces. - Create public and private channels...
Check if CIDR is fully canceled by rules
You are given: - A target CIDR block T as a string, e.g. "10.0.0.0/16". - A list of rule CIDR blocks. Each rule has: - A type: either "allow" or "de...
Find first CIDR block covering IP
You are given: - A single IPv4 address as a string, e.g. "192.168.1.5". - A list of CIDR blocks (IPv4), each as a string in the form "a.b.c.d/x", wher...
Compare ROC-AUC vs PR-AUC
Explain the difference between ROC-AUC and PR-AUC (Average Precision / area under the Precision–Recall curve). In your answer, cover: 1. What each cur...
Test if coin is fair from 560 tails
You flip a coin n = 1000 times and observe 560 tails. At significance level α = 0.05, test whether the coin is fair. Requirements: - State the null an...
Count weekly customers with ≥$1000 YTD spend
You are given a transaction-level table and need to compute a weekly time series. Table transactions - date (DATE) — transaction date (assume UTC and ...
Design Tic-Tac-Toe and QPS data structures
You are given two independent coding problems that focus on data structure and API design. --- Problem 1: Generalized Tic-Tac-Toe Game with Simple AI ...
Design KV store with sliding-window QPS metrics
Problem Design an in-memory key–value store that supports basic operations and can report the average operation load over a recent time window. Functi...
Find optimal commute mode in a city graph
You are designing a route planner that suggests the best way to commute between two points in a city using different transportation modes. The city is...
Implement RLE and bit-packing compression
You are asked to implement two related compression/decompression schemes: Run-Length Encoding (RLE) and bit-packing. --- Part 1 — Run-Length Encoding ...