Databricks Software Engineer Interview Questions
Master your tech interview with our curated database of real questions from top companies.
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...
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...
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 ...
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...
Design bookstore and chat messaging systems
You are given two independent system-design problems. --- Question A — Design an Online Bookstore Backend Design the backend for a large-scale online ...
Explain storing files to disk with concurrency
You are working on the backend of a server that receives file uploads (for example, images or documents) from clients. You need to design and explain ...
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 ...
Design a generic key-value store
Design a Generic, Type-Safe Key-Value Store API Context You're asked to design a reusable key-value store with a generic, user-friendly API suitable f...
Identify and handle race conditions
Concurrency in an In-Memory Key-Value Store and Hit Counter Context and Assumptions Assume you are implementing an in-memory key-value store and a hit...
Design a thread-safe bounded queue
Design a Thread-Safe Bounded MPMC Queue with Timeouts and Fairness Context You are building a reusable, in-memory, bounded queue that supports multipl...
Design IP/CIDR rule matcher
Design and implement a rule matcher that returns 'accept' or 'deny' for a given IPv4 address based on a set of rules. Each rule can be either an inclu...
Describe your background and impact
Walk Me Through Your Background (HR Screen — Software Engineer) Prompt Provide a concise walkthrough of your background focusing on: 1. Most relevant ...
Implement a sliding-window hit counter
Implement a hit counter that supports recordHit(timestamp) and getHits(pastSeconds). Use a fixed-size array to maintain a sliding time window (e.g., l...
Design BFS to detect forced win in Tic-Tac-Toe
You are given an n×n Tic-Tac-Toe–like board and a target k (1 ≤ k ≤ n). From the current board state and the player to move, design an algorithm to de...
Implement a snapshotable set with iterators
Implement a SnapshotSet data structure with the following API: add(x), remove(x), contains(x), snapshot() -> sid, and iterate(sid) -> iterator over th...