《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.请看游戏规则.中文应该叫黑白棋吧,不常玩儿就是了. 解法:既然这题的规则很清楚,也很清楚,我就写了一个命令行的 ...
随机推荐
- leetcode 141、Linked list cycle
一种方法是用set存储出现过的指针,重复出现时就是有环: class Solution { public: bool hasCycle(ListNode *head) { set<ListNod ...
- 金庸的武侠世界和SAP的江湖
2018年10月30日晚,成都地铁一号线,Jerry手机app上突然弹出来一条金庸去世的新闻. Jerry识字很早,小学一年级就开始蹭我父亲的<射雕英雄传>看了.小时候,我爸工作的车间里有 ...
- Javascript作业—数组去重(要求:原型链上添加函数)
数组去重(要求:原型链上添加函数) <script> //数组去重,要求:在原型链上添加函数 //存储不重复的--仅循环一次 if(!Array.prototype.unique1){ A ...
- Pascal之Hello World
Pascal入门篇. 平台:Windows 7 ultimate x64 工具:Free Pascal 下载安装,界面如下: 右键属性,选择“437(OEM-美国)”,重新打开程序,乱码消失. ...
- python 爬糗事百科
糗事百科网站段子爬取,糗事百科是我见过的最简单的网站了!!! #-*-coding:utf8-*- import requests import re import sys reload(sys) s ...
- 2017.10.18 微机原理与接口----汇编语言语法和DOS功能调用
4.1 汇编语言中的基本数据 ·标识符 ·常数 ·变量具有三个属性: (1)段地址(SEG):变量所在段的段地址 (2)偏移地址(OFFSET):变量所在段内的偏移地址 (3)类型(TYPE):每个变 ...
- map和set的遍历
map: 1.通过获取Entry: Entry的iterator for(Map.Entry<Float,String> entry : map.entrySet()) { System ...
- 手动安装Apache+PHP+MYSQL及环境配置
先准备好软件: Apache官方下载地址:apache_2.0.55-win32-x86-no_ssl.msi,更多版本在这里: php官方下载地址:php-5.0.5-Win32.zip,更多镜像下 ...
- bootstarp v3 学习简记
1.快速设置浮动通过这两个class让页面元素左右浮动. !important被用来避免某些问题. <div class="pull-left">...</div ...
- 旧文备份:安装cygwin及在console下输入和显示中文
1.下载Cygwin.exe文件,双击安装,首先在"Choose A Download Source"的时候选择"Download Without Installing& ...