DEV Community

Cover image for What I Learned From Bombing An Amazon Coding Assessment

What I Learned From Bombing An Amazon Coding Assessment

Andrew (he/him) on August 18, 2019

Recently, I was invited to take an online coding assessment with Amazon. As I'm contracted with my current job for a while yet, I thought it might ...
Collapse
 
therealkevinard profile image
Kevin Ard

What I learned: a love for regex. I bombed, and I knew it. So I dwelled on it, and pretty quickly realized the proper solution was regex. Looked into it a bit, flash-forward years and years, and now I'm that guy who has a one-liner for every text-based thing ever lol.

There's real value in failing.
Frankly, I'm just as happy if I win or fail.

Collapse
 
morgboer profile image
Riaan Pietersen

I've always wondered why they are called "regular expressions".. when in fact, their more like "special-ability-superhuman expressions". hahaha. Jokes aside, I've often decided to learn regex properly, but then somehow I never get past the 0-9 a-b... :D

On a sidenote, if your code is riddled with regex (highly optimised and beautiful) does it not make it more difficult for less experienced devs to make changes to your code? I guess I am asking if we should weigh up using regex, versus simpler string manips?

Collapse
 
databasesponge profile image
MetaDave ๐Ÿ‡ช๐Ÿ‡บ

I think you can always help with understanding of regex by commenting and naming, just like you would with other code items.

  # number or plus as first character, number or certain characters as other characters
  BASIC_PHONE_REGEX = "^[0-9\+(][0-9)(\-\.ext\s]+"
Thread Thread
 
morgboer profile image
Riaan Pietersen

Yep, very good. Perhaps even add the expected result as part of the comment.

Thread Thread
 
therealkevinard profile image
Kevin Ard

When tdd is viable, rex can be expressed very thoroughly in tests. They need to be tested differently anyway because of their versatility, so those tests go a long way to show what it should/not do

Thread Thread
 
richardhendricks profile image
Richard Hendricks

regex101.com/ is a godsend when it comes to understanding someone else's line noise.

Collapse
 
awwsmm profile image
Andrew (he/him)

Yeah, sometimes it just makes sense to use regex, especially when looking for patterns in text. It's easier to say "look for \([0-9]{3}\) [0-9]{3}\-?[0-9]{4}" than:

  1. look for a ( character, if you find one, check that
  2. the next character matches any of 0, 1, 2, ...
  3. the next character matches any of 0, 1, 2, ...
  4. the next character matches any of 0, 1, 2, ...
  5. the next character is a ) character...
  6. ...
  7. ...
  8. ...
Collapse
 
therealkevinard profile image
Kevin Ard

Rex is a little like awk. Despite my love for it, I use it in code judiciously - just for the sake of who-comes-next. If the thing can be done effectively otherwise, I'll probably use the otherwise. ...to a point. I'm not going to trade a rex for an O^n^6 for the sake of who-comes-next lol.

For my own uses, though? Wait.. that form was misconfigured and now you have 840 contest submission emails you're manually copying/pasting to a spreadsheet?!?! Fwd those and give me 4 minutes. ๐Ÿค“

Thread Thread
 
morgboer profile image
Riaan Pietersen

:D hahaha. Seeing a good regex in action is literally like magic! Aloha-regex and BANG - magic.

Collapse
 
johnn6tsm profile image
JohnN6TSM

+1 for regex. I still remember reading in the pragmatic programmer: "Pragmatic programmers master regular expressions."

Eventually I took a 30 day vow to do absolutely no text manipulation with anything but Regex. Now I, too can't put them down. I use regex for almost everything trxt parsing related. (everything except html, xml and JSON of course.)

Collapse
 
aguywhocodes profile image
Michael Brown
Thread Thread
 
awwsmm profile image
Andrew (he/him)

A classic

Collapse
 
awwsmm profile image
Andrew (he/him)

โค๏ธ regex

Collapse
 
dmahely profile image
Doaa Mahely

I bombed an interview at a huge company because I didn't read the question properly! It was a true/false question that was worth like 15% and I just read the keywords and clicked true because I wanted to have more time for the coding problems.

Lesson learned: Triple read each question ๐Ÿ˜†

Collapse
 
therealkevinard profile image
Kevin Ard

I nailed an interview once because I didn't process the question correctly lol.

Me: goes on a 7-minute spiel.
Interviewer: ... ... Well, that's not at all what we were asking. ... ... But tell me more about that.

๐Ÿคทโ€โ™€๏ธ

Collapse
 
dmahely profile image
Doaa Mahely

Lol that sounds like something that could happen to me as well ๐Ÿ˜‚

