This post is kinda long but you get a free spoiler of a Databricks interview question at the middle of the post. Otherwise, if you read it just to comment complaining that I wrote a bible, please just skip this thread. This thread is about the fact that I was given a question that I could solve in 10 minutes and I decided to do an “elegant” solution because the interview preparation pointers told me to. This thread is about someone unemployed feeling each day more hopeless that I even deserve to be employed, because this No at the first step of the process means I’m clearly getting something wrong. This thread is about asking nice people to tell me what could be potential things I’m getting wrong, so I get try to get it better next time. After being laid off I took a while before starting to apply for interviews, mostly to get my resume as good as possible and also to focus on some family time and spending time with my folks on my country that I moved away 6+ years ago to start my career after graduation on a FAANG. I just want to start saying that coming from an ICPC/Codeforces/TopCoder background for 6 years on school, winning a lot of tournaments, I always had it with interviews. And that helped me got 3 job offers and 2 internship offers all at FAANG companies. But that was easy as a grad student because there was no behavioral or systems design interview back then and they didn’t care that my communication wasn’t that clear as I had never left my home country before those opportunities. I swear I don’t want to sound cocky. I was never an asshole of feeling superior or anything, quite on the contrary, I tried my best to always help people around me. Anyways, 6 years later, 6 years at a big tech company, and I get laidoff for some reasons that I already discussed in another thread and is not the point. I initially was happy at first because I was very sad with my job since COVID started and I kept doing things but it wasn’t with the same satisfaction as before, and I was always afraid of leaving the comfort zone. Then, being forced to leave the comfort zone, I was put back into something that 6 years ago I was really good at. So initially I practiced a bunch of algorithm questions, and always choosing C++ as language of coding, and I was quite surprised on how I didn’t lose my skills. But this time, something was different. I was taking longer to solve the problem. But I wasn’t taking longer to figure out the solution. The thing was: I used to do hacky codes, I used to test if an int was even by doing “!(x&1)”, I used to check if a dynamic programming N-dimensional result vector had a value or not by memsetting all values to -1 and checking “if (~pd[I][j])”. I even remember this last one because the interviewer, years ago, even though I passed the interview, he told me that he got it that I was trying to “brush the bits” but these things weren’t necessary and made the code less readable. I couldn’t understand what he meant at the time until I was coding on a large codebase with a lot of experienced engineers, lol. So now, I was spending time doing modular code, following good C++ guidelines, giving variables a good representing name that would be self-descriptive. Anyways, I was given a “easy” problem. Given an array of IP rules in the format [(“ALLOW”, “192.168.0.24/8”), (“DENY”, “8.8.8.8/32”), (“ALLOW”, “1.1.1.1/16”), (“DENY”, “0.0.0.0/0”)], and also a vector of IPs in the format of an IPv4 (similar to the ones in the IP rules but without the /mask. Basically whenever an IP matched a rule with a mask, the first one that it matches would return that allowable value. So return 1 if it’s ALLOW or 0 if it’s FALSE. Fk, as soon as he told me I was ready to code. But I knew that was not the way. I spent the first 5 or 10 minutes showing him my approach. Before I proceed, let me tell you that I coded this in Python later on, after getting rejected, without following any coding style or modularization or better engineering or shit, and in 10 minutes it was done and producing the expected output. And I coded the same logic that I came up with in less than 5 minutes. Anyways, I would basically parse each segment of the IP to an uin32_t, by doing an iterative approach that would be like: reduce((I, ip) => (ip<<8)+ipSeg[I]); Anyways, this is an arrow function that is not C++ but just to exemplify the idea. Then I would match using bitwise operator (ruleIP&ruleMaskIP) == (inputIP&ruleMaskIP) to see if there was a match of the ip on the subnet address. I came up with all of this idea quickly, and I’m not showing myself off because I don’t think this problem is hard at all. But I’m just saying this I spent A LOT of time creating at least 6 different classes, member functions, using constexpr to hold the string_view of the regex that would match the IP/Mask. When I told him that I was going with an IPMask (because in C++ string handling is kind of ugly before C++20/C++23, with the introduction of views operators), he told me that I would take a long time doing that. I wrote the entire regex in at most 2 minutes. And the code was compiling successfully until there was 10 minutes left. Then I found an edge case and when I tried to debug, I got a compilation error. Then the interviewer told me not to worry because I got the logic correct. When there was 5 minutes left he told me to stop coding and ask him questions. So there wasn’t even time to talk about time complexity / space complexity. Because my mind thought that this problem was too easy to spend only 10 ~ 15 minutes on it. So I decided to do a clever solution that would be seen by other engineers at the company as a good solution, if it was a code going to production. I left the interview happy. I know that sometimes even if you don’t finish, what is important is that you get the logic correct and your skills. And I spent more than 6 years coding in C++, my code was good and I could show both my ability to solve problems, and my ability to code concise and modular code. So after I got that “after looking into my skills and my experience, they were not moving forward with the application”, I started to wonder what could be the causes. The aim of this post is not to release catharsis by talking about what happened. It’s just to try to get opinions from the context that I gave about what else I may be missing that should be important for me to learn. Perhaps it could be just the way I communicated? I got feedback about my communication being something to work on before. Anyways, there are a lot of things to consider. What I keep wondering is: if I did the code in Python, as the interviewer expected and actually even told me it would be better if I did, at the end. On the emails for preparing for the interview, they tell you to worry about the code like your peer is going to see it. They tell you that it’s not only about solving it correctly, it’s about solving it elegantly and with style. I’m overthinking. I’ll stop writing now. If you think you lost your time reading all of this, at least you got a spoiler of a Databricks interview question. Thanks. #tech #interview #jobsearch
I think I have a pretty good idea why you are getting rejected after going over your post and quitting midway lol
So you’re also saying that you don’t consider yourself a nice person? Because I state clearly in my post that I wanted to figure out something that could be obvious to others and not to me. And that I was looking for nice people to tell me what I may be missing.
Before making this post I knew I could get comments from haters and that’s why right at the beginning I ask you to understand that I’m not in a good place right now and please skip this thread if your intention was to make me feel worse. But if you want to indeed contribute, then just enlighten me with what you think could’ve gotten me rejected. Single instance, though. Haven’t been rejected by multiple companies yet.
Life is a marathon, not a race.
In my experience, it’s best to solve problems with the best tool for the job during interviews. I always use python for string parsing problems, and Java for everything else. Don’t worry about making your code production ready for the first solution, just solve the problem and iterate on it. Obviously also incorporate feedback from your interviewer throughout the process of iterating.
Too long, didn't read. Could apply to your post, as well as to your solution. Don't overengineer in an interview. I know it's harsh getting rejected over that over a phone screen but the market is just like that right now. Also, try and learn to communicate on a high level, be it in English or a programming language or software design. Don't go into the intricacies if they are unwanted. You have one hour to prove yourself, and if you spend that time covering details the interviewer isn't interested in, you are wasting valuable time but not providing any datapoint the interviewer needs. Start at a high level, ask questions about the problem, keep the solution simple and readable. Here's something you should reflect back on, did you ask the following questions before jumping into the code? 1. Are the CIDRs or the IPs always valid? 2. What happens if the IP doesn't match any CIDR? 3. Are there priorities in the CIDR vector? What happens if there is a conflict between two CIDRs? 4. Can you preprocess the CIDRs to get a faster solution? (Not necessarily a better time complexity) If you didn't ask these to the interviewer or yourself, then you have to get better. You might not need to do that to land a job depending upon your YOE, but you will need this to grow as an engineer.
Dude, I swear I don’t get offended by you not reading it. I would not read it. But THANK YOU for showing there are decent people that can effectively identify such insightful suggestions. I wanted to include the answer to some of your questions on the post, but it was already too big. 1. Yes, first thing I asked. 2. Asked that 2 minutes after started coding and he said “then return false”. 3. Did not ask that. 4. No and it was my fault; if I didn’t prioritize over engineering, I would have time to talk about costs and start talk about refactoring.
Glad I was of help. I have made the mistake of thinking that a problem was "easy", but the devil lies in asking the right questions. At least for a few companies like Google, don't think of a problem like a leetcode question, but an actual problem. That is the way to go. Doing too much competitive coding has this side effect of considering all the problems like a single solution problem.
To all of you who ignored the first thing I said about just skipping this thread: stop trying to look for the funny comment in a thread that clearly shows the poster is not well. I’m telling you that I’m not well. I don’t think for one second that it’s normal to write that much. But there’s a very sad and depressed person at the other side of the screen and I just asked you to just ignore it if you’re not going to help.
Honest advice: for your next interview, go somewhere in the middle. Use your bit tricks, but add a comment over them. Use slightly longer symbol names than x, like mask.. Just focus on getting something complete as fast as possible. Generally, if a question seems easy or quick, there is a follow-up question coming, so you should try to get there asap.
also use Python and not C++. It's generally much more readable, and you don't need to do any complicated stuff like you need to in cpp to get concise code, for example, using list comprehension. This is coming from another former competitive programmer
Not a fun feeling, but each job has like 1000 applicants right now so they all have their pick of the litter. Keep your head up and I hope you feel better after venting. Some advice I heard once was to talk to everyone and as if their time is worth as much as the CEO’s, because it is. Just a tip for being concise.
Do some mock interviews with your friends
You might wanna do an easy interview to get some confidence. I can refer you to Jpmc if interested. DM me.
Interviews are kind of like dates. Desperation, no matter how you try to bury it, can be detected and is not appealing. Counterintuitive as it may seem, you need to find your ground. You’re writing novels on blind for affirmation that you’re doing “okay.” That’s a pretty good sign you’re not doing okay. You need to develop the belief that you’ll figure things out. If it doesn’t work out today, you’ll grow and figure it out tomorrow. No sense in panic ranting online. “It is the unemotional, reserved, calm, detached warrior who wins, not the hothead seeking vengeance and not the ambitious seeker of fortune.” -Sun Tzu
I’m not reading this Quran
Dude, this is the second or third sentence in the first paragraph: “to comment complaining that I wrote a bible, please just skip this thread”. The first thing I let people know is that the post became long as part of the overthinking process. And it’s not made for 999999.99% of the people.
I followed the rules, that’s why I specified another religious text