title |
---|
Puzzles |
This collection has some hard problems with optimal solutions.
-
Let
$x=p/q$ be an rational number, where$p$ and$q$ are integers. There is a function$f_x$ , such that$f_x(y)$ tells you if$x < y$ ,$x > y$ or$x=y$ . What is the maximum number of queries of$f_x$ needed to find$x$ ? http://stackoverflow.com/questions/5440688/the-guess-the-number-game-for-arbitrary-rational-numbers -
You have a data stream of a permutation of
${1,\ldots,n}$ . However you know$k$ of the elements will be missing because the communication channel has fault. How can you detect which numbers are missing? http://stackoverflow.com/questions/3492302/easy-interview-question-got-harder-given-numbers-1-100-find-the-missing-numbe -
Data structure for loaded dice? http://stackoverflow.com/questions/5027757/data-structure-for-loaded-dice