《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型的方法来检测一个棋子能否移动到指定位置. 解法:不同的棋子有不同的移动规则,那么应该采取棋子基类实现接口,各个棋子子类来实现的 ...
随机推荐
- iRecognizer号码扫描开发实录
iRecognizer——这是一款可以帮助你快速扫描获得印刷体数字的软件 现已上架 腾讯应用宝,酷安 提供的功能:扫一扫(相册或当场扫描),获得电话号码,之后就可以拨打或者发送短信,自动复制到剪贴板, ...
- 爬虫第一篇基本库的使用——urllib
在Python2中有urllib2和urllib3两个库来实现请求的发送,在Pyhon3中则统一为urllib. urilib包含以下4个模块 request:最基本的请求模块,可以用来实现请求的发送 ...
- IOS 自定义代理delegate方法
创建一个自定义代理 @class MJTgFooterView; /** 1.协议名称: 控件类名 + Delegate 2.代理方法普遍都是@optional 3. */ @protocol MJT ...
- 定位webpack文件大小
之前发现一个神器,记录一下,可以可视化webpack打包的每个js文件大小,这样对我们优化代码是有帮助的,有目标的 https://www.npmjs.com/package/webpack-bund ...
- 2017.11.10 web中URL和URI的区别
URI:Uniform Resource Identifier,统一资源标识符: •URL:Uniform Resource Locator,统一资源定位符: •URN:Uniform Resourc ...
- C#中的委托是什么?事件是不是一种委托?
C#中的委托是什么? 委托可以把一个方法作为参数代入另一个方法. 委托可以理解为指向一个函数的引用. 事件是不是一种委托?事件是一种特殊的委托.
- 理解 JavaScript 作用域(转)
简介 JavaScript 有个特性称为作用域.尽管对于很多开发新手来说,作用域的概念不容易理解,我会尽可能地从最简单的角度向你解释它们.理解作用域能让你编写更优雅.错误更少的代码,并能帮助你实现强大 ...
- 修改第三方库内容,carsh提示"image not found"
在图示位置把提示的东西加上即可 参考: iOS app with framework crashed on device, dyld: Library not loaded, Xcode 6 Beta ...
- Web as a App(Web既APP)的概念可以提出吗?
Web as a App (WaaA),Web既APP.灵感出于SaaS.PaaS.IaaS等~ 最近在做一个PC项目,即便我的项目是to B的,用户量没那么大,但是我仍然很注重性能及用户体验,我把我 ...
- 1060: [ZJOI2007]时态同步
Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 3610 Solved: 1521[Submit][Status][Discuss] Descript ...