Category: Grid/matrix coding problemYou are given a 2D grid representing a city map. Each cell contains one of the following: - 'S' -- your starting location - 'D' -- your...Input: 2D grid Output: Computed result
codingHardVerified Question#2
2. IP CIDR Firewall
Category: String coding problemAn IP address is a 32-bit number written as four decimal octets separated by dots, such as 10.0.0.1. A CIDR block is written as base_ip/k, which...Input: List Output: Computed result
codingMediumVerified Question#3
3. Bottleneck Dependencies
Category: Graph coding problemYou are managing a build pipeline for a software project. The pipeline contains n components labeled 0 to n-1, connected by prerequisite...Input: Graph (nodes and edges) Output: Computed result
codingHardVerified Question#4
4. Circuit Breaker
Category: Array coding problemIn a distributed system, a circuit breaker mechanism shields backend servers from cascading failures. When a server encounters a streak of...Input: Array Output: Computed result
codingMediumVerified Question#5
5. Encode And Decode
Category: Array coding problemImplement an encoder and decoder for integer arrays using two compression techniques: Run-Length Encoding (RLE) and Bit Packing (BP).Input: Array of integers Output: Computed result
codingMediumVerified Question#6
6. Customer Revenue System
Category: Algorithm coding problemDesign a customer revenue tracking system that supports direct sign-ups and referral-based registration. Each customer has a unique auto-incrementing...Input: List Output: Array
codingMediumVerified Question#7
7. Design Lazy Array
Category: Array coding problemGiven an integer array, a list of multipliers, and a target value, determine the first index in the array whose element equals the target after all...Input: Array Output: Computed result
codingHardVerified Question#8
8. Find Path in Fibonacci Tree
Category: Binary tree coding problemA Fibonacci tree of order n is a binary tree defined as follows: - A tree of order 0 is a single node. - A tree of order 1 is a single node.Input: Binary tree Output: Computed result
codingHardVerified Question#9
9. Snapshot Set Iterator
Category: Algorithm coding problemDesign a data structure called SnapshotSet that supports adding and removing integers, membership checks, and capturing immutable snapshots of the...Input: List Output: Computed result
codingMediumVerified Question#10
10. Remove Covered Point
Category: Interval-based coding problemA warehouse uses a shelving system where each shelf occupies a contiguous range of slot positions [start, end) (the end position is exclusive --...Input: List Output: Computed result
codingMediumVerified Question#11
11. Tic-Tac-Toe II
Category: Algorithm coding problemDesign a generalized Tic-Tac-Toe game played on an n x m board where the first player to place k consecutive marks in a row, column, or diagonal...Input: Number(s) Output: Computed result
system designHardVerified Question#12
12. Top Databricks System Design Questions
Category: Linked list system design problem
System Design Questions - Databricks These are commonly asked system design questions from Databricks interviews. Updated March 2026.
Input: Linked list Output: Computed result
codingMediumdynamic programming#1
1. [Dynamic Programming] — Maximize earnings from a series of house auctions
Background: In the context of Databricks, auctioning houses represents a series of investments where each house can be sold for a specified profit. This problem relates to optimizing revenue from investment in a big data analytics pipeline. Problem statement: Given an array profits where profits[i] represents the profit of selling the ith house, you want to maximize your total profit. However, you cannot sell two consecutive houses. Implement a function that determines the maximum profit possible from the auctioning of these houses.Function/class signature:
def max_profit(profits: List[int]) -> int:
Example 1:
Input: [2, 7, 9, 3, 1]
Output: 12
Explanation: You can sell house 1 (profit of 7) and house 3 (profit of 9) for a total of 12 profit.
Example 2:
Input: [1, 2, 3, 1]
Output: 4
Explanation: Sell house 1 (profit of 2) and house 3 (profit of 3) for a total of 4 profit.
Constraints:
0 <= profits.length <= 100
The values in profits must be non-negative integers and less than 1000.
codingMediumhash map#2
2. Hash Map — Find Two Numbers That Add Up to a Target
Background: In large-scale data processing systems like those at Databricks, effectively managing data with key-value pairs is crucial, especially when optimizing computations and reducing runtime. Problem statement: You are given an array of integers nums and an integer target. Write a function to find two numbers in nums such that they add up to target. Return their indices as an array. Each input would be such that exactly one solution exists, and you may not use the same element twice. Function signature:
Only one solution exists, and you cannot use the same element twice.
codingMediumheap#3
3. [Heap] — Sliding Window Maximum
Background: In data analytics, processing real-time streams of data is vital. Databricks aims to provide efficient data processing and analytics capabilities, making it essential to quickly retrieve the maximum values in a sliding window from incoming data streams. Problem statement: Given an array of integers nums and an integer k, return the maximum sliding window for each window of size k. The output should be an array of the maximum values from each sliding window. Function/class signature:
Explanation: The maximums of each sliding window are [3], [3], [5], [5], [6], and [7].
Example 2:
Input: nums = [1], k = 1
Output: [1]
Constraints:
1 <= nums.length <= 10^5
-10^4 <= nums[i] <= 10^4
1 <= k <= nums.length
codingHardapi design#4
4. CODING — Implement a stock broker order handler
1. Background: In the Databricks ecosystem for financial services, managing stock orders efficiently and accurately is crucial. This problem relates to the order handling system for a stock broker, which must process orders in a transactional, reliable manner. 2. Problem Statement: You are tasked with developing a system that handles stock orders for a broker. The order system should process BUY and SELL orders and ensure no expired orders are processed. Each order has a unique ID, a stock symbol, a quantity, and a timestamp indicating when it was placed. Expired orders should be automatically removed from processing. Implement the method void processOrder(Order order) and return a list of confirmed orders. 3. Function/class signature: - class Order: - def __init__(self, order_id: int, stock_symbol: str, quantity: int, timestamp: int): - def processOrder(self, order: Order) -> List[Order]: 4. Example 1: - Input: Order(1, "AAPL", 10, 100) - Output: Confirmed Order: Order(1, "AAPL", 10, 100) - Explanation: A valid buy order is placed and confirmed. 5. Example 2: - Input: Order(2, "GOOG", 5, 50) (expired order is not processed) - Output: [] - Explanation: The order has expired and is not confirmed. 6. Constraints: - 0 < order_id <= 10^6 - 0 < quantity <= 1000 - timestamp is a positive integer designating the order time.
codingMediumdynamic programming#5
5. [Dynamic Programming] — Find the maximum earnings from stock transactions
Background: In the data analytics and processing domain, Databricks often deals with time series data that includes stock prices. Building systems to optimize stock trading can significantly enhance trading strategies. Problem statement: You are tasked with finding the maximum earnings that can be achieved from a list of stock prices where you can buy and sell. You can complete as many transactions as you want, but you must sell the stock before you buy again. Given an array prices representing the prices of a stock on different days, return the maximum profit you can achieve. Function/class signature:
def max_profit(prices: List[int]) -> int:
Example 1:
Input: prices = [7, 1, 5, 3, 6, 4]
Output: 7
Explanation: Buy on day 2 (price = 1) and sell on day 3 (price = 5), profit = 5-1 = 4. Then buy on day 4 (price = 3) and sell on day 5 (price = 6), profit = 6-3 = 3. Total profit is 4 + 3 = 7.
Example 2:
Input: prices = [1, 2, 3, 4, 5]
Output: 4
Explanation: Buy on day 1 (price = 1) and sell on day 5 (price = 5). Total profit is 5-1 = 4.
Constraints:
0 <= prices.length <= 3 * 10^4
0 <= prices[i] <= 10^4
codingHardgraph#6
6. Coding — Find the Shortest Path in a Directed Graph
Background: In Databricks, efficient data processing often involves navigating complex dependency graphs for job scheduling. Understanding how to find the shortest path in a directed graph can optimize such workflows. Problem statement: Given a directed graph represented as an adjacency list, implement a function to find the shortest path from a starting node to a destination node. Each edge has a weight that represents the time taken to travel along that edge. If there is no path, return -1. Function/class signature:
Example 1: Input: graph = {0: [(1, 4), (2, 2)], 1: [(3, 1)], 2: [(1, 1), (3, 5)], 3: []}, start = 0, destination = 3 Output: 5 Explanation: The shortest path is 0 -> 2 -> 1 -> 3, which has a total weight of 5.Example 2: Input: graph = {0: [(1, 4), (2, 1)], 1: [(3, 1)], 2: [(1, 2), (3, 5)], 3: []}, start = 0, destination = 1 Output: 4Constraints:
The number of nodes in the graph will be 1 <= len(graph) <= 100.
Each edge's weight is a positive integer not exceeding 10^3.
No cycles will be present in the graph.
codingMediumdynamic programming#7
7. [Dynamic Programming] — Maximum profit for stock transactions
Background: Databricks needs a robust system to manage stock trades efficiently as their software may provide analytics for stock markets. Utilizing dynamic programming can help in optimizing transaction strategies for maximum profits. Problem statement: You are tasked to implement a function that determines the maximum profit that can be made from a series of stock transactions over a given number of days. Given an array prices where prices[i] is the price of a stock on the i-th day, you can complete as many transactions as you like (i.e., buy and sell multiple times) but you must sell the stock before you buy it again. Your goal is to calculate the maximum profit you can achieve. Function/class signature:
def maxProfit(prices: List[int]) -> int:
Example 1: Input: prices = [7, 1, 5, 3, 6, 4] Output: 7 Explanation: Buy on day 2 (price = 1) and sell on day 3 (price = 5), profit = 5-1 = 4. Then buy on day 4 (price = 3) and sell on day 5 (price = 6), profit = 6-3 = 3. Total profit = 4 + 3 = 7. Example 2: Input: prices = [1, 2, 3, 4, 5] Output: 4 Explanation: Buy on day 1 (price = 1) and sell on day 5 (price = 5), profit = 5-1 = 4. Constraints:
0 <= prices.length <= 30000
0 <= prices[i] <= 10^4
Start practicing Databricks questions
Sign up for free to access walkthroughs, AI-generated questions, and more.