A Failed Coders Guide to Coding Interviews

ofilispeaks
5 min readApr 18, 2021

--

Last month, I had my first ever coding interview for a Data Science position … and it was emmmmm quite interesting but very enlightening. In this article, I will share what happened and what you can learn from my mistakes.

I interviewed for an internship position at a top Silicon Valley company. My interview was at 9:00 am and I was excited, probably nervous but my excitement overshadowed my nervousness.

Now it’s important to note, that up to that point, I had done well in all my in-class coding challenges. And on CodeWars, I was at a 5 kyu level … not impressive for a core software engineer but more than enough for a Data Scientist.

In summary, anything Python-related within the DataScience framework … I was able to cut through with focused effort and light head-banging.

So here I was at what I thought would be a Zoom interview focused on behavioral type questions mixed with Data Science questions, like “what is a Random Forest?”

But instead, I randomly found myself in a forest listening to my interviewer explain what a Palindrome was while simultaneously sending me a link to click. After a few seconds, on my screen was an unfamiliar coding challenge interface and the task was to detect if a string of words was a Palindrome.

Palindrome: a word, phrase, or sequence that reads the same backward as forward, e.g., madam or nurses run.

And in what was likely the only thing I got completely right during that interview, I asked if I could use the more familiar (at least to me) Jupyter Notebook to solve the challenge. My interviewer accepted.

But that was about as good as it got…

Because, as I started coding. I heard a panicked scream from my interviewer, who told me quite alarmingly that they could not see my screen! The scream was half insinuating “ Are you cheating?” and another half “What the heck are you doing?”

I realized that I was not sharing my entire screen, but rather was sharing the original coding challenge interphase. Thus he could not see my new screen. So I promptly toggled screen-sharing back to show my entire chrome browser.

But things did not get better…

The first thing I did was to write pseudo-code and turn my STRING into a list of words.

test = list(‘madam’)

This would then enable me to check, element by element to see if there was a match. So basically the above code will return [‘m’, ‘a’, ‘d’, ‘a’, ‘m’], and then I could check if test[0] was equal to test[4] and if test[1] was equal to test[3], etc. So I checked this with pseudo-code as I explained my reasoning (note, this is an actual extract from the exact code I wrote during the interview)

test[0] = ‘m’
test[4] = ‘m’
test[1]= ‘a’
test[3]=’a’

Things were going okay when suddenly loud music from upstairs began playing. Like legit loud music. I was so confused … I had done everything to prep for my interview, cleaned my room, informed people in the house that I was interviewing, etc. But there it was … LOUD thumping music smack dab in the middle of a coding challenge.

And after getting semi-scolded for not sharing my screen, I did not even dream of excusing myself from the chair to resolve the loud noise. So I resolved to muting and unmuting my line, and throwing my phone on the door, in hope that someone would hear it and come to the door. But nothing happened, and this is where the mistakes started happening.

I wrote a pseudo-code to check if test[0] = ‘m’ was equal to test[4] = ‘m’, but instead of using the round brackets on my print statement, I put square brackets 😔

test = list(‘madam’)
if test[0]==test[len(‘madam’)-1]:
print [‘works’]😔

I did not even have an opportunity to struggle with my error, immediately I made the mistake, the interviewer corrected it. I felt stupid, like 5 kyu stupid. A simple print statement had tripped me up.

But despite the noises upstairs and the back and forth muting/unmuting, I was able to cobble the following code below together:

def pallindrome (string):    test = list(string)    for i in range(len(string)//2):
# The // was added to make the code more efficient.
if test[i]==test[len(string)-(i+1)]:#My psuedo-code worked😃 continue else:
return False
return True

I got the answer, but I did not get the job. And here is what I learned from that whole entire experience.

  1. Network: I know, this seems weird. But, if I had contacted current employees at the company about their past interview experiences. I would have figured out and realized that there would be a coding challenge. But I did not. I depended on the words of the recruiter and was mentally ill-prepared for the interview.
  2. Address the Unexpected: Most interview prep sessions I have attended, spend 100% of the time telling you what not to do during an interview. But 0% on what to do when what-not-to-do unexpectedly happens. For direct reference, I had been told to ensure that my surroundings were quiet, but I never was told what to do if noise suddenly came from upstairs. In retrospect, I believe I should have let the interviewer know about the noise and gone upstairs to address it, instead of throwing my phone at the door.
  3. Practise Practice Practise: I had the opportunity to do four pramp practice interview sessions (please do pramp, they are amazing). Three of them were practice behavioral interviews and the last one was a practice coding interview. For whatever reason, I did not do the coding challenge interview. I literally just logged off, because I did not anticipate that I would ever face one. In review, I should have done it, I should have pushed myself to understand the mechanisms of coding interviews. Perhaps I would have been less shocked.
  4. Embrace the Positives: I was quite sad after the interview. Because, after job searching with no interview for 6 months plus, I felt like I blew an awesome opportunity. But at the end of the day, I congratulated myself. Because I was able to do my first ever-coding interview in a tense environment with loud distracting music playing upstairs and was still able to get the frigging answer. And that to me gave me comfort that I can thrive and excel in that Data Science world, once I turn off the music and concentrate. 😏

--

--

ofilispeaks
ofilispeaks

Written by ofilispeaks

Questioning everything since 1981...Founder of @okadabooks, author, engineer, ninja and blogger who blogs at http://ofilispeaks.com

No responses yet