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

> If you want to import a day's worth of access logs into a hash map, you need to take into account not only the time but also the space complexity of this sort of solution.

Good thing space complexity is routinely discussed in these interviews.

And the idea that computation complexity only matters for 'the hot path' is way too dismissive.

For instance; a quadratic loop over a 10 million line log file is just a catastrophe (100 trillion iterations), even for something run once a day. Such a log file would happily fit into memory (it's mere gigabytes) and a hashmap would be perfectly adequete.

> Depending on how much traffic a service handles

Yes, it depends. The interviewee is expected to ask, or at least state what assumptions they're making.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: