Data companies like Databricks conduct software engineer interviews in much the same way. That means code problems with lots of edge cases, questions about multithreading and system design, and finally talks about past work. These are the questions candidates were asked at Databricks, from the first phone screen to the final round. If you want to know more about these stages at Databricks, here's a description of the interview stages there.
Phone screen: wildcard matching
The task is to write a function for wildcard matching. It takes a string called
v and a pattern. The pattern includes regular letters from a to z as well as the asterisk *, which matches any number of letters, zero included.
c*t on "cat" true *t on "cat" true c*t on "dog" false *t*a*c* on "cat" false
The first thing to ask is: what wildcards are allowed? Then the solution that the candidate wrote was with two pointers: one on the string, the other on the pattern. If two letters are the same, they both move one step. If it finds
* in the pattern, it remembers the star's location and its location in the string and continues working with the pattern.
If two letters are different and there was a
* before, it goes back to that star and lets it eat an extra letter from the string. If there is no star, the answer is false. Finally, you can skip any stars left at the end of the pattern. In the worst case, the time here is O(N*M) and the extra space is O(1).
Try it in these cases too:
cat*cat*cat*** on "catcatcat" true ****cat*cat*cat*** on "fdajhfjdsacatcatcatlsaflk" true cat*cat* on "catdog" false * on "" true cat*cat on "cat" false ca*t on "catat" true
This interview took place on CoderPad, and if you have an interview like this coming up, InterviewMan will hear the question and show the answer on the screen for you as you speak. If the question is code on the screen, take a screenshot: InterviewMan reads the code and you have your answer. Before the actual interview, practice these questions on a video call with a friend, with InterviewMan open, so you know how it works.
Ready to ace your next interview?
InterviewMan gives you real-time AI answers during live interviews — undetectable on Zoom, Meet, and Teams.
Try InterviewMan FreeThe free trial gives you 20 minutes, and no card is required. Another candidate had the same question on the phone screen, but in two steps: the first assumed that the pattern contained only one star, and then the question followed: any number of stars.
Phone screen: function library
This question came up in a phone screen for a senior software engineer role. Imagine you're creating a library and there's a class called
Function that contains 3 things: the name, a list of argument types, and a flag called isVariadic. The library has a method called register that takes and records a set of functions, and another method called findMatches that takes a list of argument types and returns every function that fits them.
If the function has
isVariadic=true, its last argument can be repeated one or more times.
Example:
FuncA takes String, Integer, Integer (fixed) FuncB takes String, Integer... (variadic) FuncC takes Integer... (variadic) FuncD takes Integer, Integer... (variadic) FuncE takes Integer, Integer, Integer (fixed) FuncF takes String (fixed) FuncG takes Integer (fixed) input String matches FuncF input Integer matches FuncC, FuncG input Integer, Integer, Integer, Integer matches FuncC, FuncD input Integer, Integer, Integer matches FuncC, FuncD, FuncE input String, Integer, Integer, Integer matches FuncB input String, Integer, Integer matches FuncA, FuncB
This candidate could not think of anything better than brute force. But another candidate got a question very close to it: search by function signature, for autocompletion in an IDE, and it has to handle variadic functions. He said the best answer used a trie.
The final round
The candidate passed the phone screen (the wildcard question in both forms) and moved on to the final round. These were his rounds:
- Windowed average: You have a set of key and value pairs, and each pair expires after k milliseconds. You may be asked for a specific key value or the average. The catch is that you have to prune the doubly linked list (DLL) ahead of every call. Example: you store
when t = 1 with a 3ms expiry; after 3ms,<"foo", 100>
must say the key is not found.get("foo") - Scheduling tasks: There is a list of runnables, each with a delay, meaning: run this one after t ms. How will you store them? The point wasn't designing the PQ, the point was multithreading: the producer has to put the jobs in the PQ, and the consumer is the one who actually runs them on time.
- System design: Design a system like bit.ly. If you need to review the basics, there is a system design guide.
- Linux basics: Very basic CS questions:
- DNS, and why it is a hierarchy
- How the routing table gets filled
- The difference between Ping, Traceroute and Telnet
- The file system
- The process table and context switching
- What do /bin and /usr mean?
- What does NAT mean?
- VPN and VPC
- TCP versus UDP
- HTTP and its methods and cookies
- Culture round: Like Google's Googleyness round. The one question he found interesting: If you could only ask the candidate one question and wanted to know whether they were a culture fit or not, what would you ask them? He said he would ask: What did you learn about yourself, technically and behaviorally, over the last 30 days?
When he finished, he was still waiting for the result. He wasn't very hopeful, because he is not good at the "talking" part, the questions that start with "describe a situation where". If this part also worries you, prepare your answers to the famous behavioral questions. Then add your stories to InterviewMan as question-answer pairs: when a similar question comes up in the culture round, it uses the answer you prepared.
Another candidate, senior role
Another candidate applied for the position of senior software engineer, and his rounds were as follows:
- Search by function signature: The same idea as the library above, for autocompletion in an IDE, including variadic functions. As mentioned above, a trie was the best solution.
- URL Shortener: They focused on creating unique IDs and on the database design.
- Design: A system like Feedly.
- Scheduler: Write a scheduler in any language. They go very deep into concurrency here. He chose Java, and they had him rebuild TimerTask almost from scratch with locks, wait and notify.
- Behavioral: Nothing unusual. He talked about his previous work, what he saw in certain technology options and why he wanted to work at this particular company.
In the end he got the offer, but he had said yes to a different company before it came, so he turned it down.
Download: InterviewMan for Mac, Windows, iPhone, Android and web ($12/mo on the annual plan or $30/mo, with a one-time 20-minute free trial and no card)
Ready to Ace Your Next Interview?
Join 570,000+ professionals using InterviewMan to get real-time AI assistance during their interviews.

