(27) Learning from open source
Here are my code exercises I submitted to get job interviews

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!

Monzo logo

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

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:

const headers = new Headers({
    'Content-Type': 'application/json'
});

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

Interesting one this, as it 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:

const alphabet = [
    ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'],
    ['j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r'],
    ['s', 't', 'u', 'v', 'w', 'x', 'y', 'z', '']
];

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 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

This solution 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

This solution 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.

 

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.

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

If you're interested in Dev Tips, that has its own mailing list.