Hawstein's Blog

Make something people love

Cracking the coding interview--Q17.3

题目 原文: Compare and contrast the IPv4 and IPv6 protocols. 译文: 比较IPv4和IPv6协议。 解答 IPv4和IPv6是因特网协议,应用于网络层。IPv4是现在应用得最广泛的协议, 而IPv6是因特网的下一代协议。 IPv4是因特网协议的第4个版本,它使用32位寻址技术。IPv6是下一代因特网协议, 用的...

Cracking the coding interview--Q17.2

题目 原文: Explain any common routing protocol in detail. For example: BGP, OSPF, RIP. 译文: 介绍常用路由协议。例如:BGP,OSPF,RIP 解答 这个可以根据具体以后从事职位与其的相关度做不同程度的了解。这里只做一个简单介绍。 BGP: Border Gateway Protocol (边界网...

Cracking the coding interview--Q17.1

题目 原文: Explain what happens, step by step, after you type a URL into a browser. Use as much detail as possible. 译文: 一步一步地解释一下,在你往浏览器中输入一个URL后都发生了什么。要尽可能详细。 解答 这道题目没有所谓的完全的正确答案,这个题目可以让你在任意的一个...

Cracking the coding interview--Q12.7

题目 原文: You have to design a database that can store terabytes of data. It should support efficient range queries. How would you do it? 译文: 让你来设计一个能存储TB级数据的数据库,而且要能支持高效的区间查询(范围查询), 你会怎么做? 解答 ...

AWK 常用命令

打印passwd文件每一行的全部内容(显示在终端) awk ‘{print $0}’ /etc/passwd awk ‘{print }’ /etc/passwd 对于passwd文件的每一行,打印输出awk awk ‘{print “awk”}’ /etc/passwd

Cracking the coding interview--Q12.6

题目 原文: You have a billion urls, where each is a huge page. How do you detect the duplicate documents? 译文: 你有10亿个url,每个url对应一个非常大的网页。你怎么检测重复的网页? 解答 网页大,数量多,要把它们载入内存是不现实的。 因此我们需要一个更简短的...

Cracking the coding interview--Q12.5

题目 原文: If you were designing a web crawler, how would you avoid getting into infinite loops? 译文: 如果让你设计一个网络爬虫,你怎么避免陷入无限循环? 解答 看完这题,建议用python写个爬虫,对此就能理解的多一些,而且还可以做出好玩的东西。 话说爬虫为什么会陷入循环呢?答案很简单...

Cracking the coding interview--Q12.4

题目 原文: You have an array with all the numbers from 1 to N, where N is at most 32,000. The array may have duplicate entries and you do not know what N is. With only 4KB of memory available, how ...

Cracking the coding interview--Q12.3

题目 原文: Given an input file with four billion integers, provide an algorithm to generate an integer which is not contained in the file. Assume you have 1 GB of memory. FOLLOW UP What if you ha...

Cracking the coding interview--Q12.2

题目 原文: How would you design the data structures for a very large social network (Facebook,LinkedIn, etc)? Describe how you would design an algorithm to show the connection, or path, between two...