"Writing code is easy, reading code is hard"
An interview based on reading, explaining and critiquing complicated code would give a better window into a candidate's skills than having them solve the kind of coding challenge that can be completed in a short interview.
Also, being able to identify which algorithms would be useful in solving a unique problem and explain what the pros & cons are would go further than implementing an algorithm abstractly.
"Imagine that this code was written by a junior dev; review it and tell me how it can be improved, where the problems are, and other feedback".
Or "We just hired a new intern and he pushed this PR. I need you to help me review this code for issues and make sure it's production ready".The guy gave me 30 lines of code, and asked questions about it. Including finding the questionable constructs in it.
Interviewer had a small API. Found missing error handling, missing validations, poor choice of ID column type, missing index for a high volume read query, possible XSS vector.
Loved the format so much I ended up making a small FOSS tool for code review as interview: https://coderev.app
if not Counter(str1) - Counter(str2): # success, they are anagrams
str1 = "a"
str2 = "ab"Counter(str1) - Counter(str2) | Counter(str2) - Counter(str1)
That ought to work. I'd hope Python's caching doesn't recompute the Counter for long strings.
And these are all candidates with 5+ years experience, sometimes 10+. I hate the leetcode gauntlet, but I also am really surprised how much worse candidates are now on average that they used to be (I’ve been around for about 25 years now), and how the minute you try to dig a little deeper to see if they know how things really work, the more it seems that they have no understanding whatsoever of the basics and somehow treat computers as magical black boxes.
I do understand I am privileged by having grown with the technology, starting in the 8-bit era, through an electronic engineering degree, and now in k8s etc. but with so much educational material available for free you’d think that even people in their 20s/30s now should be able to have a better idea of how things work.
It was, by far, the most boring interview I've ever had to participate in. The leetcode problem was easy (detect if two strings are anagrams; solved with O(n) solution in < 10 LOC; then aggregate sets of anagrams). System design was easy because it is to the point that it is largely "formulaic". It feels like those rhythm games where you need to know when the trigger is coming and the pattern to hit those triggers (talk about functional requirements -> talk about non-functional requirements -> write some API routes -> draw a load balancer (because of course, there's always a load balancer) -> draw a service -> draw Redis/Memcached -> draw a database). It's comically laughable how it's just like a rhythm game at this point.
What I don't understand is why teams don't just "get to the point". A lot of times, the assessment is looking for specific notes. Why not just ask about those notes directly? A friend recently went through an interview where he was docked for not using C# `yield` when implementing an `IEnumerable`. But had the interviewer asked "What is `yield` and why would you use it?", the interviewer would have gained the same exact insight in 15 seconds with one question.
I think what's also striking is how slow orgs are to adapt their interview process to account for AI. There's a distinct lack of focus on code reviews as part of the assessment. If the future of coding is AIs for productivity, then teams should be adding code reviews into their process (check for correctness, check for defects, check for performance, check for security, etc).