Everyone likes to hate on LC, but it's rare to see people discuss practical replacements for these questions. Give your examples of such "practical" questions, so we can banish LC. The criteria are 1) an SWE is likely to write a similar algorithm from scratch at some time in their career, and 2) enough difficulty or signal for an interview. I'll start: Timers/Schedulers: 1) timed/scheduled events are everywhere, 2) it is difficult to trade off the behavior. What happens when an hourly job takes more than an hour? What happens when you scheduled something at 3pm and shutdown the system at 2pm? What happens when too many jobs are scheduled at the same time? How do you cancel jobs? What if the job is flaky and needs automatic retries? Reconciliation: 1) match the items in column A with the ones in column B, except 1 item in A might be the sum of N items in B or vice versa, or the data is noisy, or there are extras on either side. See this in accounting (column A has total expense, sometimes rounded, column B is sometimes itemized or missing), logistics (M orders in column A have N deliveries in column B), rules engines (some column A rules match against multiple events in column B, often want the solution where the most events in B are used); 2) difficult because brute force is sometimes too slow (often OK), or the data is noisy, or the columns actually don't add up but you must find the culprits. Heuristic speedups often very practical on top of the brute force solution. State machines: 1) Most hardware+software projects have these, many business processes modeled as such. 2) Some transitions occur under combinations of events (i.e. double-click, "simultaneously" press two buttons). Similar to the timers problem, what happens when the action for state A is not complete when the transition criteria for state B occurs? Does the candidate write spaghetti or do they create a rules/state table? #swe #interview #leetcode
Take home assessment where you build something useful
How do you know they built it themselves instead of paying someone and asking friends to help out?
Nah take home assessments suck
LC haters would say that it doesn't matter if it's practical, because it's the format that's unrealistic. You'll never need to implement any of these in an hour on a whiteboard without internet.
When you give gre/gmat/Sat for entrance to universities, you’ll never need to solve 40 maths questions in one hour in your whole time at the university as well, it’s just for people competing for the same thing and some people having worked harder/being smarter etc. LC haters are lazy asses who want exactly what they learnt at their job, they don’t want extra challenge
It’s not about the question. In fact, someone coding a perfect solution tells you just as little as someone not knowing where to start. The question should be slightly more difficult than a candidate would code perfectly because that would inform on thought process, troubleshooting, and communication. Also, it’s better to start at a super basic level and dig.
Yo, listen up! I coded maxflow, dfs, greedy algorithms and dynamic programming at Google so far. Can I take that LC interview now?
Pa?
"How would you define APIs to accomplish X? Implement your solution. This is infinitely better than something like: "Given a matrix of ones and zeroes sale a pirate ship around the islands to collect gold coins and stash them in the chest. How many gold coins can you stash before the British Navy catches you?:
But man in America the Brits could try to invade us again
API design is very easy once you have some industry experience. Also highly subjective. It's not good enough by itself to filter above average candidates from average ones.
Code a hash table with constraints like multithreaing etc.
Apparently hardest LC question (lowest acceptance rate): https://leetcode.com/problems/strong-password-checker/description/
There are two kinds of hard: awe inspiring problem that requires creativity and out of the box thinking, vs simple to think of the solution but too many edge cases or too difficult to code despite being easy in concept.
Right, FizzBuzz then!
I have a theory. Those who complain about LC questions are shit thinkers, who managed to become decent swes by grinding their day job. Not a bad thing in general, but you know why they hate LC style interviews.
Those who are good lc coders have no meaningful real world experience
When there are millions applying for the same Job with all of them having “real world experience” where do you go from there
Pick the person that’s the least asshole
How small our thoughts, Ariadne? We waste so much of our precious time on earth on this junk. 😂😂😂