Collapse
 
shellscape profile image
Andrew Powell

Woof. I applaud the positive message in this post and I'm all for encouraging and helping fellow devs with information like this. But it missed the biggest lesson from the experience:

Memorization and regurgitation does not a good developer make. And we need to stop accepting it as part of the hiring practice.

Knowing where and how to find an answer, and how to apply it, is infinitely more valuable today. Hiring in tech is fundamentally broken.

Collapse
 
jankapunkt profile image
Jan Kรผster

I would like to emphasize, that these kind of assessments only take a snapshot of your current development and problem-solving skills. A more valid approach also requires to monitor how your skills improve over time.

In the long run you want to hire someone who is good in self-improvement of skills and adapting to changes. Ans maybe this person has just not build the skills yet.

Failing this limited small puzzle makes me think in the end:

a) I just not solved it yet but in the future I would be able to do so

and

b) This would not be the place where I like to work at because the only thing they care is my current performance and not the performance I could deliver after x time-units of further improvement.

Hope this is not perceived as rude but rather a critical approach on code assessments we all should be aware of (and communicate in job interviews, too).

Still much thanks for sharing the test, it was fun to solve it <3

Collapse
 
muchjeff profile image
Jeffrey

Welp! I wish I had read this article yesterday! I bombed my coding assessment last night.

I actually read all the fine print before starting, and my interpretation was that I was supposed to use the web IDE they provided. I assumed they record your interactions for playback. But it was unfamiliar, and I make heavy use of code completion, which was not there.

They also provided a full practice assessment on the platform. I did that first and passed all test cases on both problems...and had about 20 minutes to spare.

But in the real assessment I struggled with the particular task. And the ticking clock made me flustered, and soon I was in a downward spiral.

This article really is super valuable...if you read it BEFORE your assessment. jajajajaja

Collapse
 
timmparsons profile image
Tim Parsons

Know Big(O) notation, too. I failed with the questions and then they asked this as well. I messed up this as well so I'm probably from redoing it for life :-)

Collapse
 
jankapunkt profile image
Jan Kรผster

I see the biggest conflict in long term creating quality software vs. short term KPI, where one qualitative measure is compared with a quantitative measure.

And HR, as well as MGMT, are totally in love with quantitative measures, which is why (I assume) they still do these coding or fact-based-recall-skills assessments.

Collapse
 
egil profile image
Egil Hansen

I wonder if you are allowed to use your own code editor? I can imagine them tracking your typing/editing, and if you are just copy-pasting a solution into the editor at the end, then they might get suspicious that you have not actually programmed it yourself.

Collapse
 
awwsmm profile image
Andrew (he/him)

For the one I did, at least, they warned you that they would be recording your screen. So they could see everything I was doing, including googling and going to StackOverflow!

Collapse
 
mtanzim profile image
Tanzim Mokammel

Another comment for #4: the debugger can be a huge time saver!

Collapse
 
enriquegv001 profile image
Enrique Garcรญa

I have taken the OA.
This is divided into 4 steps. That are expected to be solved in 4 hours.

Do you know if I didn't perform my best at coding assessment, am I able to continue with next steps?

Because it took me away

Collapse
 
madhuri06083729 profile image
madhuri vegaraju

I love solving such problems on Hackerrank. They are not timed but they do run against several test cases. So it gives you practice to code against all the edge cases.

Collapse
 
borowskidaniel profile image
Daniel Borowski

Great tips for interview prep Andrew. Thanks for linking to Coderbyte!

Collapse
 
awwsmm profile image
Andrew (he/him)

My pleasure! Was there a little bump in traffic?

Collapse
 
holmesrg profile image
Ron Holmes

Any ideas on where to get some sample questions?

Collapse
 
gajendrajena profile image
Gajendra
Collapse
 
mukulbichkar profile image
Mukul Bichkar

In my opinion, Leetcode is the best website for practicing coding questions.

Collapse
 
awwsmm profile image
Andrew (he/him)

Check out this book, too:

amazon.fr/Cracking-Coding-Intervie...

Collapse
 
amatosg profile image
Alejandro

I made the same like a week ago: having a kid around doesn't help. Request for silence with a few days in advance. Of course I didn't get it

Collapse
 
hajimurtaza profile image
Murtaza Haji

can we switch windows during coding challenges? Doesnt the test get voided if they detect screen switching?

Collapse
 
awwsmm profile image
Andrew (he/him)

It depends on the rules of the specific challenge. It's always best to ask beforehand.

Collapse
 
owaiskhanafridi profile image
Owais Khan • Edited

Use your own IDE?
is that even allowed during the online assessment ?