Cracking the coding interview
cfanrCoder
对贡献有激情,对回报有信心!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Cracking the coding interview--Q17.3
题目原文:Compare and contrast the IPv4 and IPv6 protocols.译文:对比下IPv4和IPv6协议。解答什么是IPv4? 目前的全球因特网所采用的协议族是TCP/IP协议族。IP是TCP/IP协议族中网络层的协议,是TCP/IP协议族的核心协议。目前IP协议的版本号是4(简称为IPv4),发展至今已经使用了30多年。原创 2014-04-01 21:13:41 · 1419 阅读 · 0 评论 -
Cracking the coding interview--Q17.4
题目原文:What is a network / subnet mask? Explain how host A sends a message / packet to host B when: (a) both are on same network and (b) both are on different networks.Explain which layer makes th原创 2014-04-03 16:33:54 · 1152 阅读 · 0 评论 -
Cracking the coding interview--Q15.4
题目原文:Draw an entity-relationship diagram for a database with companies, people, and professionals (people who work for companies).译文:画一个数据库的实体关系图,包含公司(companies),人(people), 专业人士(profession原创 2014-03-24 20:46:56 · 1173 阅读 · 0 评论 -
Cracking the coding interview--Q18.1
题目原文:What’s the difference between a thread and a process?译文:线程与进程之间有什么不同?解答简言之,线程与进程的区别是:一个程序至少有一个进程,一个进程至少有一个线程;详细点,进程和线程的主要差别在于它们是不同的操作系统资源管理方式。进程有独立的地址空间,一个进程崩溃后,在保护模式下不会对其它进程产生影响,而线原创 2014-04-03 17:30:02 · 1306 阅读 · 0 评论 -
Cracking the coding interview--Q17.5
题目原文:What are the differences between TCP and UDP? Explain how TCP handles reliable delivery (explain ACK mechanism), flow control (explain TCP sebnder’s / receiver’s window) and congestion cont原创 2014-04-03 16:55:46 · 1297 阅读 · 0 评论 -
Cracking the coding interview--Q18.4
题目原文:Design a class which provides a lock only if there are no possible deadlocks.译文:设计一个提供锁但不可能发生死锁的类。解答原书解答:class MyThread extends Thread { long time; ArrayList res = new ArrayList原创 2014-04-04 09:47:20 · 1841 阅读 · 0 评论 -
Cracking the coding interview--Q18.2
题目原文:How can you measure the time spent in a context switch?译文:怎样计算上下文切换的时间?解答原创 2014-04-03 17:58:29 · 1241 阅读 · 0 评论 -
Cracking the coding interview--Q15.3
题目原文:What is denormalization? Explain the pros and cons.译文:什么是反范式?解释它的优缺点。解答反范式是通过增加冗余数据或数据分组来提高数据库读性能的过程。在某些情况下, 反范式有助于掩盖关系型数据库软件的低效。关系型的范式数据库即使做过优化, 也常常会带来沉重的访问负载。数据库的范式设计会存储不同原创 2014-03-23 16:38:15 · 1154 阅读 · 0 评论 -
Cracking the coding interview--Q15.2
题目原文:What are the different types of joins? Please explain how they differ and why certain types are better in certain situations.译文:SQL中的连接有哪些不同的类型?请解释它们的不同点和在特定情况下使用哪种连接,为什么?解答SQL join原创 2014-03-22 09:31:53 · 1406 阅读 · 0 评论 -
Cracking the coding interview--Q19.7
题目原文:You are given an array of integers (both positive and negative). Find the continuous sequence with the largest sum. Return the sum.EXAMPLEInput: {2, -8, 3, -2, 4, -10}Output:原创 2014-04-17 16:45:25 · 1200 阅读 · 0 评论 -
Cracking the coding interview--Q19.8
题目原文:Design a method to find the frequency of occurrences of any given word in a book.译文:设计一个方法原创 2014-04-17 17:28:33 · 1330 阅读 · 0 评论 -
Cracking the coding interview--14.1-14.6
题目原文:In terms of inheritance, what is the effect of keeping a constructor private?In Java, does the finally block gets executed if we insert a return statement inside the try block of a try-ca原创 2014-03-20 21:03:20 · 1856 阅读 · 0 评论 -
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,边界网关协议)是一种用于AS(Autonomous System,自治系统)之间原创 2014-04-01 21:01:12 · 1402 阅读 · 0 评论 -
Cracking the coding interview--Q19.11
题目原文:Design an algorithm to find all pairs of integers within an array which sum to a specified value.译文:设计一个算法找出数组中和为特定值的所有整型对。解答首先理解题意,题目条件给出一个特定值sum和一个数组,求出数组中满足两个数的和等于sum的所有整数对。可以先对数原创 2014-04-20 10:01:52 · 1382 阅读 · 0 评论 -
Cracking the coding interview--Q19.10
题目原文:Write a method to generate a random number between 1 and 7, given a method that generates a random number between 1 and 5 (i.e., implement rand7() using rand5()).译文:写一个方法原创 2014-04-17 19:59:48 · 1255 阅读 · 0 评论 -
Cracking the coding interview--Q15.1
题目原文:Write a method to find the number of employees in each department.译文:写一个SQL语句找出在每个部门的员工的数量。解答这个问题可以将部门表与员工表做连接,然后统计每个部门的员工数。注意是使用左连接,而不是内连接,因为要包含员工数为0的部门。select Dept_Name, Departm原创 2014-03-21 09:19:37 · 1539 阅读 · 0 评论 -
Cracking the coding interview--Q19.6
题目原文:Given an integer between 0 and 999,999, print an English phrase that describes the integer (eg, “One Thousand, Two Hundred and Thirty Four”).译文:给一个0到999,999的整型,打印一个英文描述的整型(如:“One Thousa原创 2014-04-15 20:46:49 · 1564 阅读 · 0 评论 -
Cracking the coding interview--Q19.5
题目原文:The Game of Master Mind is played as follows:The computer has four slots containing balls that are red (R ), yellow (Y), green (G) or blue (B). For example, the computer might have RG原创 2014-04-15 11:16:36 · 1493 阅读 · 0 评论 -
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级数据的数据库,并且它支持高效的区间查询,该怎样设计它?解答首先要明确,并原创 2014-03-19 16:06:52 · 1098 阅读 · 0 评论 -
Cracking the coding interview--Q12.6
题目原文:You have a billion urls, where each is a huge page. How do you detect the duplicate documents?译文:你有一亿个urls, 每个urls都链接一个很大的页面,你怎样检测重复的页面?解答网页大,数量多,要把它们载入内存是不现实的。 因此我们需要一个更简短的方式原创 2014-03-18 10:12:38 · 1309 阅读 · 0 评论 -
Cracking the coding interview--Q12.5
题目原文:If you were designing a web crawler, how would you avoid getting into infinite loops?译文:如果你正在设计一个网络爬虫,何如避免进入无限循环?解答原创 2014-03-18 09:47:58 · 1631 阅读 · 0 评论 -
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 UPWhat if you have on原创 2014-03-16 16:22:32 · 1486 阅读 · 0 评论 -
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 wou原创 2014-03-16 19:45:06 · 1477 阅读 · 0 评论 -
Cracking the coding interview--Q9.7
题目原文:A circus is designing a tower routine consisting of people standing atop one another’s shoulders. For practical and aesthetic reasons, each person must be both shorter and lighter than the pe原创 2014-03-09 21:10:54 · 1820 阅读 · 0 评论 -
Cracking the coding interview--Q9.6
题目原文:Given a matrix in which each row and each column is sorted, write a method to find an element in it.译文:给一个矩阵并且每行每列都是有序的,写一个方法找出它的一个元素。解答方法原创 2014-03-09 11:27:34 · 1396 阅读 · 0 评论 -
Cracking the coding interview--Q19.2
题目原文:原创 2014-04-08 16:26:11 · 1126 阅读 · 0 评论 -
Cracking the coding interview汇总目录
很久之前刷的CTCI的题目,都快忘记了,做个分类汇总,再重新好好复习一遍。Chapter 1 | Arrays and Strings1.1 Implement an algorithm to determine if a string has all unique characters. What if you can not use additional data stru原创 2014-12-26 20:07:34 · 4229 阅读 · 0 评论 -
Cracking the coding interview--Q20.13
题目原文:Given a dictionary of millions of words, give an algorithm to find the largest possible rectangle of letters such that every row forms a word (reading left to right) and every column forms a原创 2014-04-28 21:05:53 · 1611 阅读 · 0 评论 -
Cracking the coding interview--Q20.12
题目原文:原创 2014-04-28 09:13:54 · 1210 阅读 · 0 评论 -
Cracking the coding interview--Q20.11
题目原文:Imagine you have a square matrix, where each cell is filled with either black or white. Design an algorithm to find the maximum subsquare such that all four borders are filled with black pi原创 2014-04-27 17:20:58 · 1337 阅读 · 0 评论 -
Cracking the coding interview--Q20.10
题目原文:原创 2014-04-26 11:07:17 · 1387 阅读 · 0 评论 -
Cracking the coding interview--Q20.9
题目原文:原创 2014-04-26 10:02:40 · 1273 阅读 · 0 评论 -
Cracking the coding interview--Q19.3
题目原文:原创 2014-04-09 16:57:11 · 1195 阅读 · 0 评论 -
Cracking the coding interview--Q19.4
题目原文:Write a method which finds the maximum of two numbers. You should not use if-else or any other comparison operator.EXAMPLEInput: 5, 10Output: 10原创 2014-04-10 10:30:43 · 1103 阅读 · 0 评论 -
Cracking the coding interview--Q20.8
题目原文:Given a string s and an array of smaller strings T, design a method to search s for each small string in T.译文原创 2014-04-25 10:40:54 · 1699 阅读 · 0 评论 -
Cracking the coding interview--Q20.7
题目原文:Write a program to find the longest word made of other words.译文:原创 2014-04-24 11:32:32 · 1567 阅读 · 0 评论 -
Cracking the coding interview--Q20.6
题目原文:原创 2014-04-24 10:26:20 · 1281 阅读 · 0 评论 -
Cracking the coding interview--Q20.5
题目原文:You have a large text file containing words. Given any two words, find the shortest distance (in terms of number of words) between them in the file. Can you make the searching operation in原创 2014-04-24 10:03:32 · 1701 阅读 · 0 评论 -
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 peo原创 2014-03-14 11:41:53 · 1379 阅读 · 0 评论 -
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时,发生了什么?尽可能详细。解答当用户在浏览器输入一个URL时,访问的大致流程如下:1.首先浏览器会向DN原创 2014-03-27 10:48:59 · 1383 阅读 · 0 评论
分享