《Cracking the Coding Interview》——第12章:测试——题目5·
2014-04-25 00:41
题目:怎么测试一支笔?(Pen?您老说的是钢笔?)
解法:这种简约而不简单的题目,实在是面试官最喜欢,面试者最头疼的类型了。面试官可以只花三秒,以一种灰常高贵冷艳的语气甩出这道题。然后头疼脑热的就是你了。怎么做呢?Brainstorming,找特征,分解问题,关联问题和特征,然后按规矩解题。我个人觉得这类题其实不是考察创意,而是考察发现问题、分析问题、解决问题的思路是否够清晰,就算解不出来也没事的。
代码:
- // 12.5 How would you test a pen?
- // Answer:
- // 1. A pen uses ink.
- // 2. A pen usually writes on paper.
- // 3. The volume of ink in the pen is usually small.
- // 4. Sometimes when the pen is used for too long, we wash the pen with water and dry it.
- // 5. When drawing ink from the ink bottle, we squeeze the ruber tube and releases it to draw the ink up into the pen.
- // Above all the things, there are a few things to be tested:
- // 1. the ruber tube which contains the ink.
- // 1.a. is it elastic enough?
- // 2. a very thin pipe, from which ink flows into the pen.
- // 2.a. is it easily blocked?
- // 2.b. does it break easily?
- // 3. the upper cover, which protects the ruber tube inside it.
- // 3.a. can the whorl fit tight?
- // 3.b. is the cover firm enough? does it crack easily?
- // 4. the tip of the pen, through which the ink flow out.
- // 4.a. it is actually a pipe, does it block easily?
- // 4.b. write it on different paper textures, does it write smoothly?
- // 4.c. it is steel, does it rust easily?
- int main()
- {
- return ;
- }
《Cracking the Coding Interview》——第12章:测试——题目5·的更多相关文章
- 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》——第12章:测试——题目6
2014-04-25 00:53 题目:你要如何测试一个分布式银行系统的ATM机? 解法:ATM是Automatic Teller Machine,取钱的.我想了半天,没找到什么很清晰的思路,也许是因 ...
- 《Cracking the Coding Interview》——第12章:测试——题目4
2014-04-25 00:35 题目:没有专门的测试工具,你要如何对一个网页进行压力测试? 解法:拼手速,拼电脑数量呗.快捷键+复制粘贴网址,狂搞一番.话说回来,有脚本语言的情况下,直接写个脚本来模 ...
- 《Cracking the Coding Interview》——第12章:测试——题目3
2014-04-24 23:28 题目:玩象棋游戏,你要设计一个bool型的方法来检测一个棋子能否移动到指定位置. 解法:不同的棋子有不同的移动规则,那么应该采取棋子基类实现接口,各个棋子子类来实现的 ...
随机推荐
- Kalman filter, Laser/Lidar measurement
You can download this project from https://github.com/lionzheng10/LaserMeasurement The laser measure ...
- iOS开发:小技巧积累
1.获取全局的Delegate对象,这样我们可以调用这个对象里的方法和变量: [(MyAppDelegate*)[[UIApplication sharedApplication] delegate] ...
- 在线文本编辑器cheditor应用实例
CKEditor 即 FCKEDITOR . FCKeditor是眼下最棒的可见就可以得网页编辑器之中的一个,它採用JavaScript编写.具备功能强大.配置easy.跨浏览器.支持多种编程语言.开 ...
- 搭建FTP服务
(一)FTP服务概述 FTP服务概述:名称.功能.特点.端口 VSFTP:very secure FTP 端口:21 服务安装#yum install vsftpd lftp -y ##lftp ...
- C/C++语言代码规范
1.标识符名称: 标识符名称包括函数名.常量名.变量名等.这些名字应该能反映它所代表的实际东西,具有一定的意义,使其能 够见名知义,有助于对程序功能的理解.规则如下: 所有宏定义.枚举常数和const ...
- 使用nssm将bat文件注册为windows service (eg:solr, nodejs)
nssm下载:http://pan.baidu.com/s/1sjAEevj _install.bat @echo off Set BasePath=D:\Tools %BasePath%\nssm- ...
- 提高篇(1):RMQ问题与ST表
RMQ是英文Range Minimum/Maximum Query的缩写,是询问某个区间内的最值,这里讲一种解法:ST算法 ST算法通常用在要多次(10^6级别)询问区间最值的问题中,相比于线段树,它 ...
- jquery横向手风琴效果2
<!doctype html> <html> <head> <meta charset="utf-8"> <script ty ...
- 微信网页授权access_token与基础支持的access_token
问题1:网页授权access_token与分享的jssdk中的access_token一样吗? 答:不一样.网页授权access_token 是一次性的,而基础支持的access_token的是有时间 ...
- dts--tests(四)
unit_tests.py """ DPDK Test suite. This TestSuite runs the unit tests included in DPD ...