The past couple months I’ve been working my way through different LeetCode problems because they force me to grapple with challenges that I don’t really see in my day to day work. I’ve shifted from HackerRank in order to increase the variety of questions that I see. The problems I’ve been working on are part of a curated set called “LeetCode 75”. These cover string operations, two pointer problems, sliding windows, prefix sums, stacks, queues, linked lists, binary trees, graphs, depth first/breadth first search, heaps, bits, and dynamic programming. I’ve completed about a dozen so far.
I Have used platforms like LeetCode for the past several years and I grant that they’re incredibly useful for preparing for an interview. Especially when it’s the platform used for initial screening interviews. I do have three complaints/areas that they could improve on though:
- Code completion: this isn’t 1983. We have more sophisticated tools than Notepad. Even Vim and Emacs have code completion. The fact that I have to have a second browser open to look up function and parameter names when working on LeetCode or Hackerrank is ridiculous… and always leaves me feeling a little dirty.
- Problem quality: I can’t tell you how frustrating it is for me to bang my head against a wall trying to optimize an “easy” question for hours on end, just to look at the editorial and be told “Here is a more mathematical approach to the problem. Note that this approach is more advanced/elegant and you should not feel discouraged if you do not come up with it on the spot in an interview.” If I can’t come up with the optimized solution without knowing some esoteric math rule (“interviewers hate this one weird trick!") then why mark it as “easy”?!
- Locked Editorials: Admittedly, this is more of a problem on LeetCode than it is on HackerRank. HackerRank’s revenue model focuses primarily on charging companies to conduct interviews. LeetCode’s revenue model focuses on charging users to prepare for interviews. It is still super frustrating to work on a puzzle for several hours and have to compare your solution to an obtuse, optimized solution in the discussion section that has no explanation for why it works or how the solution might more broadly apply to other similiar problems. LeetCode allows you to access these locked editorials for $159 a year (as of 20230805), but I personally avoid subscriptions like the plague. At the very least offer a one-time purchase option!
There are other more minor quibbles, but these are the largest ones. I think coding challenges can be a powerful tool to exercise seldom used programming muscles, but I think the existing tools to accomplish this still have a ways to go.
Photo credit: Stoked Ride Shopcomments powered by Disqus