6 ms·
Coding Interview Problems with Detailed Solutions, Test Cases, Program Analysis
- lazyant 7y agoin golang
- haecceity 7y agoI think python is the most efficient language to use in interviews tbh. Functional languages might be better depending on the problem but you don't want people thinking you're a witch or something.
- throwlaplace 7y agothere was a Google retrospective posted a long long time ago where someone cited data that people that use python do better. it's the reason I learned python.
- lazyant 7y agoheh, reminded me of https://aphyr.com/posts/341-hexing-the-technical-interview https://aphyr.com/posts/341-hexing-the-technical-interview
- ayberk 7y agoI learned enough Python for the interview questions specifically for this. Based on my (obviously anecdotal) experience, candidates I interview spend considerably less time on actual coding when using Python. That being said, Scala makes design questions much easier thanks to its type system.
- Koshkin 7y agoWouldn’t work for a C++ position...
- patrickthebold 7y agoI'd like to learn APL solely for interviews.
- johnwh 7y agoPython (or really any dynamic programming language) makes interviews a lot easier, however I have started asking more in-depth questions to make sure they actually understand Python and have done a little bit of research into the language and implementation. I have noticed some colleges have been teaching more to the interview, so their grads can crush some problems in Python but fail when you ask them to implement a helper they were using. I am not talking about implementing a heap either, I am talking about merging objects.
- wy35 7y agoI switched from Java to Python for coding interviews and it's well-worth it. I can solve problems a lot quicker due to the simpler syntax.
- stuxnet79 7y agoAgreed 100%. Switching from Java to Python because I grew tired of Java's verbosity.
- eerrt 7y agoalthough most problem solutions seem pretty clear and understandable even for ppl not familiar with Golang
- vanusa 7y agoThe fact that one can just ahead and cram for these problems should pretty much... severely downgrade, at least, their usefulness as hiring filters.
- banachtarski 7y agoEveryone always says this, but the fact remains that it is a filter in the sense that not everyone can learn it, or retain it. People always complain that the techniques requested in an interview are not required for the job. I see it in a different sense. The jobs they ultimately qualify for do not require such skills.
- vanusa 7y agoThere's now doubt that these tests serve as some kind of "a" filter. The question is, whether they serve as a particularly good filter.
- coin 7y agoFANG recruiters will even give and encourage these study aids to candidates before their interview.
- shantly 7y agoIt’s a how-bad-you-want-it filter. Plus a bit of an IQ test (to recognize which solution applies—of course even more studying can help here, too). It’s working as intended.
- vanusa 7y agoIt’s a how-bad-you-want-it filter. As long as that's how it's thought of - I can see the value. I think people are in the habit that it does a lot more than that, though.
- underpand 7y agoWouldn't you want people who care enough about their career to cram? That itself is a good signal. Cramming algorithms problems is difficult and succeeding shows grit. It also selects against sociopaths who BS their way through subjective personality interviews.
- heyflyguy 7y agosome of these questions seem super easy, and then some of them have wording that seems impossibly hard to comprehend.
- brenden2 7y agoSomewhat related: a while ago I went through a bunch of the "Cracking the Coding Interview" problems and completed them in Rust, whilst recording most of the coding for YouTube (until I got bored). Here's the project: https://github.com/brndnmtthws/cracking-the-coding-interview-rust https://github.com/brndnmtthws/cracking-the-coding-interview...
- dijit 7y agoWow, that's awesome I was literally just looking for something exactly like this.
- songzme 7y agoIt pains me to see another Coding Interview preparation tool. It's such a sad situation in the current industry. Students learn to game the system to get a high paying job. Students who care about what they are working on will painstakingly try to perfect their projects. They don't have time to game the system and therefore have a hard time getting a coveted job. Companies want to hire "the best" so they usually hire someone who can ace the company's interview. People who can ace the company's interview are usually those who studied for it. I recently took over a codebase from an ex-employee who went to Google. People were happy for him but I am so indignant. His code caused me hell. One production bug after another led me to eventually throw out all of his code. His code was written by somebody who did not care and his tests were useless. I'm pretty sure during his time at our company he was focused on leetcoding so he could get somewhere better. I wanted to reach out to him on LinkedIn to give him a piece of my mind hoping it may make him a more responsible engineer but I decided against it. I focused on fixing the features for the users because it was the right thing to do. I want to work with people who care about the product they are working on. People who care about building great products are not solving coding interview problems.
- amiga_500 7y agoNow zoom back one level. Most of the jobs (not all!) are doing something pointless like increasing advertising revenue.
- Waterluvian 7y agoMaybe that's the point. Make the wall so tall and hard to climb that candidates are convinced what's on the other side must be worthwhile. I'd say 99% of the job postings FAANG recruiters email me about sound brain meltingly dull.
- Koshkin 7y agoHow’s this different from a school exam preparation tool? It won’t teach you the subject; and if it did then what’s the harm?
- 7y ago
- herval 7y agoThe new trend in SF/bay area seems to be companies you’re applying to preparing you _specifically_ for the questions they’ll ask. People realized no one memorizes one specific search algorithm or puzzle, so they now tell you, before the interview, that you’ll be asked problems A, B and C. Not “algorithm problems” or “search” - “we’ll ask you to revert a doubly linked list”. It’s bizarre.
- chris11 7y agoWhere have you seen that? The most I've been given is a general interview prep guide about how to prepare for an on-site.
- herval 7y ago2 “FAANG” companies and another one of the top big tech ones. One had a recruiter calling and literally listing all the questions they “could ask”, coding, architecture and all. They asked all of them.
- mgkimsal 7y agoI don't think it's the companies themselves as much as the recruiters. I've had recruiters pump me for info on the specifics of the question asked, and I obliged. I was younger and naive, and... didn't understand what they were doing. Not until later, when the reverse happened to me - I was given "potential" questions to prep for (which... I already knew answers to because it was my regular day job for) that I understood why I'd been asked about that stuff before.
- paxys 7y agoYou are implying that FAANG recruiters are doing this without the knowledge or consent of the hiring team, which is ridiculous.
- scarface74 7y ago
- cjohnson318 7y agoI like using the Blum Mental Hash as an interview question. As far as I can tell, it's not mentioned in any interview cram lists, and it's complex enough to see how candidates split up a problem. https://scilogs.spektrum.de/hlf/mental-cryptography-and-good-passwords/ https://scilogs.spektrum.de/hlf/mental-cryptography-and-good...
- Waterluvian 7y agoThat looks fun. Do you require them to know trivia or do you provide them with the definition and ask for an implementation?
- cjohnson318 7y agoI explain how it works first and then ask for an implementation. I look for sane code organization, correctness, and an awareness of Pythonic idioms if it's a Python heavy role.
- banachtarski 7y agoIt feels really easy? Or am I misunderstanding the algorithm/question?
- cjohnson318 7y agoIt's not rocket science, no. I wanted something that could be done rather quickly, that would generate a fair amount of code, that wouldn't require any recursive tricks or discrete math. From there, I can usually look at their code and make a determination.
- dingribanda 7y agoI have been prepping for almost 6 months now. I look at the stocks new hires get at my company and what my refreshers are. Companies seem to be relying on the fact, most people are too lazy to leetcode and will not give good refreshers. I have been with the company long enough that leaving and coming back atleast will add 600k to my earnings in the next 4 years. One thing however though I notice, that my coding speed has improved a lot by doing timed leetcode questions. I also look at the complexity of everything I write far more than I used to. Overall it looks like a win, win for me. The moment my company gave same level of stock as I would get in 2 years to a new college hire, I have decided to move. I have been with the company for more than 18 years. It is possible it is my company that does this. I hear goog refreshers are good.
- johnwh 7y agoAlthough I absolutely hate it, I interview every 1 or 2 years and use it as negotiation for refreshers. The only time I ever got a reasonable pay bump was by showing I had alternative offers. On the other hand, you have to also be willing to leave.
- jointpdf 7y agoDoes anyone have insight on the extent to which interviews for ‘data scientist’ or ‘ML engineer’ roles involve Leetcode-esque or whiteboard coding exercises? What is the norm (if any) for assessing coding and subject matter competency for these sorts of roles?
- Falcorian 7y agoIt depends on the company and the role. In general, I would be prepared for some white boarding questions, although I've found they're generally "a little easier" than the ones the engineers whine about.
- mrbonner 7y agoThe coding interview in our industry reminds me of a question on Quora I got today. It asks if it is true that Richard Feynman only had a 125 IQ score. It is the case. And it makes me wonder how much good those interview questions are used to judge someone with a limited time. I know a few people in my company were let go after 6 months albeit they did fabulous with those interview questions.
- seanmcdirmid 7y agoIQ is hard to measure, and it isn’t really clear what it represents anyways. Metrics are always going to be incomplete, unlike in a litrpg.
- RangerScience 7y agoNeat. I actually had a coding interview I got to skip because I'd already done the exact same question for another company, and had done my original work in Git+Github :) Going through these and writing up solutions seems like a decent hobby project, applicable to a lot of situations.
- acconrad 7y agoPracticing for coding interviews are to FAANG companies what the SATs were for the Ivy League. It's not about how smart you are or how well you will do. It's about how good you are at studying interview problems/the SAT. And even then it's a crap shoot if your admission reviewer/interviewer was in a good mood that day. As much as it's suboptimal/unfair/whatever your objection is, your options are to not play the game (and miss out on the wealth of opportunity or cash) or to dive on in and accept reality.