Problem database last updated: June 20, 2025

DDatabricks logo

Databricks Coding Interview Questions

27 problems · 1 Easy, 17 Medium, 9 Hard · Ranked #73 of 458

Difficulty breakdown

1 Easy

4% · avg 23%

17 Medium

63% · avg 59%

9 Hard

33% · avg 18%

Top topics

array
66.7%
hash-table
37%1.7x
string
29.6%
binary-search
25.9%2.9x
design
22.2%3.8x
ordered-set
18.5%18.3x

Interview profile

Based on 27 reported problems, Databricks interviews are significantly harder than average - 33% Hard vs 18% across all companies. The majority (63%) of questions are Medium difficulty, which is typical for companies that want to see solid fundamentals without excessive trick questions.

Compared to the industry average, Databricks puts unusual emphasis on ordered-set (18.5% of problems, 18.3x the industry average), data-stream (7.4% of problems, 11.1x the industry average), enumeration (7.4% of problems, 9.1x the industry average). If you're short on time, these are the categories to double down on.

The most common topics are array (66.7%), hash-table (37%), string (29.6%), binary-search (25.9%). Problems below are sorted by frequency, the ones at the top are asked most often.

All 27 problems

House Robber

Solve

You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from rob...

MediumVery Likely
arraydynamic-programming

House Robber II

Solve

You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. All houses at this place are arranged in...

MediumVery Likely
arraydynamic-programming

Time Based Key-Value Store

Solve

Design a time-based key-value data structure that can store multiple values for the same key at different time stamps and retrieve the key's value at a certain...

MediumVery Likely
hash-tablestringbinary-search

Snapshot Array

Solve

Implement a SnapshotArray that supports the following interface:

MediumLikely
arrayhash-tablebinary-search

Longest Palindrome by Concatenating Two Letter Words

Solve

You are given an array of strings words. Each element of words consists of two lowercase English letters.

MediumLikely
arrayhash-tablestring

Step-By-Step Directions From a Binary Tree Node to Another

Solve

You are given the root of a binary tree with n nodes. Each node is uniquely assigned a value from 1 to n. You are also given an integer startValue representing...

MediumLikely
stringtreedepth-first-search

Minimum Absolute Difference Between Elements With Constraint

Solve

You are given a 0-indexed integer array nums and an integer x.

MediumLikely
arraybinary-searchordered-set

Smallest Range Covering Elements from K Lists

Solve

You have k lists of sorted integers in non-decreasing order. Find the smallest range that includes at least one number from each of the k lists.

HardLikely
arrayhash-tablegreedy

Split Message Based on Limit

Solve

You are given a string, message, and a positive integer, limit.

HardLikely
stringenumeration

Number of Flowers in Full Bloom

Solve

You are given a 0-indexed 2D integer array flowers, where flowers[i] = [starti, endi] means the ith flower will be in full bloom from starti to endi (inclusive)...

HardLikely
arrayhash-tablebinary-search

Text Justification

Solve

Given an array of strings words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully (left and right) justifie...

HardLikely
arraystringsimulation

Count Integers in Intervals

Solve

Given an empty set of intervals, implement a data structure that can:

HardLikely
designsegment-treeordered-set

Number of Recent Calls

Solve

You have a RecentCounter class which counts the number of recent requests within a certain time frame.

EasyLikely
designqueuedata-stream

Longest Mountain in Array

Solve

You may recall that an array arr is a mountain array if and only if:

MediumSometimes
arraytwo-pointersdynamic-programming

Data Stream as Disjoint Intervals

Solve

Given a data stream input of non-negative integers a1, a2, ..., an, summarize the numbers seen so far as a list of disjoint intervals.

HardSometimes
hash-tablebinary-searchunion-find

Merge Intervals

Solve

Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cove...

MediumSometimes
arraysorting

Find Peak Element

Solve

A peak element is an element that is strictly greater than its neighbors.

MediumSometimes
arraybinary-search

First Missing Positive

Solve

Given an unsorted integer array nums. Return the smallest positive integer that is not present in nums.

HardSometimes
arrayhash-table

String to Integer (atoi)

Solve

Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer.

MediumSometimes
string

Maximum Profit in Job Scheduling

Solve

We have n jobs, where every job is scheduled to be done from startTime[i] to endTime[i], obtaining a profit of profit[i].

HardSometimes
arraybinary-searchdynamic-programming

Course Schedule II

Solve

There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, b...

MediumSometimes
depth-first-searchbreadth-first-searchgraph

Shortest Path in a Grid with Obstacles Elimination

Solve

You are given an m x n integer matrix grid where each cell is either 0 (empty) or 1 (obstacle). You can move up, down, left, or right from and to an empty cell...

HardSometimes
arraybreadth-first-searchmatrix

Find All Anagrams in a String

Solve

Given two strings s and p, return an array of all the start indices of p's anagrams in s. You may return the answer in any order.

MediumSometimes
hash-tablestringsliding-window

Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit

Solve

Given an array of integers nums and an integer limit, return the size of the longest non-empty subarray such that the absolute difference between any two elemen...

MediumSometimes
arrayqueuesliding-window

Find the Length of the Longest Common Prefix

Solve

You are given two arrays with positive integers arr1 and arr2.

MediumSometimes
arrayhash-tablestring

Finding Pairs With a Certain Sum

Solve

You are given two integer arrays nums1 and nums2. You are tasked to implement a data structure that supports queries of two types:

MediumSometimes
arrayhash-tabledesign

Spiral Matrix

Solve

Given an m x n matrix, return all elements of the matrix in spiral order.

MediumSometimes
arraymatrixsimulation

How often are these problems asked?

Frequency scores are based on crowdsourced interview reports. A higher score means the problem has been reported more often in recent Databricks interviews.

Very Likely

75-100%

Likely

50-74%

Sometimes

25-49%

Rare

0-24%

Preparing for your Databricks coding interview

Databricks interviews focus heavily on array, hash-table, string problems. If you're short on time, these are the categories to prioritize. The problems on this page are sorted by frequency, so start from the top and work your way down.

Beyond solving problems, practice explaining your approach. Databricks interviewers care about your thought process - how you break down a problem, consider edge cases, and evaluate tradeoffs between solutions. A clean O(n) solution you can explain clearly beats an O(log n) solution you can't articulate.

Looking for more companies? Browse all 458 companies in our directory, or sharpen your fundamentals with our free data structure visualizers and AI-powered DSA tutor.

Frequently Asked Questions

What coding problems does Databricks ask in interviews?add

Databricks has been reported to ask 27 distinct coding problems. The most common topics are array, hash-table, string. 1 are Easy difficulty, 17 are Medium, and 9 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.

How hard are Databricks coding interviews?add

Based on 27 reported problems, Databricks interviews are significantly harder than average - 33% Hard vs 18% across all companies. 63% of questions are Medium difficulty. Focus on the high-frequency Medium problems first, then work through the Hard ones.

How should I prepare for a Databricks coding interview?add

Start with the highest-frequency problems listed on this page. Focus on the core topics: array, hash-table, string. Practice solving them under time pressure and explaining your approach out loud. Mock interviews with AI can simulate the real experience.

Other companies to explore

Ready to ace your Databricks interview?

Simulate a real Databricks coding interview with an AI interviewer. Get a scorecard with specific feedback on your problem-solving, code quality, and communication.

Simulate a Databricks interview with AIarrow_forward