«   Previous Post Next Post   »
Code exercises to get job interviews, part 1

Hey friends, here are the code exercises I submitted to various tech companies. Each section links to the GitHub repo which includes my code submission. Hope you find it useful!

Update: Part two has been published, go and check it out

Monzo logo

Repo: https://github.com/umaar/hyperapp-example

Moved onto the interview stage

Monzo seems like a cool forward thinking company. This coding exercise allowed me to proceed to the final in-person interviews.

For the solution, I got the vibe they preferred a React solution. As I hadn't used React lots, I opted for a lightweight alternative known as Hyperapp, it was my first time using it.

Whether I used Hyperapp in the best way, I don't know. However, here are some aspects of my code which I believe worked out well for me, because it demonstrated awareness. IMO, awareness of a technique/practice/technology is sometimes all that's needed. Using a certain technique/practice/technology effectively is a different point, and something that can be learnt on the job. Anyway, here are those code aspects I'm talking about:

<span class="hljs-keyword">const</span> headers = <span class="hljs-keyword">new</span> <span class="hljs-title class_">Headers</span>({
    <span class="hljs-string">&#x27;Content-Type&#x27;</span>: <span class="hljs-string">&#x27;application/json&#x27;</span>
});

This stuff isn't groundbreaking and I don't think I won anyone over with any single point, but maybe a combination of each point is what led to a positive outcome.

Google logo

Repo: https://github.com/umaar/keypad-challenge

This coding exercise for Google was not part of an application.

I met a guy at Google I/O (see this timelapse to get a feel for what attending I/O is like!). He told me it was an interview challenge his colleague gave out to applicants. For fun, I thought I'd give it a go after I flew back home. I didn't send this out and there's no pass or fail outcome.

In this instance, I can share what the challenge was: You have a keypad:

<span class="hljs-keyword">const</span> alphabet = [
    [<span class="hljs-string">&#x27;a&#x27;</span>, <span class="hljs-string">&#x27;b&#x27;</span>, <span class="hljs-string">&#x27;c&#x27;</span>, <span class="hljs-string">&#x27;d&#x27;</span>, <span class="hljs-string">&#x27;e&#x27;</span>, <span class="hljs-string">&#x27;f&#x27;</span>, <span class="hljs-string">&#x27;g&#x27;</span>, <span class="hljs-string">&#x27;h&#x27;</span>, <span class="hljs-string">&#x27;i&#x27;</span>],
    [<span class="hljs-string">&#x27;j&#x27;</span>, <span class="hljs-string">&#x27;k&#x27;</span>, <span class="hljs-string">&#x27;l&#x27;</span>, <span class="hljs-string">&#x27;m&#x27;</span>, <span class="hljs-string">&#x27;n&#x27;</span>, <span class="hljs-string">&#x27;o&#x27;</span>, <span class="hljs-string">&#x27;p&#x27;</span>, <span class="hljs-string">&#x27;q&#x27;</span>, <span class="hljs-string">&#x27;r&#x27;</span>],
    [<span class="hljs-string">&#x27;s&#x27;</span>, <span class="hljs-string">&#x27;t&#x27;</span>, <span class="hljs-string">&#x27;u&#x27;</span>, <span class="hljs-string">&#x27;v&#x27;</span>, <span class="hljs-string">&#x27;w&#x27;</span>, <span class="hljs-string">&#x27;x&#x27;</span>, <span class="hljs-string">&#x27;y&#x27;</span>, <span class="hljs-string">&#x27;z&#x27;</span>, <span class="hljs-string">&#x27;&#x27;</span>]
];

The challenge to solve is, given a character or word, output the directions to get there on the keypad. e.g. for the character a, you're already there. For the character c, the result should be: ['right', 'right', '⏎'].

Algorithms aren't my strong point, but I did my best. The solution works (at least for the few characters I tested) but the solution is probably far from optimal. I tried to do a 'functional' approach using things like Array.reduce. This exercise was a personal goal for myself!

Geckoboard logo

Repo: https://github.com/umaar/meter-display

This is my solution for Geckoboard.

This timeboxed submission did not meet their standard. If you're curious what the challenge was, the initial commit may give a hint.

They gave some interesting feedback which I'm grateful for. I won't repeat the feedback, but here are some areas I'm aware I could have improved:

SitePen logo

Repo: https://github.com/umaar/wordcloud

Moved onto the interview stage

This solution for SitePen allowed me to progress to the final interview ✅️.

This was a fun (timeboxed) exercise to do. The requirements were clear and it felt like something I would do in my spare time anyway! If you run the main script in your browser DevTools, for example on a page with lots of text, you'll figure out what was needed.

Not much to say here except:

Masabi logo

Repo: https://github.com/umaar/train-timetable-coding-exercise

Moved onto the interview stage

This solution for Masabi got me to the final interview stage.

Really enjoyed this (timeboxed) exercise.

I tried to give this a model-view-controller approach, sort of. I used simple mustache templates which were then rendered client side. I would like to have done some sort of templating precompilation which can have significant network download savings, but also computational savings since there's less JavaScript to execute. I used jQuery, which looking back was not really needed.

 

I have published a part two: go and check it out

 

FAQ

Did you get job offers?

All I'll say is for each company except Geckoboard & Google, I progressed to the next stage!

Aren't these private?

I'm sharing code which I own, and worked on in my own personal time. One company did pay for my time to do a different exercise, and so I haven't shared that. However in this vein, I'm not sharing the instructions I was sent. That being said, for some of these projects, the instructions are already publicly available and discoverable through searching.

I received this challenge as part of my job application, what now?

When doing the Monzo code challenge, amongst others, I intentionally scanned GitHub for other Monzo code exercises and used them as inspiration (related: my blog post on learning from open source). More importantly, I disclosed this information to them in full, making clear what parts were inspired by other code I had seen.

Did you stay within the timeboxed allowance?

Yep! The solutions you see on Github have been cleaned up a bit, e.g. I added a 'GitHub action' to lint code on push. I removed babel from some of them.

What lessons can you share from doing these exercises?
Any more code exercises?

Yes I have a few more! I'd appreciate your feedback on twitter letting me know if you want to see more of these posts.

«   Previous Post Next Post   »

Sign up to receive blog updates, tips, and find out more about what I'm working on