12 ms·
The Programming Interview from Hell
- SeanLuke 10y ago> Manholes covers are round because that is the shape that won’t fall in It's worth mentioning that this oft-repeated canard doesn't have much evidence. Manhole covers come in a great many shapes, and this has always been true: the Romans made them square. There are plenty of shapes which won't fall in, such as any curve of constant width. Basically fake-Feynman is right: manhole covers are round because it is often convenient to make manholes round.
- Neliquat 10y agoModern manhole covers are overwhelmingly round, and cast as not to fall into their own fitting, also cast. Not sure how a obscure counter example does anything other than disprove your point further. Source: worked IT for public civil engineer for a few years.
- SeanLuke 10y agoThere are many cities where manhole covers are overwhelmingly rectangular. I'm typing from one right now: Rome. SPQR! I used to live in a town in the US where many of the manhole covers were shaped like a D.
- zero_iq 10y agoI assume that by 'obscure' you mean 'outside your-state, USA'. Here in the UK, rectangular manhole covers are the overwhelming majority.
- joncrocks 10y agoI think the point is that a circle is not the only shape that can't fall into it's own hole/fitting, so it's the combination of this fact along with other factors that make a circular cover popular. https://en.wikipedia.org/wiki/Manhole_cover#Circular https://en.wikipedia.org/wiki/Manhole_cover#Circular
- rammytech 10y agoi recently had an interview which was plain smart what i need to get my work done questions i loved it ( i took that offer ). but then there were few where they did ask me a question on solution implementation and when i solve it they said there is a better way to do this and then I would be like ok then let's discuss but then they were quiet on the other side and waiting to hear me answer the best possible way to solve question ( like 15 mins )
- magic_beans 10y agoPunctuation is your friend.
- salesguy222 10y agonot everyone who speaks desires to be heard by everyone :)
- gruturo 10y agoYou should definitely contact a reddit user called CommaHorror. This is his writing style, which I believe would complement yours quite nicely: https://www.reddit.com/user/commahorror https://www.reddit.com/user/commahorror
- rammytech 10y agoi completely agree. I wrote that comment from my mobile and it is not my friend. P.S : this is replied from desktop. hope this works for you
- coldcode 10y agoWhat a fun interview it would be to actually do this. My favorite interview was for an architect position, where my two future peers took turns telling me horror stories about working there, to see if I would run away screaming. I got the job and only ran away screaming 18 months later.
- gagege 10y agoI've learned in the past few years that, if the interviewers gripe about anything in the interview (especially management), it's best to stay away from that company. In an interview, the company is trying to put it's best face on to sell themselves to you, and if the employees can't hold it in for 30 minutes, that's a bad sign.
- scarface74 10y agoI've been on both sides of the horror story style interview -- as an interviewer and an inteeviewee. As an interviewer, if there was someone we liked, we were brutally honest about the company culture. We (myself and my manager) wanted senior engineers who weren't afraid to speak up and help shake things up in the larger organization. If they still accepted the offer, they were what we wanted. We had too many people quit out of frustration instead of fighting. At another job I applied to as an architect, the manager told me all of the issues with the processes (and lack there of). He tried to "scare me away". I asked him one question. Will I be able to come in and make the changes needed and will he have my back if I inadvertently step on toes trying to do the right thing? He said yes and I accepted the offer.
- phyushin 10y agoIt's somewhat ironic that they get horrified when you say you'd Google something and then the lateral thinking questions are normally the first five from the Google search 'lateral thinking puzzles'
- Patient0 10y agoOK - but here's a genuine problem that came up the other day in my work (reconciling two datasets - we have various many-to-one mappings of ids that we then want to reconcile against each other). I think it's quite a neat computer science/algorithm challenge, so here goes: Write a function which takes as input a list of sets, many of which are not disjoint, but will output a list of sets where all of the non-disjoint ones have been merged back together again. So the output is a list of sets which are all disjoint from each other because any intersecting sets have been merged together. e.g. given the input: [(1,2,3), (2,4,8), (10,11,12)] it will report back: [(1,2,3,4,8), (10,11,12)] because (1,2,3) and (2,4,8) are not disjoint, but the (10,11,12) set is. Whereas given the input: [(1,2,3), (2,4,8), (10,11,12), (8,10)] it would report back a single set: [(1,2,3,4,8,10,11,12)] because now all of the sets are connected - the 8 and the 10 now connect everything else together. I came up with an algorithm which is acceptable for the dataset we currently have - but I've no idea what time complexity it is (for our real dataset it was able to do it in "one pass" - but in principal it could be worse than that). I don't know how I would implement a distributed version if the list of sets was too big to fit in memory, etc. etc. And I haven't found a good solution on Google (but I'm not even sure what to Google).
- deleted 10y ago[deleted]
- twanvl 10y agoThe standard data structure to look for in this case is the disjoint-set data structure (also called union-find), https://en.wikipedia.org/wiki/Disjoint-set_data_structure https://en.wikipedia.org/wiki/Disjoint-set_data_structure. That should make your function fairly easy to implement.
- Patient0 10y agoThanks for that - I'll take a look!
- s_tim 10y agoYou could model the problem as a graph (each integer represents a vertex and two consecutive integers an edge, e.g. (1, 2, 3) is a graph with nodes 1,2,3 and edges between 1 and 2 and 2 and 3). Then your problem is just to find all connected components of the graph (https://en.wikipedia.org/wiki/Connected_component_(graph_theory) https://en.wikipedia.org/wiki/Connected_component_(graph_the....
- dleslie 10y ago> How do you feel about overtime pay? We provide industry-leading compensation, but no one pays for overtime so neither do we.
- kppiskingpp 10y agothat's illegal in many countries america is fucked up
- sand500 10y agoExempt employees rip.
- andy_ppp 10y agoI think everyone should get overtime pay, it would make the company think about how to get better utilisation out of their staff in an allotted time.
- a_imho 10y agoWe are an equal opportunity employer, we hide behind the market and external factors to discriminate salaries.
- ensiferum 10y agoThats hilarious. I was once interviewing for a C++ position and the interviewer presented me with some C code with a broken "swap" implementation and a driver function and asked me to fix it. I simply prefixed the call to swap with "std::". He wasn't very happy about it. ;-)
- ryandrake 10y agoNice. I was once asked to implement a basic filesystem API in C++ including file manipulation, directories and paths, etc. I just said use boost::filesystem and move on with your life. Interviewer was not impressed but at 95% of companies that's what you are going to want to do. Can you imagine interviewing someone to build you a house and spending 90% of the interview time asking him how he'd chop down trees for wood and manufacture the nails? Welcome to software interviewing.
- scarface74 10y agoI partially agree. It depends on what you are hiring for. If you are hiring for a low level code monkey, you want to see how they code. If you are hiring for a senior level engineer/architect, you want to see how often they avoid coding and know how to leverage existing frameworks.
- ryandrake 10y agoOld post but wanted to respond: Even when interviewing more junior roles, I want to see the solution that involves the smallest amount of code, ideally no code. Nothing wrong with expecting that existing mentality from both junior and senior people alike. Saves you from having to instill it. A candidate's ability to re-implement the language's standard library is not so useful if we simply use the language's standard library in our application code.
- Kurtz79 10y agoOf course, you acted like a smartass for no apparent reason. You will never be asked to reimplement a library function on your job, these questions are used to see how you approach a problem, your reasoning, etc...
- mankyd 10y agoI interviewed someone who gave responses akin to "I'd Google it." When presssed, he did finally give some reasonable answers. We ended up hiring him, as we'd interviewed 10 other candidates who'd failed at that point. He ended up being a terrible employee. Seriously, when someone asks you the details of a linked list, they're not trying to find out if you will be able to use one specifically on the job. They're trying to figure out if you know how to implement the details of a moderately tricky algorithm/data structure. I've never implemented a linked list for work, but I have implemented complex data structures and other analogous code. Implementing a linked list demonstrates that I paid attention to the basics and can reconstitute mildly complex algorithms when needed.
- kppiskingpp 10y agolinked list is not complex for christ sake.
- base698 10y agoI think the original intent of the linked list question was to see if the candidate knew pointers. Implementing in a non pointer language would be trivial and definitely not complex.
- Apocryphon 10y agoAre linked lists even a difficult example of pointer use? You don't exactly have to do fancy pointer arithmetic with them. You just have to be a little bit careful when inserting or deleting nodes.
- gpderetta 10y agoYou do need to understand the difference between an object and a refrence to it. Seems trivial bit surprising many programmers seem not to understand it.
- buserror 10y agoNo, AND they are actually useful for any sort of problem, like, reading a records from a file and that sort of stuff. Heck, I wrote one last week [0] because it's quick to implement and does the job. Same applies for the double-linked kind (slightly less so but still nice) and queues. One of my favourite linux kernel header is lists.h! [0]: https://github.com/buserror/rf_bridge/blob/master/src/rf_bridge_linux.c#L414 https://github.com/buserror/rf_bridge/blob/master/src/rf_bri...
- fishnchips 10y agoI once had to use a linked list to implement a sorting algorithm on a huge but partially sorted input. This was to detect duplications in an AST, for a static code analysis startup. This was literally the only time I professionally used any sort of non-trivial data structures and algorithms, and I've been working in the field for some 10 years now.
- hackerboos 10y agoKnowing of data structures is more important IMO. The hoops I've seen people jump through in code because they don't know about sets.
- adamkittelson 10y agoAnd when you see that do you wish they'd never been hired due to this insurmountable hole in their knowledge of data structures or do you take 30 seconds to tell them about sets?
- hackerboos 10y agoAt what point do we just take someone out of high school and teach them to program?
- fao_ 10y agoWait, how is a linked list a non-trivial data structure? It just consists of: {data, pointer to next element}.
- fishnchips 10y agoLinked list was just a part of the data structure I ended up using.
- 8166284 10y agoI've called out interviewers for stupid puzzle questions multiple times. Never got the job in any case, but I like to think I improved the hiring process marginally before being rejected.
- dwringer 10y agoHeh, I would imagine they just found fellow aristocrats who had seen the puzzle questions before and whose groupthinking conformity was a perfect match for the companies.
- abulman 10y agoI've also called out crappy interviews - while in the interview. I went on to be offered the job - but declined.
- vinceguidry 10y agoI hope I'm past the part of my career where I go on cold job interviews but if I ever had to go on another job hunt, I'd simply announce that I'm a web developer and not a algorithms person and it looks like I might not be the best fit for the position and just see how the interviewers respond. Anything less than tossing the playbook warrants a gentle suggestion that we shouldn't waste any more time here and why don't we just end the interview. Stand up, shake hands, thank them for their time, and walk out. Problems in the interview process should be seen as problems with company culture. I used to wonder about how to appropriately answer the question, "which companies are worth working for?" because it seems like you need a lot of time before you can really tell. But once I realized that the interview is just an extension of company culture, it got a lot easier to weigh opportunities. I mean, obviously, if you need the money you need the money, but developers are hot enough commodities that it doesn't take long before you're entrenched enough to be able to call the shots like that.
- tbassetto 10y ago> I'd simply announce that I'm a web developer and not a algorithms person A while ago I was invited at a startup for a casual discussion about an open position they had (front-end developer). I went because I knew several employees and they were nice. The casual discussion turned out to be several questions about UDP/TCP and writing algorithms on a blackboard (counting leaves in a tree, finding is a word is an anagram, etc.). Nothing really hard, but quite disconnected from the day-to-day job of a front-end developer.
- vinceguidry 10y agoI hear about the whole 'casual discussion turns into hardcore interview' ploy all the time, and curious about a better way to respond to it. It's not a serious knock on company culture, but it is impolite. I'd probably overlook it if I didn't have a current job, but would write off the company if I was already employed. I don't think it warrants a walk-out.
- technologyvault 10y agoIsn't it interviews like that that turn job-seeking developers into entrepreneurs?
- ggggtez 10y agoNo hire. Bad culture fit. Seriously, even if you think the interviewer is asking the wrong questions, insulting the interviewer as if it's their job to fix the hiring process of the entire industry...
- kabdib 10y agoThe hiring manager of a small software company gave me a quick brief before handing me off to his technical heavy. "He's hard to get along with, but he's really smart. Oh, and he has two PhDs. He'll tell you that." I was ushered in. The Guy with Two PhDs (he showed me his business card first, and there were indeed two PhDs on it) asked me: "What is the simplest way to synchronize two threads?" I rattled off some synchronization primitives. Semaphore. Critical section. I was ready to do an implementation if he wanted. "No, the simplest." I dug around. Interlocked operations? A mutex? A spinlock? I mentioned Dekker's algorithm (it sucks, but it's simple). I dredged up a few more. "No, I want the SIMPLEST possible way to synchronize two threads. What is it?" I'd run out. He gave a disgusted snort. The next question wasn't much better: "What's the BEST way to share data between programs?" "Not sure what you mean by best. How many programs? Is it over the network? Hmm, shared memory and a maybe a signal of some kind?" "No, the best way!" This interview did not go well. At the end, Dr. DoublePhd scolded me for dropping out of college and told me to go back to school to finish my degree. That evening I wrote the hiring manager that Dr. DoublePhd appeared to want the answer "raise interrupt priority" for the thread synchronization question -- which doesn't work on a multiprocessor -- and that I had no idea what the heck he was asking for on the other questions. I didn't add that even the awful questions I was being asked could have been productive interview fodder in the hands of a good interviewer, but that in the hands of a terrible person they were destroying that company's ability to hire. Turns out that I didn't need to add that last bit. A few months later the hiring manager emailed me, saying that they had fired Dr. DoublePhd and would I consider interviewing again? I politely declined. I never found out the BEST way to share data between programs. In fact, I'm still looking. I think we all are.
- satysin 10y agoIf someone asks you the "best" way to do something but does not give you context for the problem being solved then the question is stupid. There is no all-purpose "best" way to do anything when it comes to complex systems. You use the "best" way for the problem in hand that may be shared memory, pipes, writing to a file, RPC, etc.
- harveywi 10y ago
- doppel 10y agoWhile I understand the context is "stupid inteview questions", I would not say Big O-notation is useless, even for non-Google companies - just read some of the stories at thedailywtf.com to learn how bad it gets. Also, there's a difference between asking "How would you solve X (in Y language)" and expecting a line-by-line code sample. In the former you should be able to talk about how you would structure the code, what input/output you would need, how to set it up, data stores, etc. whereas the latter is (virtually) impossible without help from Google. While it would be lovely to hire candidates by "everything it says in the resume", the truth is that only works for really great hire... which you don't know until you've talked to them about how they work, what they've done and how they like to solve problem.
- monodeldiablo 10y agoI've actually used (politely, of course) many of these answers in interviews, whenever I felt the interviewer was trying to show off or read from the script instead of actually judging my abilities. "I'd google it. Anything less would be a waste of our time." That cuts through a lot of bullshit. After saying that at my last interview, we got into actual problems (structuring a program, building an API, writing code to approximately simulate real world problems, data structures). Had a good time, got hired, and loved working with those people. On the other end of the spectrum, I've been torn to shreds in an interview for not being able to write a fast hash table implementation in Java (didn't know Java at the time and the interviewer didn't know Ruby/Python/C) in an hour of trying. That was soul-destroying.
- LordKano 10y agoI used a polite version of "I'd google it" while interviewing with Google. I explained that I didn't think anyone could be reasonably expected to know how to do everything in every language on demand and that virtually every professional programmer I knew consulted Google from time to time. Maybe I was just ahead of the times or they weren't looking for someone to be as honest as I was but I didn't make it past round 3 of their interviews.
- tomjen3 10y agonew java.util.HashMap() In case you ever get such a stupid question again.
- monodeldiablo 10y agoYeah, I'm fairly proficient these days. But even then, I expressed amazement that Java didn't have a built-in or library data structure. "It does." "Then I'd use that." "That wasn't the question." "Oh... kay..."
- Sir_Cmpwn 10y agoI wrote a linked list today, outside of a job interview. Systems programmers exist :'(
- latch 10y agoNot even just system programming. It's a fundamental data structure and concept. I don't think it's unreasonable for a company to say: we expect this role to understand what goes on behind this abstraction.
- leke 10y agoI recently graduated and I'm going for my first interview in a couple of days. It's in a recruitment agency, and it's for a general web developer position. What do you think I could expect?
- letientai299 10y agoI was once received a modified version of FizzBuzz (the word is replaced by company name) for my coding interview (via email). I told the HR person that I know the problem already, expected to have another more challenge problem. She asked do it anyway. I gave them my solution, but, well, my interesting in that company has gone.
- itp 10y agoI get that this is a caricature, an exaggeration of reality that's trying to convey some bad practices. It must be incredibly frustrating to be on the receiving end of an interview this bad! But I'm not sure all of this plays particularly well, and I want to push back a little bit. For context here, I'm a college dropout. I made it through two years before I discovered that I could skip right to having a job, and for where I was in life, it was the right decision for me. But seriously, what's the deal with this hatred of "Big O" notation? This isn't some cryptic language only for use by CS PhDs. It's not even a concept that's hard to explain to someone who isn't in our industry! "The question we're trying to answer here is, how does our solution scale as the problem gets bigger? Are we able to solve it in the same amount of time regardless of size? Does our solution take more time as the problem gets bigger, but only in proportion to how much bigger the problem is? Or does our solution take much, much longer as the problem gets bigger, to the point where it's no longer feasible to solve?" Asking a candidate to be able to have a conversation about this -- how do time and space complexity scale -- is not unreasonable. This is the difference between designing a workable solution early, and discovering that what worked great in a unit test and some one offs behind the scenes fell over in production. Similarly, I see no problem in expecting a candidate to have some familiarity with the basics of simple data structures. I don't generally rewrite them either! But I use data structures all the time, exposed to me via the standard libraries of programming languages that I use, and if I don't broadly understand how they work, when they are appropriate and when they're not, and when one choice is superior to another, I'm not doing my job. I agree that in a lot of instances, Google is the answer. But Google is of no help if you don't know what to ask, or worse, if you don't even understand that there's a question to ask. I'm not defending the truly awful interviews that I believe really do happen. But let's not pretend that it's not important to understand how these details work to get proficient, or even adequate, at our jobs.
- watwut 10y agoIt was fun to read. However, while interviewer was not perfect, the interviewee was too much crazy. I always find it suspect when self proclaimed awesome genius programmers take offense over simple common questions (like linked list). Had it been something esoteric, ok. But these come up so often and take so little time to learn.
- mdekkers 10y agoI have been hiring technical people for about 18 years. 15 years for my own business. I stopped with all the bullshit questions years ago. My own research into which approach to interviewing is the "best" turned out to be a tossup. You can spend a day, or even days to go through a gruelling interview schedule, and your success rate won't be significantly higher. We are not Google, we don't have their needs, and we don't have the resources. If I'm looking for a dev or ops person, and your CV matches the skills I am looking for, and I have a good feeling about how you present yourself on paper (decent cover letter, decent CV, etc.)you'll be invited for a formal interview, where we will discuss your CV (tell me a bit more about this job you list here, etc.) takes anywhere between 15 to 60 minutes. If there is a connection and a good vibe, your next interview will be informally, in the pub, with the rest of the team to see how you get on. This approach has netted me a higher percentage of succesful long term hires then any other approach. I trust that if you apply for a developer position, you will actually be able to cope. Your skillset will be determined during your probation period, which is something I make clear beforehand. Your probation is where we see how good your skills are.
- aphextron 10y agoI really wish there were more companies like this. Interviewing in SF/Silicon Valley is an absolute nightmare and I've basically given up. I simply can't put myself through that ordeal of weeks of back and forth emailing and talking with recruiters, followed by multiple day long interviews, just to be rejected because I couldn't whip out an algorithm on your white board in front of five people while interviewing for a basic front end position.
- sly010 10y agoIf someone answered with "I'd google it", I would say "go ahead". I don't mind if someone doesn't know or remember something. That is a random signal. I want to know however if a person is mentally lazy and therefore is merely a "user" of technology or the "maker" of it. That said, being able to at least describe some use cases of some relatively simple data structure is not too much to ask.
- scarface74 10y agoI once had an interview where they gave me some programming problems, prewritten unit tests that were failing that I had to make pass, a laptop and told me to use any resource I wanted to help and left me in a room for hour. It was one of the best technical interviews I've had.
- cofeafe 10y agoI had the exact same interview when applying to be a barista at philz coffee. The technical questions were my fault because I told the interviewer I was a researcher in number theory and enjoyed working with embedded systems.. to which they said, 'oh, can you talk a bit about that?' Each comma denotes an email response explaining I was chosen to move on and to please fulfill the next request: Send resume with cover letter, fill out online application, make 90s video about why you should serve coffee, first video chat interview, come in to meet recruiter, come in to meet store manager. I only made it through the first of the three interviews. Ultimately I think we both dodged a bullet there. Honestly! Ask an employee next time you get a coffee there what kind of interview process they had to go through. PS- should have made a 90s '90s video about why I should serve coffee.. definitely would have gotten their minimum wage offering then.
- QML 10y agoI'm taking an introductory course to CS, and a week before the midterm they introduced linked lists -- which to me at first just seemed to be lists within lists with extra rules. What applications do they have in the real world?
- deleted 10y ago[deleted]
- deleted 10y ago[deleted]
- bifrost 10y agoLinked Lists are terrible. They're one of the reasons why early 2000's natd in FreeBSD was terrible. Ask me how I know! Here's a hint - I trussed natd while it was running. Ooops.
- erikarn 10y agoloooooooooooooooooooool.
- manu29d 10y agoI had a recent interview where it literally went like this: He: "Hi. My name is [X] from [Y:company]. We were scheduled for an interview now." Me: Yes. He: "Ok. Am I audible?" Me: Yes. He: "Cool. [Answer this question]" Me: baffled screeching He talked about a lot of things then including "How does Node.js manage it's asynchronus thread? Where is the sequence of functions to run stored in the memory?". In the end I asked him what was a general day like. To which (no kidding) his reply was:(sad tone) "It's Friday 6pm. Everyone is having donuts and here I am taking this interview". Well, if you're more concerned about your donut, thanks I guess. I got rejected after this round.
- smsm42 10y agoI'd take very negative view of interviewee that claims linked lists and big-O (and optimization lore connected to it) is relevant only in interviews. Of course, if he's interviewing for HTML-"coding" grunt in a company making trivial website, I'd get it. But if any substantial programming involved, it's completely false.