Hacker News new | ask | show | jobs
by vcxy 2095 days ago
"Find the earliest valid pdf in consecutive digits of pi"
3 comments

I mean, the answer is trivially zero, there exists a PDF-like structure somewhere in Pi, and the offset of that doesn't have to be zero, it can start or end anywhere. So the range [0, N] is a valid PDF.
"Find the last byte of the first valid PDF in the binary digits of Pi"
Since the PDF also doesn't have to be end-aligned, the answer is trivially [0, infinity].

The first place a valid PDF could be ended, perhaps.

A pdf at [0, N] sorts before the one at [0, N+1], by "first valid pdf".
No, both start at 0. Also, [0, infinity] and [0, infinity+1] are the same thing.
Please don't give them any ideas.. the whiteboard interview coding tests are hard enough as it is
How else will we weed out the fakers and people coasting for 10 years? Our CRUD SaaS app needs top people.
Doesn't sound like that hard of a question, given you are provided the structure of the PDF header. I guess it really comes down to substring search.
Imagine if it was a PDF that simply rendered the number 42.
If that happens we know for a fact that we are in a simulation