DEV Community

Cover image for My First Assessment Test and I Banged It
Ochuko
Ochuko

Posted on

My First Assessment Test and I Banged It

I finally gathered enough courage to click the link in my email. It had come about a week ago and I knew I was unprepared for it. It was a link to a HakerRank assessment test from Chili Piper. I had applied for a Front-End developer role. My data structure and algorithm skills were poor, yet I summoned the strength to put myself out there, I mean how bad could it be (unbelievably bad actually).

I read the instructions and saw there were just 2 questions to be done in 70 minutes, one React (Front-end), the other code (DSA). I said to myself "Of course I'll do the react question first!" since I had little or no experience in writing data structures and algorithms. To me the only data structure that existed was the Array.

I started the test and decided to go through the questions as one would do in a regular examination. The react question was quite straight forward. I was to complete a form that accepted name, email, phone number and blog URL. I was told to validate the fields using certain criteria and display "Form is Complete!" if all fields were valid and "Form is Incomplete!" if they weren't. Simple right? I decided to check out the DSA question, just to see if I may have been lucky enough to get an easy HakerRank question, of course I wasn't. The DSA question was titled "Airport Limousine" or something like that, bottom line, I had no idea what they asked me to do, so back to the react question, I guess. I'm quite experienced in React but I still felt the pressure, like I was drowning in the fear of failure or not being good enough.

Now this is the funny part. I managed to validate all fields successfully except the phone number field. I had about 30 minutes left, I thought to myself "I can definitely find a regex to validate this in 30 minutes". I was supposed to make sure that the phone number was 10 digits and that it didn't start with 0 or 1. I was able to complete the former. Here I was searching every possible site for a regex to check if the first digit of a phone number was 0 or 1, I had never seen 30 minutes fly so fast. I was so disappointed. I had come to the end of my very first assessment test ever and I failed to finish. My roommate walked up to me and asks what's up. I narrate my entire story to him and then he made a statement that'll change my life forever. He asked why I was trying use a regex to validate it when I could have just accessed the number like a string and used the indexing property to do the check. My heart dropped instantly. Basically, rather than looking for a regex is should have done something like:

var phoneNumber = 9237463281;

var phoneNumberString = phoneNumber.toString();

if(phoneNumberString [0] === 1 || phoneNumberString [0] === 0) 
    return false;
Enter fullscreen mode Exit fullscreen mode

I wasted 30 valuable minutes looking for a complicated answer to a simple question. I guess that's what fear does to us, it blinds us from the most obvious answers to our problems. When we're afraid all we see is how hard the problem is, but not how easy the solution could be. I vowed that never would I allow fear to rule me again.

Top comments (12)

Collapse
 
rsb177 profile image
rsb177

You're not the first person to have that happen, won't be the last. I've been working w/ Python for over 10 years and I realized after I finished an assessment problem this morning that I over thought it. As soon as I was off the call, I immediately thought of a super simple one-liner that would have worked better. Lol. This is why I hate live assessments. Oh well, ya just face-palm and move on.

Collapse
 
ochukodotspace profile image
Ochuko

Back to the drawing board I guess

Collapse
 
ca0v profile image
Corey Alix

It gets worse w3schools.com/tags/att_input_type_... but we've been there too.

Collapse
 
ochukodotspace profile image
Ochuko

Omg 😭😭😂😂

Collapse
 
awesomeironman profile image
Cyrus Gracias

Thanks for sharing
Sometimes a 5 minutes break (I know you couldn't afford it while giving test)
Or
A second pair of eyes
helps in solving programming issues
Because meeting programming requirements could be achieved in many ways (sometimes)

Collapse
 
richtone profile image
Richard Turza • Edited

Were you allowed to use HTML5 validators like minlength and pattern, or it had to be done in JS? Anyway, don't worry. You will be coding profesionally sooner than you might think! It's all about the hustle.

Collapse
 
ochukodotspace profile image
Ochuko

Yes, I could use HTML5 validators but for some reason it never came to mind. I assumed that the solution had to be something complex.
I can't wait for my next assessment; it would be a lot better. Back to the drawing board!

Collapse
 
valeriavg profile image
Valeria

Do you like coding? If so, you have something much more valuable than knowledge and experience: a motivation to evolve. Soon enough you'll figure out that data structures and algorithms are just a common way of solving a particular problem. Some of them will inevitably be rendered inefficient in years to come because someone will dare to look on a problem in a totally wrong way. Sure, that's not exactly the case here and I tend to think that the simpler the solution the better, but hey, I'm a developer for almost a decade and I still make shameful mistakes in my job interviews.
I don't know if you seen it before, but there's a very nice project that might help fill in the blanks and nail those silly interviews: freecodecamp.org/ . Good luck!

Collapse
 
ochukodotspace profile image
Ochuko

Yesss, I love coding.
Thank you so much, this was so encouraging!

Collapse
 
v6 profile image
🦄N B🛡

It's good to get a laugh in the morning.

Collapse
 
andrewmplummer profile image
Andrew Plummer

Thanks for sharing this! Keep up the good work!

Collapse
 
divineee profile image
dee-vine • Edited

This was a great read!! fear really is one of our biggest enemies. thanks for telling us your experience and reminding us to not allow fear cloud our thoughts.