DEV Community

Tina Bu
Tina Bu

Posted on

Hardest Technical Interview Question You Were Asked In Your Life

I figured it might be interesting to start a thread of the hardest technical interview question people were asked. I have had quite a few interviews in the past few years and it never amazes me how hard some questions are, even if I am looking for data scientist roles and not SDE.

Disclaimer:
Company names or any confidential interview details will and should not be shared.

Anyway, the hardest question I was asked ever was to parse a string of a mathematical expression with +, -, *, /, (, ) and empty spaces, and calculate the result with consideration of order of operations (Parentheses > Multiplication and Division > Addition and Subtraction). For example,

Input:" 6-4 / 2 "
Output:4
Input: "1+4*3/(2-6)"
Output: -2

It's almost the same question as LeetCode 772 (it seems that you need to be subscribed to see the problem description tho).

For the interview, I have around 45 minutes to solve this recursion problem and handle the case where there is a parenthesis I need to temporarily save the current results in a stack and calculate what's inside the parentheses first, and if I see a - or +, there might be a higher order operator on the right that needs to be calculated first. And not surprisingly I couldn't figure it out. I was having the most problems with keeping adding up to a global result variable but also maintaining temporary local calculation results.

What was the hardest question you were asked during technical interviews? Have you ever used BFS, DFS, Dynamic Programming, Simulation, or even LinkedList in your real life? Do you like algorithm interviews? Are you a hiring manager and have thoughts on how to better evaluate candidates? Do you know how to solve the question I failed?

Top comments (3)

Collapse
 
cjbrooks12 profile image
Casey Brooks

I had an internship at a company whose core product involved ebooks. One of their questions was concerned with how to download/open/read/transfer an ebook if it was significantly larger than the available RAM or disk space on the device (i.e. cannot read it fully into memory, and can't even cache memory to disk).

Fortunately, it was just theoretical and I didn't have to implement any solutions for it. And good thing, too, because I still don't know how I would handle that!

Collapse
 
tinabu profile image
Tina Bu

You got me. I would certainly fail this one :(

My company doesn't really have very big datasets and I never got to learn how to deal with them.

Collapse
 
tinabu profile image
Tina Bu • Edited

Hahahahah what was your answer Neil?

I forgot to mention that before I was asked this leetcode question, I was also asked to "Introduce yourself and your 2 biggest hobbies" and "what are your 2 biggest weaknesses". I just want to know why. Are interviewers pure evil or just bored?