16 ms·
Data Structures for Coding Interviews
- gameguy43 9y agoOriginal Author here. Happy to answer questions about this piece or coding interviews in general! And eager to receive any feedback. Thanks for the post!
- throwawaybbq1 9y agoYou've got a cool site and I appreciate all the hard work creating high quality content (I've looked at the free questions and considered subscribing a few times in the past). I think your business model/pricing could use work. Unless I'm mistaken and things are going well .. in that case, I'll withdraw to my cave :-p My suggestion would be to have a slightly cheaper tier (probably no more than a hundred bucks). This mirrors the cost of two-to-three interview books. You could add a custom grading or personalized tutoring option for the full 500, or heck, even more (this is sort of like the GRE/GMAT prep option). Come to think of it .. I wonder why the GRE/GMAT prep crowd hasn't tackled programming interviews?
- gameguy43 9y agoThanks for the note. Definitely a great point. Not sure yet how we tier out our product, but tiered pricing is definitely the state of the art. We've been working on some /tech/ to enable tiered pricing in the meantime. The Site's all custom, and so far there's no notion of a "product" yet...just "paid" and "unpaid." Share your question re: where's Kaplan on this stuff!
- neerkumar 9y agoPrice seems expensive to me as well. In data science there is a similar site which has become pretty popular if you are interviewing in those top tech companies, but it is cheaper. As the guy above was suggesting, that data science site does personalized feedback and that justifies the high price. Otherwise, the way it is now, it feels like it should be priced similarly to CTCI.
- gameguy43 9y agoWhat's the data science site!
- neerkumar 9y agohttp://datascientistjobinterview.com http://datascientistjobinterview.com
- gaius 9y agoIt's crazy that there is a whole industry dedicated to cheating ahem gaming job interviews in software/IT. Imagine if doctors or lawyers or real engineers did this. No wonder we can't get taken seriously as a profession.
- southphillyman 9y agoIs it cheating or gaming the system if the vast majority of QUALIFIED engineers would not pass an interview without preparation? Reviewing these cheat sheets every couple of years is essentially part of the job.
- logfromblammo 9y agoImagine if docs could be rejected from a new job because they failed to repeat the obscure diagnosis that was featured on the last episode of House, that really has nothing at all to do with the job they wanted to do. Imagine if lawyers could be rejected for not being able to explain the minority opinion in Foobar v. Bazquux, which again, has absolutely nothing to do with their expected duties as prosecutor of poor people with small amounts of marijuana. Imagine if real engineers were asked to build a suspension bridge out of silly putty, table salt, and carbon fiber. The interviewees are simply doing their jobs, which is to analyze a problem and implement the most cost-effective solution. The interviewers are the ones causing the problem. Granted, it isn't always because they are non-technical people trying to gauge the value of skills they don't understand. A lot of times, it is because the interviewer is a tech person that still can't effectively gauge the value of skills they do understand, and also wants to look clever in front of a stranger, subtly discriminate to preserve "culture", and do the same stuff to others that had been previously done to them in their interviews.
- soham 9y agoWe are definitely on to tackling the prep thing. Been around for 3 years actually: http://interviewkickstart.com http://interviewkickstart.com Looks like Kaplan is not going to be interested in these things after the recent shutdown of DBC.
- sanderjd 9y agoNice graphics! I really like from-the-bits-up explanations of things like this. I found the newsletter upsell in the sidebar very distracting. I know you're considered a fool if you fail to bash people over the head with newsletter sign-up requests these days, but maybe just keep the ones interspersed in the text and get rid of the one I have to see all the time? Or I guess AB test it or whatever the cool kids are doing for this stuff. I dunno, but it really detracted from what I otherwise thought was great content. Best of luck to you!
- gameguy43 9y agoReally helpful to hear. We were worried about it but thought "once you get into reading the piece you'll probably just forget it's there, right?" We're really focused on trying to "twist the knobs" only up to the point right /before/ it starts getting annoying.
- numbsafari 9y agoI gave up reading your site because of the obnoxious popovers. It's super annoying.
- gameguy43 9y ago:( Ok, time to rethink the email opt-ins.
- ing33k 9y agoI would have ignored that advice if your target audience were non tech users.
- numbsafari 9y agoMy wife is a non-technical user. She has just about given up on using the internet because of the prevalence of these annoyances.
- virtualized 9y agoBecause "non tech users" like bad web design? Why would they?
- Y7ZCQtNo39 9y agoThe opt-out button: "I don't need more coding interview practice". My first thought: Whoever designed this is super salty for me not wanting to provide my e-mail. Out of all of the problems in my life, too much e-mail is certainly one of them. I like to keep it to a minimum. And as an adult, a weekly coding problem falls so down far on the priority list compared to all the other e-mail I'd get.
- biocomputation 9y agoCool site. C++ graphics programmer here. I would like to add that knowing one thing extremely well - even a fairly small thing - can have amazing results in interviews. I can write just about anything, on command, in GLSL. This has gotten me more interview offers and job offers than I can count, and it really didn't take me all that long to learn. I hate to promote memorization, but honestly, it works. Some people argue that memorization isn't the same as learning, and it's not. But it definitely helps you learn and increases understanding.
- esfandia 9y agoYour explanations were excellent. I especially liked the way you introduced hash tables using a simple array where the indices had special meaning. The diagrams are clear and helpful. Only nitpick: not sure how somebody who is supposed to learn what an array is by reading this is supposed to already know the meaning of Big O notation. So maybe a little intro to Big O complexity somewhere in there would help as well.
- gameguy43 9y agoEep! Did you notice that the first time we mention big O notation, you can click on it and an inline explanation slides down? Probably not, based on the question! We should make that part louder.
- justinpombrio 9y agoAs another data point, I thought the big O inline expansion was pretty clear, and clicked on it.
- esfandia 9y agoThe problem with links is that you don't know where they are going to take you. When I have such a nice piece of text to read I don't want to click and potentially land in a completely different site, have to click "back" and all that distracting stuff. That's probably why your link didn't "register" with me. In your case in turns out the link nicely expands in place, so that's pretty cool. I'd still just inline that little explanation on Big O, since you keep referring to it in the rest of the text. It's more than a mere footnote. Now this is all my own experience, and others may disagree, so don't necessarily go changing things just on my account!
- nafizh 9y agoIt is a good site. I actually bought the product a year ago. But then I had to do something else which made me to not focus on getting an internship/job, and only recently I noticed it has a one year timeline. I think a one year time limit is too little for a 100 dollar product.
- curiousDog 9y agoNice site but your questions are pretty run of the mill these days. Would be nice to see some new, original questions :-). Also an option to schedule some mock interviews would be great!
- gameguy43 9y agoThanks! Have a few new questions in the pipeline :) For mock interviews, definitely check out: - http://interviewing.io/ http://interviewing.io/ - http://www.byte-by-byte.com/practice-coding-interviews/ http://www.byte-by-byte.com/practice-coding-interviews/ - https://www.pramp.com/ https://www.pramp.com/ - https://www.funnel.la/ https://www.funnel.la/ - http://interviewkickstart.com/ http://interviewkickstart.com/ (email 'em to ask about mock interviews over Skype)
- thaumasiotes 9y ago> For mock interviews, definitely check out: > http://interviewing.io/ http://interviewing.io/ I got this recommendation about a year ago and tried. The site stated that I couldn't register, but I could sign up for a place in the registration queue. So I did that. I have yet to hear back from them. I don't quite understand how people keep recommending them, as if it was possible to use the site.
- leeny 9y agoHey, I'm the founder of interviewing.io. We're coming out of private beta soon, which means we'll be sending out invites to folks on the waiting list shortly. A year is a long time though, and I'm sorry you had to wait that long, so I figured least I could do was kick you an invite (check your email). Thanks for being patient with us while we figured things out.
- thaumasiotes 9y agoI guess it's a nice gesture, but this does nothing to address my point that, as far as I can tell, recommending interviewing.io to anyone is wildly inappropriate, and I can't see how it happens at all. (Not that you're the proper person to address that; it's more of a question for gameguy43 et al.) Are the people giving interviewing advice not actually even attempting to do the things they're recommending?
- auston 9y agoWhat is your best email address?
- gameguy43 9y agoparker@interviewcake.com
- Silhouette 9y agoHonest feedback (short version): Very nice presentation, but for me the content loses credibility thanks partly to some silly mistakes but also to glossing over a few too many details. Some examples: The integer overflow part has incorrect binary/decimal conversions all over the place. The example hash function used (summing elements modulo number of buckets) could be dangerous. I'm not generally a fan of showing bad practice or incorrect examples when teaching, even at an early stage when the student isn't ready for the real deal yet, but if you must then you could warn the reader that it's a simplistic example for demonstration and shouldn't be used in reality. It would not make a good impression if a candidate said they knew about hash tables but then produced that function as an example of hashing. Similar comments apply to the treatment of big O notation. I understand that your style is to try to avoid being scary and complicated, but big O is useful because it has a specific meaning. Even in the longer explanation, you hardly mention that fundamentally it is about scalability and bounds, and you mention the danger of overlooking the constant factor only briefly right at the end. Also, the casual initial characterisation as being relative to the size of the input sets up traps when dealing with more sophisticated data structures, such as graphs where you often need to refer to the number of nodes and/or edges when specifying complexities.
- gameguy43 9y agoFixed the bugs in the integer overflow section!
- nichochar 9y ago> Don't worry—we'll skip the convoluted academic jargon and proofs. Aaaaand this is why I hate using this as a method for interviewing. I actually care a great deal about people that care about that stuff. I would rather you know all the principles and can reason your way back up, however slowly, than repeat something you've practiced enough for an interview. I understand the author really only wants to help people, but let me tell you as someone who works for one of the "cool unicorns" that the quality of software engineers is really bad, most likely because of this efficient "gaming of the system".
- __sr__ 9y agoPeople don't have a choice but to game the system. If you can't solve the problem quickly enough on a whiteboard, you are rejected. You are typically not given enough time arrive the solution from a scratch. You either know the solution or you don't. I agree with you, this method for interviewing sucks.
- Mutinix 9y agoIt's unfortunate, but all the companies are doing this. Here's what a Google lead said in a tweet: > Hello, my name is Tim. I'm a lead at Google with over 30 years coding experience and I need to look up how to get length of a python string. DHH: > Hello, my name is David. I would fail to write bubble sort on a whiteboard. I look code up on the internet all the time. I don't do riddles. Max Howell: > Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a whiteboard so fuck off. And yet, everyone is asking these questions about print a string in zigzag fashion or something silly like that. Engineers are gaming the system because the system is garbage. None of us are looking forward to waking up and solving HackerRank, LeetCode and CtCI problems till the joy of programming leaves our bodies.
- j2kun 9y agoThere's a difference between not being able to write bubble sort and realizing that looking it up is a better use of your time. But when it actually comes time to do something you can't copy/paste off the internet, what do you expect a programmer who can't reinvent a half-decent bubble sort to do? The interview is to convince the other person that you can think logically about programs. Bubble sort is a low, low bar, and basic data structures are not much higher.
- nikofeyn 9y agoi actually have began to enjoy places that use these types of things for interview questions. it's a good way for me to know that i don't want to work there. i once interviewed at a prominent company focusing on a certain language. they specifically stated in their job application that they just wanted motivated, enthusiastic, and smart people and that they didn't care if you knew said language. i sent them my resume with some recent code from my job since i had, within a few weeks, learned their language of choice on the job and on the fly for a project. it got their attention since it was decent code for someone new to the language. in the interview, they proceeded to quiz me on the language, including very specific details of how the language is implemented and things that don't even matter in day to day use of the language. and most of the stuff was something you could easily learn over a period of days or a week by just reading. it still boggles my mind. people, even very smart people, have no idea how to interview.
- brooklyn_ashey 9y agoyes. The interview process is something out of the eighteenth century. It's just funny that with all the data collection and testing capabilities we have developed, we can't figure out how to create creative interviewing processes that target specific needs. I think it points more to the employers often not understanding what specific candidte qualities would actually make their team stronger. Sometimes, it's the glue that is most needed, and no one has figured out how to test for glue or morale optimization. These would be helpful target areas. They need to look at why certain world-class sports teams and arts organizations are so successful at what they do. A lot of this has to do with heart and morale. This process drains such qualities from candidates over surprisingly short periods of time.
- CharlesLiuCN 9y agoThat's true, but this kind of interview questions will always be asked even for so called BAT in china.
- Celine_ 9y agoSince I started with my online business I earn $95 every 15 minutes. It sounds unbelievable but you wont forgive yourself if you don't check it out. ----------------->>http://ow.ly/iBXm30dNtIZ http://ow.ly/iBXm30dNtIZ
- axaxs 9y agoMaybe it's just me, but I hate these interviews. Why? Because it excites me to do interesting things. Then I inevitably just end up writing REST APIs.
- arwhatever 9y agoI've had the same thought - if I actually did the interview-type algorithms and multi-system scalability challenges on a day-to-day basis, it might just be a super cool job.
- dcw303 9y agoThis is a good cheat sheet for those who don't have (or have forgotten) the knowledge but want to game an algorithm heavy interview. The problem I got with this is exactly the same as when I tried reading the "Cracking the Coding Interview" book: I got through a few chapters and then the author mentions something off the cuff with an assumption that the reader will know what they mean. But of course, I don't, because these books are basically a collection of cheats and hacks. I get frustrated that I don't understand it, so I seek out something that starts with the fundamentals and expands from there. What I'm trying to say is that I'd rather slog through 900 pages of Sedgewick and come out with a thorough understanding rather than try 20 quiz questions to be stumped by whatever the hell they were trying to get at with question 21 and then give up.
- gameguy43 9y agoCEO of Interview Cake here. We work really hard at trying to not do this. Feedback on where folks get left behind is pure gold to us, because it lets us know what we need to smooth out next. We're not trying to be the /biggest/ resource out there--we're trying to be the /smoothest/. For this article, do you remember where specifically you got left behind?
- dcw303 9y agoTo be fair to your article, it actually reads quite well and has good detail for what's covered. I thought the big-o coverage was a bit sparse, but I also didn't see the expand link the first time.
- gameguy43 9y agoEep. Second person to say that in this thread. We had it in one of those gray boxes in an earlier draft (so you didn't have to click anything to see it). We'll probably move it back out.
- bsamuels 9y agoi have the same feelings about "cracking the coding interview" the day someone unironically asks me to "Write an algorithm to print all ways of arranging eight queens on a chess board so that none of them share the same row, column or diagonal" - I will jump off a bridge
- ShirsenduK 9y ago12 years of professional coding, still haven't been able to use my data structures knowledge!
- nu2ycombinator 9y agoThey are charging $200 for 40 odd questions. If this makes such a business, this tells how fucked up the whole interview process is.
- bastijn 9y agoI once walked into an interview with such questions. On the first question I asked them why they asked the question. The interviewer looked puzzled and asked me to finish the question. I again asked him why, what part of my job would require it. He couldn't answer that question whilst he was an engineer at the department I was interviewed for. I asked a follow-up question if he had the same questions when he joined, and if he ever felt the need for that knowledge particularly. He responded it was good to know, companies like Google and Amazon did the same. I walked out five minutes later thanking them for their time. I could have answered the question easily but what for? In the off chance that someone stumbles along and blindly copies this into interview questions for his company. Think again, realize what your company needs and tailor your recruiting process for that instead of copying stuff others do. Thanks.
- ng12 9y ago> I could have answered the question easily but what for? To show that you're not a complete diva who's willing to put in some work even if it's unpleasant? The question I ask is not real, either. It's entirely contrived. But I ask it because it's the best way I know to identify candidates who: 1. Can think critically about a data structure. 2. Can communicate with me about how to solve non-trivial problems. 3. Can translate an idea into code without thinking about it too hard. Given lots of time there are much better ways to test a engineer for these attributes. Given an hour it's about the best I can do. That's not to say everyone who asks these types of questions does it well (I think there's a fair bit of cargo-culting around "The Google Interview") but if you're unwilling to even humour me I think walking out is the best response for both parties.
- bastijn 9y agoFirst, if he would have given that answer instead of saying others did it I would have answered the question. However, his answer indicated they asked just because of asking. Second, even when you have those reasons ask questions on actual situations that would occur on the job. You run a large C# code base that struggles with its size and configuration complexity vs flexibility? Ask questions on how he would design a new speculative module for the Platform. What kind of pitfalls would he foresee? What would he focus on? See if his answer include your struggles indicating he understands what his daily job is about. If you search an engineer to speed up your image processing pipeline which is C++, data structures can be fine but don't forget that before optimizing them you probably have to spend a lot of time optimizing the design of the entire pipeline so also ask questions about that part. My main advice is think before you ask. If you have valid reasons, feel free to ask data structures. If you don't, think again.
- trevor-e 9y agoThe article is really well written and has amazing design, but honestly does not seem very helpful. Isn't most of this learned in the first year of university? Who is the target audience in that case? Given the title, I hoped to learn some lesser used data structures rather than what a pointer is. With that said, I do look forward to future articles!
- gameguy43 9y agoAuthor here :) Thanks for the note--this is interesting. Target audience is folks who never learned this stuff, or learned it but forgot it. Interesting to hear you had a different assumption from the title. If you want something trickier, check these ones out: https://www.interviewcake.com/question/stock-price https://www.interviewcake.com/question/stock-price https://www.interviewcake.com/question/swift/find-duplicate-optimize-for-space https://www.interviewcake.com/question/swift/find-duplicate-...
- 1024core 9y ago> Target audience is folks who never learned this stuff, But then why would they be interviewing for a coding job anyways? Shouldn't a coder know what's a RAM, and that it's different from secondary storage??
- gameguy43 9y agoI'm thinking a lot about folks who come out of coding "boot camps." Those folks for the most part have /heard/ of "RAM" and "disc," but might not know why they both exist and what each one does.
- 1024core 9y agoI would not want to hire anyone who doesn't have _some_ idea of what these things are, and how they work.
- 9y ago
- watwut 9y agoIt is exceptionally well written. It also seems to be targeted at very beginners, so I think it could also do good as targeted for students.
- pavlov 9y agoHiring engineers based on data structure trivia is like hiring a marketing department based on spelling bee scores.
- savanaly 9y agoIn that one wouldn't want to hire someone as a marketer who couldn't spell "cat"? Not because it's necessary to be able to spell "cat", even, but because the inability to do so might indicate in a bayesian sense that the person is not likely equipped to do the job.
- thaumasiotes 9y agoNot really apt as to spelling bees. High-level spelling bees try to use words that are as obscure as possible, because people will happily go forever on words they know. SAT vocabulary questions are chosen to be informative about the test taker's IQ; spelling bee words are chosen to be unfamiliar to everyone. You get a list of words that you're supposed to memorize; they could just as easily be random strings.
- Terr_ 9y agoExactly, it's analogous to how companies seek obscure interview question variants, sometimes explicitly stating that their goal is to to see "how you think" rather than to get the right solution.
- deleted 9y ago[deleted]
- drewrv 9y agoI think these types of questions are a good filter for the big tech companies, just in a different way than most suspect. What these types of interviews filter for is... - People fresh out of college and therefore relatively young. It would be illegal to make this an explicit policy. - People who really really really want the job. All employers want to filter by this criteria. - People who will accept the status quo and tolerate absurd bureaucracy.
- daliwali 9y agoI got an impression who their target audience is, based on the examples used, drinking kombucha and listening to Spotify. All the young, beautiful people who wouldn't have ever taken a computer science course if it weren't such a lucrative industry to be in right now. Maybe with this guide they can pass an interview at a big company where they just twiddle with bits all day. I won't be holding my breath until they can produce something useful.
- gameguy43 9y agoBRB, gonna change it to drinking "Ensure" and listening to "Days of Our Lives" :P
- mdns33 9y agoit is what it is.
- FlyingSnake 9y agoThis is what you get when you commoditise Computer Science. The article is about coding interviews and then goes on to deliver a lecture about "Computer science in plain English". Isn't it common knowledge that Computer Science and coding are like chalk and cheese? People used to study DataStructures for a whole semester to get a deep understanding of how these work, and the time/space complexities affect system design. But now we get a pop-culture laced listicle that people will use to ace the interviews and write mediocre software. Does anyone wonder why there aren't listicles like this for Structural Engineering/Thermal Power Engineering/Mechanical Engineering etc? No wonder we get data-breaches, password leaks, system outages, because we continue to treat Computer Science/Software Engineering as the next fad to make quick buck, and not science. </rant>
- sgt101 9y agoIt isn't science, or engineering, because many of the things that count in computing defy measurement : - code quality - software productivity - expected time between failure - tolerance to error - expected life in field - usefulness to users Because the science and engineering cultures of computing have failed to address these effectively, or even create cultural norms that support their development, a craft culture has evolved instead. Coders are artizans rather like clock makers in the 16th century.
- grassfedcode 9y agoI recently added data structure visualization to a gdb frontend called gdbgui, which might be of interest to people trying to debug their algorithms. https://github.com/cs01/gdbgui https://github.com/cs01/gdbgui
- rzzzwilson 9y agoI read this What happens if we have the number 256 in an 8-bit unsigned integer (1111 1111 in binary) and we add 1? The answer (257) needs a 9th bit (1 0000 0000). and I didn't read any further. I don't think many interviewers would be eager to continue after hearing that, either.
- ahjones 9y agoI think you're being a little bit unfair. The same block then continues: This is called an integer overflow. At best, we might just get an error. At worst, our computer might compute the correct answer but then just throw out the 9th bit, giving us zero (0000 0000) instead of 257 (1 0000 0000)! (Python actually notices that the result won't fit and automatically allocates more bits to store the larger number.) The article is introducing the concept of integer overflow.
- ldite 9y ago1111 1111 = 255 1 0000 0000 = 256 Anyone who claims to understand integer overflow from actual experience, rather than memorizing textbooks, should know that by inspection. I'd forgive that in a CS grad (possibly) but if someone claimed to have been working in C or other unsafe languages for more than a trivial amount of time I'd be very suspicious.
- elldoubleyew 9y agoWell he did say he didn't read any further.
- weatherlight 9y agoIf you can't explain it simply, you don't understand it well enough. All these CS Degree wizards and gatekeepers need to come out of their ivory towers.
- andrew_wc_brown 9y agoBig yellow newsletter box interrupts my reading that I was compelled enough to open inspector and remove it. The pricing makes no sense, that or its not obvious what you are getting in the full-course. The testimonials appear phony. I believe in products when I recognize programmer celebrities or the testimonials link to a github or something to prove they are legit. The pay box is sketch. Even though its powered by stripe. I'm not dumping my credit card without CVC, expiry and postal code. There's nothing on here you can't already find for free. The value to me is saving time. I've done this before but forget because web-programming the last 10 years rarely required to commit this stuff to memory. I'm a different use case I suppose but I want a super abridge version. I just don't want to a spend a week. I want to spend a few hours. Theres nothing telling me how much time I will spending having to read through this course material.
- dubya1 9y agoIf Hacker News hates this, they'll really hate Vaidehi Joshi's explanations of data structures https://medium.com/@vaidehijoshi https://medium.com/@vaidehijoshi. She explains them in simple terms AND she's a woman. Hope your heads don't explode, boys.
- yeswecatan 9y agoI bombed an interview last week. Five straight hours of whiteboarding. One of the interviewers (just a year or two out of school) admitted he got his questions from interviews he went on in the past. What he didn't mention was whether or not he answered the problems correctly. What if I was being judged for not being able to solve something he could not solve himself? People that ask these types of questions take the easy way out. It's a lot harder to ask thoughtful questions that really try to gauge if somebody knows what they're talking about because you have to really understand things yourself. For instance, somebody can easily say they setup a pipeline that scales. Sounds great. Asking questions that makes them go into finer detail to make sure they're not bullshitting you is a bit tougher.
- asdq 9y agoAlso, refer http://www.techiedelight.com/list-of-problems/ http://www.techiedelight.com/list-of-problems/
- AlgoLover 9y agousing STL - http://www.techiedelight.com/data-structures-and-algorithms-interview-questions-stl/ http://www.techiedelight.com/data-structures-and-algorithms-...