j****g 发帖数: 597 | 1 finished 5 min ago. writing them down before I forgot.
1. If you have a very large file which consists of many unique tokens(
strings). Easy token is too large to fit in memory. How would you find out
the token that occurs the most in the file.
The hardest question in the interview.
开始我回答用hash function来缩小搜索空间。比如用头两个字符。然后他问what if
the table is too large to fit in memory? 我说那就用swap file, or use OS
memory management related technique, swap in and out the chunk of the hash
table. 后来他忍不住了,问如果给我100台机器 |
|