Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You could make the problem harder with "you are given a stream of n - 1 integers". N could then be any number, unbound by available memory.

That makes the problem harder which makes it more interesting, a lot of the solutions wouldn't work anymore (this isn't necessarily a good interview question though)



Even with the original formulation, the array doesn't have to fit in available memory. mmap exists.


You are given a magnetic tape containing a list of n - 1 integers… :-)




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: