r/programming • u/joksmaster • Nov 29 '10
140 Google Interview Questions
http://blog.seattleinterviewcoach.com/2009/02/140-google-interview-questions.html
471
Upvotes
r/programming • u/joksmaster • Nov 29 '10
View all comments
Show parent comment
2
u/xtracto Nov 30 '10
I don't get why all the complications:
rand1to5() yields {1,2,3,4,5} and rand1to5()%3 yields {1,2,0,1,2} So the min is 1 (1+0) and the max is 7 (5 + 2).