Ask HN: What are your thoughts of Leetcode and HackerRank
Forget about the whole argument about understanding data structures and algorithms and just focus on the websites like Leetcode and HackerRank. These services promote the idea of cramming question and answers until you memorize them. You can be bad at data structures and algorithms and still pass these tests given enough tries. Many engineers on TeamBlind would openly admit once they pass the interview, they would forget the answers. What are your honest thoughts about these services?
13 comments
[ 3.5 ms ] story [ 45.8 ms ] threadAs for forgetting what you learn, yeah that's expected - if you don't use a skill it rots away.most industries don't require a rigorous knowledge of EVERY data structure and algorithm.Ideally companies wouldn't use them but if they don't too many low skilled applicants slip through the net and have to be eliminated as costlier stages of the hiring process
Hackerank Strengths
Tons, and I mean tons, of questions and organized into Tracks. Want to learn about how to use Regular Expressions/ Java/ SQL/ Algorithms/ Data Structures/ Python/Math? Each one of those topics and more have specific paths with specific sub topics. If you are using these sites to get interview prep, a lot of companies send their coding challenges through Hacker rank as apart of the interview process, so it’s good to get familiar. Expedia, GE, Goldman Sachs and Optiver to name a few You get almost all functionality (if not all) from the website for free. On Leetcode without the paid subscription, there are definite drawbacks. For instance you can’t always submit your solution right away, due to how they run the solution to rank against all other solutions. Almost all problem statements have examples of 1 or 2 test cases and answers and pretty thorough explanations of why the answer is the way it is. That’s much less common on Leetcode. Every question posted on Hackerrank has a verified solution on the “Editorial” tab. Not every Leetcode question has one ( Though you could easily get an answer on both platforms clicking on the “discussions” tab) Both sites have visible test cases to run your code with before submitting. Hackerrank does a pretty good job of making those visible ones the common cases, while Leetcode almost always uses an edge case for the visible test. Hackerrack has vim bindings! (If you’re into that) Leetcode Strengths
Something I love about Leetcode is that they have straight to the point problem statements. Hackerrank tends to have a bit lengthy introductions and drawn out scenarios that mask the actual task. For example: Hackerrank could be like “Sally loves chocolate but only wants to eat chocolate with the lowest amount of sodium. Given an array of sodium levels, return the lowest chocolate with lowest sodium” Leetcode equivalent would be “Given an array of integers, return the min element” Both Hackerrank and Leetcode compare the run time costs of your algorithm by timing the solution with test cases. However, once your solution has been approved, it lists it against all approved solutions in the same programming language and the percentage of how many solutions you beat out for speed. The testing environment is far superior. When you enter a custom test case it also runs the correct solution too so you can immediately know if your’s is right or wrong. On Hackerrank, running a custom test case only runs your solution. Another thing I love, for every problem, the coding interface requires only working with some predefined function signature. In Hackerrank, a lot of the time you have to handle the input/output, and it runs string matching to validate the answer which can get a little annoying Seriously… why I should print “YES” or “NO” when the quicker equivalent is just keeping a Boolean object? Leetcode has that fancy “Question was asked by X Company with Y% frequency”, that you can access with the subscription. I personally think that this tool isn’t that useful, and gives false impression that people can just memorize all those specific questions once they get an interview with X company. I personally like LeetCode better and, ultimately, it comes down to what you’re using it for.
The problem isn't unique to software engineering, though. So long as there are lucrative, exclusive jobs whose qualifications include passing an exam, there will be a massive test-prep industry. Princeton Review, Kaplan, etc., etc.
I recently took a first stage coding interview on HackerRank and something I like from it was the ability the company had to make the hackerrank environment work for what they were trying to do. This particular exam, instead of me having to balance a tree or traverse a graph, both skills in which most engineers don't need, Gave me a set of integration tests, an API spec, and the way they needed a server started in order for the integration tests to run. I thought this was actually a pretty cool way of having it setup on HackerRank's part, as it was a coding test that actually quantified my ability at a skill that you would need in the role I was applying for.
While I believe that interviews based around testing these skills in isolation are not ideal, I think it is a bit too naive to say that these skills aren't related. Especially scaling by it's nature requires knowing what approach is the best based on the employed algorithms themselves.
Also anecdotally having worked with people focused on the skills you mentioned, it really is a drag having to walk them through even relatively easy pieces of code with some algorithm not offloaded to a library, time and time again, and always having to have some other person work on whatever problem involves more than glueing together some components based on "best practices" etc.
Our codebase is chock full of business logic complexity, but very little of our code contains any meaningful custom algorithms. Maintaining that business logic complexity requires a specific mindset that's very different from solving or optimizing algorithmic puzzles.
Good CRUD developers aren't necessarily idiots or code monkeys who only know how to glue together Stack Overflow answers. But selecting for people who enjoy / are good at solving HackerRank challenges would just get us unhappy and ill-suited engineers.
We select instead for people who have strong software design and architecture skills and get a kick out of improving products and making end users' lives better. The result has been an effective, high-performing team with a high retention rate. So you do what works for you and we'll do what works for us.
I have yet to design a system that requires more knowledge in algorithms than understanding architecture and CAP theorem. Scaling systems is based on a series of trade offs. There are very few scenarios that would require knowledge based on the underlying embedded algorithm unless your problem domain requires so.