3 ms·
Ask HN: The most interesting/weird interview question you've been asked?
While reading
http://www.bbc.co.uk/news/technology-16346813
I thought it might be fair to source HN and ask about interesting interview questions.
- kls 15y agoI was recently asked given a variable amount of parameters passed into a JavaScript function how would you sum all of the parameters. My answer was I would not write JavaScript code like that, and would fire anyone on my team that did. Needless to say I did not get the job, nor did I want it. I have been critical of this type of interviewing for a long time. Trick questions and magic code really provide little insight to the value of a candidate. Further most interviewers do not have the clinical background to even interpret the results as many of these questions are based off of psychological tests. It's a cargo cult mentality and reflects poorly on an organization.
- goo 15y agoI think this is a reasonable question, insofar as the interviewer probably just wanted to hear that you knew how the "arguments" object works. The base2 library, for example, uses arguments in its format function: http://www.google.com/codesearch#O7TxUbFbPP4/lib/src/base2.js&q=format%20package:http://base2%5C.googlecode%5C.com&l=1542 http://www.google.com/codesearch#O7TxUbFbPP4/lib/src/base2.j... Quizzing people on language features seems a tiny bit silly, but I respect it as a method of ensuring expertise in a given language. edit- I actually don't think it ensures expertise, but it can be a signal of a lack of expertise, so it is a useful method to avoid a false positive on a hire.
- kls 15y agoI have to respectfully disagree, I have built a lot of JavaScript based application, some of them huge code bases for the like of IBM and not once have I had to resort to using the arguments object. I consider myself to be an expert, but should I ever need to use it, I would look up the API because it is not a feature used in the mainstream of development. Understanding technical nuances of a languadge does not make a developer an expert, delivering a clean, maintainable and elegant code base to production to generate revenue does. Now my opinion would differ if it was someone hired to actually work on V8 or one of the JavaScript run-times but requiring mastery of nuances of a languadge when they will be used rarely if at all seems to me to be a filter that can eliminate good candidates in favor of trivia knowledge. Trivia can be looked up, delivery and maintainability cannot, these questions favor trivia over delivery.
- damoncali 15y ago"If you were a piece of fruit, would you rather be one still on the tree or one that had fallen to the ground?"
- lowglow 15y agoQuestion: Imagine that you have a non-session-persisting load balancer in front of a cluster of web servers (n >= 3). Since this load balancer doesn't direct requests in any persistent fashion, a user making subsequent requests may be directed to any of the servers available in the cluster in a non-deterministic manner. In your application, you need to handle image uploads from users, and as soon as the upload is finished, you need to show the user their uploaded image. This creates a problem for you because after an upload, the load balancer may direct the user to a web server which does not have the users recently uploaded image resulting in a 404 Not Found for the image request and a poor user experience. In the current system, an rsync process runs every 5 minutes and copies uploaded images around to each server so that every server has every file, eventually. This isn't a very optimal solution because users may not see their uploaded images for up to 5 minutes depending on which server they are connecting to for any given request and it forces every server to have a copy of every image uploaded, which may not be the most scalable solution. Assuming you could not modify the load balancer, how would you redesign or fix this system so that files are uploaded in a way that it doesn't matter which server in a cluster a user connects to in order to be able to satisfy a request for the file? There are many ways to solve this problem. Please describe one or more ways and discuss the pros and cons of your solution(s). If your solution is very simple (not a bad thing), consider offering a couple alternate solutions so we have a strong understanding of how you evaluate and approach problems. - My Response: Basically that this was poor architecture and didn't make sense. They shouldn't be using their web servers as a file store. They didn't like that.
- bmelton 15y agoNo offense intended, but I wouldn't have liked that answer either, especially as it isn't an answer to the question posed. It might well have been a hypothetical problem they've had in the past or that they've heard of, or it might have even been that their application requirements evolved into the use case above. Not answering the question doesn't indicate that you can solve the problem. Right or wrong, businesses arrive at scenarios like this often due to circumstances outside their control. Either way, I like it as an interview question, as it would effectively filter out people who are either not clever enough to solve it or not motivated enough. When I hire, one of the best things I can hope to find in an potential employee is a 'can-do' attitude. While that might sound cliche, you can hire pretty much any smart person to point out the problems you have. It's much more difficult to hire somebody who can both identify those problems and come up with potential solutions and is capable of fixing them.
- bwhichard 15y agoHow many gas stations are in the United States?
- lowglow 15y agoI like these types of questions, but I've never been given one. How did you respond? Here's my take: My first inclination would be to think about all the gas stations in my neighborhood, and all of those I pass as I travel somewhere. The gas stations start to spread out the further from civilization I go, but I've never gone more than a quarter to half a tank of gas before seeing another. (I have a phobia about running out of gas in the middle of nowhere.) But the difficult part it is thinking about how gas stations are set up. There is definitely a relationship between population density and gas station count. The less people, the less gas stations -- but conversely there seems to be a point where the population is so saturated (SF proper) that gas stations are scarce inside the city. But maybe I just think that because of the relative distances I'm traveling. Inside the city I'm walking and see less gas stations, but outside the city I'm driving and covering a longer distance in the same amount of time and see more gas stations. Also, we seldom see huge lines at the gas stations which means they are plentiful enough to service all available commuting cars without significant queue. If there are just enough to service cars without a queue, maybe we can say this (naively): X number of people in the US. Three people per family, so X/3 = Y number of cars. (A lot of families have more than one car, I know) If each gas station has an average of Z pumps and is utilized constantly at an average of W% through the day, we need at least Y * Z * W% gas stations to service everyone appropriately.