3 ms·
Doesn't stop people from asking these questions of people at all levels. I still get asked these coding questions pretty much every interview I have had, and I
by cableshaft 10y ago
Doesn't stop people from asking these questions of people at all levels. I still get asked these coding questions pretty much every interview I have had, and I have almost a decade of programming experience, and have even been lead programmer on some projects (without the title).
I've been asked a barrage of these questions for senior positions, even.
Especially sucks because I don't usually program terribly fast or well in an interview environment, so I look worse than I actually am, and often get put on the defensive in these interviews, which I absolutely hate.
- collyw 10y agoHave you ever needed to flatten a list in your career outside exams and interviews?
- iguanayou 10y agoYes.
- scarface74 10y agoYes. Something like: List<List<Blah>> records; We would send a request off to multiple services, wait for all the responses and then the front end would sometimes need all of the lists and other times need it flatten. How would I do it? var allitems = records.SelectMany(b => b).ToList();
- mannykannot 10y agoI am not an enthusiast of this approach to recruiting, but to be fair, the purpose of the question is not to find someone to flatten lists. It is reasonable to ask, if a programmer cannot flatten a list, in what sense is that person a programmer? Putting aside the question of whether this is a good approach to recruiting, if this question is being failed with any regularity, it raises some interesting and important questions about the innate difficulty of programming and/or the methods by which it is taught.
- brudgers 10y agoIf the person flattens a list with the: Google Copy Paste Algorithm, are they a programmer? Are they more or less of a programmer if instead they use racket or clojure's built-in =flatten=?
- mannykannot 10y agoIt is the cases of failure that are interesting and informative, and if the methods you mention are the only ways a person can solve the problem, that counts as a failure - as I mentioned, this is not actually about flattening lists.
- zzzcpan 10y ago"Have you ever needed to flatten a list in your career outside exams and interviews?" I had to write this function to flatten a tree of expressions, so I could sort them by precedence, etc and fold them into a tree. I already had a bunch of higher-order primitives for constructing a parser and that was basically a lazy hack for me to get expressions parsed. I eventually implemented a proper expression parser, that was basically the same thing, but produced a flat list from the beginning.
- cableshaft 10y agoI mean, I once wrote a python script called unearthed.py that took all the files in all subfolders and put them into the parent folder, then deleted the subfolders, but I'm pretty sure I just used a simple os.walk for that. Came in handy when working with rom archives that liked to put everything in its own folder, and a couple of times when I just had a bunch of crap that I didn't want to have to manually dig up anymore. Other than that? No, not really.
- throwaway2016a 10y ago> Have you ever needed to flatten a list in your career outside exams and interviews? Yes, multiple times in multiple languages. C, C++, Javascript... sometimes "npm install" is not the answer.
- throwaway2016a 10y ago> Have you ever needed to flatten a list in your career outside exams and interviews? Yes, multiple times in multiple languages. C, C++, Javascript... sometimes "npm install" is not the answer.
- fiedzia 10y agoExactly once. But I needed to know recursion, typechecking, and modern language features almost every day.
- WkndTriathlete 10y agoFlattening a list of lists is a problem that occurs quite frequently in functional programming. OTOH, in functional programming languages and frameworks, there is no need to actually write a method that does that since it is usually a library function call.