4 ms·
If I interviewed for a company where a serious interview question was to copy stdin to stdout I'd probably laugh and walk out. Stating the obvious: this company
by exabrial 13y ago
If I interviewed for a company where a serious interview question was to copy stdin to stdout I'd probably laugh and walk out. Stating the obvious: this company obsesses over the most efficient way to re-invent the wheel... Good luck getting any real work done or learning any career portable skills!
- dsrguru 13y agoThe author made it clear that the question's primary purpose was to see if the applicant could use the system. They assumed, incorrectly as it turned out, that the problem was about as trivial as hello world.
- Jtsummers 13y agoPer the article, this didn't sound like a serious question, but a "get used to the system we use" question. Like a test system implementing a multiple choice exam asking a ridiculously stupid first question to get the user familiar with the interface, like: "Is your name: A. Jtsummers; B. Bob Summers; C. John Doe; D. The Queen of England". And expecting the user to correctly pick their own name.
- IvyMike 13y agoHave you conducted interviews yourself? It is harder than it seems. There are a lot of nervous and shy people. Easing them into the process with an 'icebreaker' question gives them a chance to open up for the real questions.
- ketralnis 13y agoHave you ever interviewed programmers? Have you ever attended a job interview? (1) This is an interview question, he's not asking you to be a professional stdin->stdout copier (2) this isn't a micro optimisation problem: > The first question on the quiz is a triviality, just to let the candidate get familiar with the submission and testing system (3) A surprising number of programmers can't program. Basic warmup questions are a good thing and can save a lot of your time http://blog.codinghorror.com/why-cant-programmers-program/ http://blog.codinghorror.com/why-cant-programmers-program/ (4) Even if this isn't his attempt, there's genuine depth to even this problem. If you do the obvious a = get_byte() while a != EOF: send_byte(a) a = get_byte() There's a surprising amount of work going on behind the scenes that you can dive into discuss how I/O works, when would you do this using blocking vs. non-blocking I/O, when should you do your own buffering or let the language/library do it for you. But it's short enough to get started to get to those points very quickly. (5) I wouldn't hire/not hire someone based on style alone, but you can get a pretty good feel for it from short programs that actually work. If the tasks or snippets on which you interview are too short to be complete programs, you miss a lot of organisation and "shape of the code" kind of stuff from their style. (6) Interviews are tough as an interviewee. Professional programmers aren't professional job interviewers and often it can be hard to read their mind to see what they are looking for in a particular question. "It's open ended, take it where you like" usually doesn't mean what it says on the tin. As far as going from "here's a question" to "here's an answer" with little ambiguity this is one of the better FizzBuzz type questions I've seen.
- Jtsummers 13y ago> (3) A surprising number of programmers can't program. This reminded me of the interview for my first job. I was basically between a rock and a hard place so part of what follows was clearly, in retrospect, a bad sign, but the choice between job and no job but $20k in debt to cover, I took the job. The shop was a C shop, embedded systems. When I went in to interview I was virtually a shoo-in (just learned I'd misspelled this for years as shoe-in) for the job due to a college classmate already working there and recommending me. The code segment was straightforward. It presented several "implementations" in C of functions to swap the values in two variables. That is: int x = 10; int y = 20; swap(x,y); // after this point x == 20 and y == 10 should be true void swap(int x, int y) { int t = x; x = y; y = x; } Now, that obviously won't work in C. One of the implementations was correct, 3 were wrong (like the above snippet). I was asked which were wrong, why they were wrong, which was correct. I answered them all (note: this was a week 2 or 3 programming assignment when I took a course using C as an undergrad, it really seemed obvious to me), and the interviewer was surprised. I was told, "You're the first person to get all these questions correct." Like I said, warning signs. Alarm bells should have been going off. If the interviewer tells you that, that means that your colleagues couldn't answer those questions. That only occurred to me about 4 weeks later once I'd finished all my reading and project familiarization and was getting into really working with my new peers.
- ojbyrne 13y agoMy initial impulse would've been #!/bin/sh cat
- threedaymonk 13y agoYou can go one better: just symlink cat and avoid an unnecessary exec.
- asveikau 13y agoMaybe not reinvent, but you'd damn well better understand how the wheel works or at least be able to deduce it, maybe even be curious about it as an engineering problem. Forget even that somebody's still got to build the wheels of tomorrow (last I checked my car and the car I am likely to buy decades from now still has wheels so I imagine its proper function is still an ongoing engineering issue for somebody), but say you work on a problem and it turns out the root cause of an issue lies in the proverbial wheel - are you going to hem and haw and say that this piece is beneath you? Or are you going to fix the problem?
- koenigdavidmj 13y agoWrong. The reason FizzBuzz (as another example) is a widely used interview problem is that it is a middle ground: a problem that won't be a time-waster on competent candidates, but will completely stump idiots.
- zimpenfish 13y agoGiven the solutions that people have posted on here which have demonstrable problems, I think it's a pretty good question as an opener. And as someone said already, it gives you a lot of scope for drilling down into the nitty-gritty.