《Cracking the Coding Interview》——第8章:面向对象设计——题目7
2014-04-23 23:38
题目:你要如何设计一个聊天服务器,有什么技术难点?
解法:这是基于工作经验的面试题吗?否则,一个new grad碰上这种题目能打点草稿也就算不错了。
代码:
// 8.7 Tell me what you would do if told to design the backend for a online chatting system.
// Designing a chatting server, it will at least provide:
// 1. Peer-to-peer chatting, which goes through the chatting server as relay.
// 2. Group chatting and broadcasting, which is distributed by the server.
// 3. It will be social, so people can make friends, which brings in graph theory.
// 4. If it keeps track of the chatting messages sent by the user, it will need massive storage to hold them.
// 5. Oh my god, what kind of companies would ask such complicated problem... I'm just a new grad, spare me.
int main()
{
return ;
}
《Cracking the Coding Interview》——第8章:面向对象设计——题目7的更多相关文章
- Cracking the coding interview 第一章问题及解答
Cracking the coding interview 第一章问题及解答 不管是不是要挪地方,面试题具有很好的联系代码总用,参加新工作的半年里,做的大多是探索性的工作,反而代码写得少了,不高兴,最 ...
- 《Cracking the Coding Interview》读书笔记
<Cracking the Coding Interview>是适合硅谷技术面试的一本面试指南,因为题目分类清晰,风格比较靠谱,所以广受推崇. 以下是我的读书笔记,基本都是每章的课后习题解 ...
- Cracking the coding interview
写在开头 最近忙于论文的开题等工作,还有阿里的实习笔试,被虐的还行,说还行是因为自己的水平或者说是自己准备的还没有达到他们所需要人才的水平,所以就想找一本面试的书<Cracking the co ...
- Cracking the coding interview目录及资料收集
前言 <Cracking the coding interview>是一本被许多人极力推荐的程序员面试书籍, 详情可见:http://www.careercup.com/book. 第六版 ...
- Cracking the Coding Interview(Trees and Graphs)
Cracking the Coding Interview(Trees and Graphs) 树和图的训练平时相对很少,还是要加强训练一些树和图的基础算法.自己对树节点的设计应该不是很合理,多多少少 ...
- Cracking the Coding Interview(Stacks and Queues)
Cracking the Coding Interview(Stacks and Queues) 1.Describe how you could use a single array to impl ...
- 《Cracking the Coding Interview》——第8章:面向对象设计——题目10
2014-04-24 00:05 题目:用拉链法设计一个哈希表. 解法:一个简单的哈希表,就看成一个数组就好了,每个元素是一个桶,用来放入元素.当有多个元素落入同一个桶的时候,就用链表把它们连起来.由 ...
- 《Cracking the Coding Interview》——第8章:面向对象设计——题目9
2014-04-23 23:57 题目:如何设计一个内存文件系统,如果可以的话,附上一些代码示例. 解法:很遗憾,对我来说不可以.完全没有相关经验,所以实在无从入手.这题目应该和工作经验相关吧? 代码 ...
- 《Cracking the Coding Interview》——第8章:面向对象设计——题目8
2014-04-23 23:49 题目:有个棋牌游戏叫Othello,也叫Reversi.请看游戏规则.中文应该叫黑白棋吧,不常玩儿就是了. 解法:既然这题的规则很清楚,也很清楚,我就写了一个命令行的 ...
随机推荐
- 笨办法学Python(十四)
习题 14:提示和传递 让我们使用 argv 和 raw_input 一起来向用户提一些特别的问题.下一节习题你会学习如何读写文件,这节练习是下节的基础.在这道习题里我们将用略微不同的方法使用 raw ...
- 广搜,深搜,单源最短路径,POJ(1130),ZOJ(1085)
题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=85 http://poj.org/problem?id=1130 这 ...
- Python 数据驱动 unittest + ddt
一数据驱动测试的含义: 在百度百科上的解释是: 数据驱动测试,即黑盒测试(Black-box Testing),又称为功能测试,是把测试对象看作一个黑盒子.利用黑盒测试法进行动态测试时,需要测试软件产 ...
- 曲率(Curvature)
原文链接 几何体的曲率对于不同的对象有不同的定义.首先来看最简单的平面曲线. 首先把曲线分成无穷小的小段,每一段看作某个圆的一小段圆弧.这个圆叫做“密切圆”(Osculating Circle).由于 ...
- LeetCode(Two Sum)
一.题目要求 Given an array of integers, return indices of the two numbers such that they add up to a spec ...
- mybatis-generator的maven插件使用异常(mybatis-generator-maven-plugin):generate failed: Exception getting JDBC Driver
使用mybatis的代码生成工具:mybatis-generator,在父model中引入了maven插件的依赖,如下: <!-- Mybatis.generator插件 --> < ...
- js中的变量提升(Hoisting)
<script> function test(){ console.log(a); console.log(foo()); var a=1; function foo(){ return ...
- html css javascript 知识点总结 bom js 操作标签 文本 节点 表格各行变色 悬停变色 省市联动 正则
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title&g ...
- MacBookPro 存储空间优化
首先,打开电脑内的"终端"; 其次,逐条录入下面的命令行,执行完成后,再次查看您的储存空间,多少会有一些优化,具体会优化出多少储存空间因您日常使用而定(本人清出了5G 空间,还不错 ...
- CodeForces_864_bus
C. Bus time limit per test 2 seconds memory limit per test 256 megabytes input standard input output ...