izard: (Default)
[personal profile] izard
Now every technical interview involves a whiteboard/computer coding/solving of simple/medium level puzzles. As any sport, one needs recent practice to perform well. I did not practice in that since 1998, and I only had one such interview in ~2010 with google, where I failed.

I don't argue that it is not a worst proxy for evaluating programmer's job performance (in the same way as running speed/stamina is a proxy for evaluating football player skills).

I decided to spend some time to understand my current status and improve it a little bit. So I selected a random puzzle from hackerrank with medium rating and low average pass count.

It took me about 3 hours in total to come up with a correct O square algorithm, and one hour to implement.

This Clojure implementation by the way is probably not O square as it times out on bigger tests. So I need either to profile it and fix, or re-write in C where reasoning about execution time is trivial.

So if I got this puzzle at a Google/Facebook/whatever interview, I would have failed, as one needs to solve this in 30 minutes, not 4 hours. And when I encounter puzzles of similar complexity at work (not very frequently, maybe once every couple of months), solving it in 4 hours is never an issue.

Upd:
For two people, who are much brighter than me, it took several minutes to find the algorithm which is O(n) and describe in the comments. I implemented it (took me half an hour), and now it passes all hackerrank tests:


Date: 2018-08-08 03:02 pm (UTC)
juan_gandhi: (Default)
From: [personal profile] juan_gandhi
Pretty simple, no? I'd rather collect the frequencies of remainders mod k, then choose those remainders which complements are smaller, with the exception of k/2 (here just take 1), and then scrape the list again, taking the ones that belong.

I believe though that coding exercise is not about solving puzzles (puzzles are for freaks), it's about simply checking whether the patient has a CCD ("can't code disease") or not. For that, almost any, pretty simple, problem would do.

Another thing is checking the patient's ability for abstraction; that's a harder problem.

Profile

izard: (Default)
izard

June 2025

S M T W T F S
1234567
891011121314
15161718192021
22 23242526 2728
2930     

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 29th, 2025 04:52 pm
Powered by Dreamwidth Studios