There's a string $$$S$$$ of length $$$N$$$ containing $$$1s$$$ and $$$0s$$$ only, you don't know the string but you know $$$N (N<=1000)$$$. You can ask at most $$$1024$$$ questions: is $$$P$$$ a substring of $$$S$$$? $$$P$$$ can be of any length. Then you have to know the string $$$S$$$.
This comment claims that this problem has a deterministic solution as well as a nice randomization solution. But I am thinking of the solution for a pretty long time and nothing popped out of my tiny brain. Can you help me?
Note: I am interested in the randomized solution more. But any solution will quench my thirst!