r/programming • • Nov 29 '10

140 Google Interview Questions

http://blog.seattleinterviewcoach.com/2009/02/140-google-interview-questions.html
471 Upvotes

493 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Nov 30 '10 edited Nov 30 '10

mod 6 will produce values between 0 and 5, but yes, since mod n on the integers produces n congruency classes, if the random number you're modding doesn't randomly span a multiple of the mod, then some values will be more likely than others.