Google Interview Questions
inc.com
inc.com
1. Estimate Pi using a unit circle inscribed in a unit square with the ability to increase/decrease accuracy.
For some reason I had calculus on the brain, so went with a reimann sum type approach (i.e. accuracy would be how wide the rectangles were.
What they wanted was a monte carlo approach. i.e. throw darts, measure how many are inside and outside the circle but within the square.
2. Write a regex matcher that can match letters/numbers/./*
#2 is basically from Kernighan and Pike's practice of programming, except as Kernighan comments elsewhere Rob Pike required an hour or 2 to figure it out (not something I think is reasonable to accomplish in 30-45m of time in an interview)
though after that, I decided to learn more about regex's and wrote my own full regex parser (including grouping, back and forward expressions....), wasn't performant (and could die in the well known pathalogical cases), but it was fun to learn.
Since a lot of people on HN interviewed at google, can they confirm that those type of questions are asked in those interviews?
> 41 of Google's Toughest Interview Questions
All of the questions are for non-technical roles.
The only way I can see any of these being hard (never-mind "hardest") is if they are for junior people or the interviewers are very specific about what answers they accept in which case it is the interviewer that is in the wrong not the interviewee (IMHO).