由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 新书《Coding Interviews: Questions, Analysis & Solutions》已经出版
相关主题
atoi很不好写,头都大了...ms面试问了atoi,结果搞了半天我还是搞错了
新手问个初级问题, 面试coding的时候数字转字符串用itoa还是stringstream?函数atoi的实现
facebook phone面试题请教一道G家面试题
几道MS面试题关于atoi的overflow
最新微软SDE II面试题系统设计题如何摸清面试官想要的答案?
今天的面试题[更新GG Intern Interview 过程]Microsoft , Google 和Facebook的面试题。
问个google面试题Amazon phone screen面经
问个Amazon面试题面试最郁闷的是
相关话题的讨论汇总
话题: atoi话题: digit话题: coding话题: questions话题: interviews
进入JobHunting版参与讨论
1 (共1页)
z******t
发帖数: 59
1
圣诞节快乐^_^
拙著《Coding Interviews: Questions, Analysis & Solutions》已经通过Apress出版
社于近日出版。这本书收集了107个典型的编程面试题,并从如下5个方面讨论编程面试
的知识点以及解题方法:
(1) the basics of programming languages, data structures and algorithms,
(2) approaches to writing code with high quality,
(3) tips to solve difficult problems,
(4) methods to optimize code,
(5) soft skills required in interviews.
这本书在Apress出版社网站的链接:
http://www.apress.com/9781430247616
这本书在亚马逊网站的链接:
http://www.amazon.com/Coding-Interviews-Questions-Analysis-Solu
虽然我很少在本版发帖,但本版网友们可能之前读过我的博客:
(1)程序员面试题精选100题:
http://zhedahht.blog.163.com/
(2)Coding Interview Questions:
http://codercareer.blogspot.com/
去年我用中文写了一本关于编程面试的书,叫《剑指Offer:名企面试官精讲典型编程
题》。
如果您之前看过我的博客或者中文书,您可能知道我的编程以及写作能力。我想这本英
文版的《Coding Interviews: Questions, Analysis & Solutions》也不会让您失望。
我知道这个帖子有广告的嫌疑,但由于这本书的内容对大家的编程面试可能会有所帮助
,因此还请版主手下留情保留这个帖子。另外,作为一个一直说中文的人用英文写书,
其实也不是一件容易的事情,还请大家支持。谢谢大家^_^
w****x
发帖数: 2483
2
原来你就是何海涛
h*******e
发帖数: 1377
3
看这个帖子之前刚跑到你主页上看。。
l*****a
发帖数: 14598
4
你才知道?
他通过回帖来给自己的blog作广告已经很久了

【在 w****x 的大作中提到】
: 原来你就是何海涛
t**********h
发帖数: 2273
5
大牛啊,都开始出英文版的书了。

【在 z******t 的大作中提到】
: 圣诞节快乐^_^
: 拙著《Coding Interviews: Questions, Analysis & Solutions》已经通过Apress出版
: 社于近日出版。这本书收集了107个典型的编程面试题,并从如下5个方面讨论编程面试
: 的知识点以及解题方法:
: (1) the basics of programming languages, data structures and algorithms,
: (2) approaches to writing code with high quality,
: (3) tips to solve difficult problems,
: (4) methods to optimize code,
: (5) soft skills required in interviews.
: 这本书在Apress出版社网站的链接:

p*****2
发帖数: 21240
6
原来河海涛就在论坛上呀。膜拜。
l*******b
发帖数: 2586
7
拜一拜,哈哈
T******7
发帖数: 1419
8
给发个pdf 版本吧。
。。。
j*****y
发帖数: 1071
9
哈哈,好主意。

【在 T******7 的大作中提到】
: 给发个pdf 版本吧。
: 。。。

i**9
发帖数: 351
10
Don't call me a bad ass but I have a question. OP 在哪里高就?进了F or G了吗
:)
相关主题
今天的面试题ms面试问了atoi,结果搞了半天我还是搞错了
问个google面试题函数atoi的实现
问个Amazon面试题请教一道G家面试题
进入JobHunting版参与讨论
T******7
发帖数: 1419
11
他google+上写的思科。



【在 i**9 的大作中提到】
: Don't call me a bad ass but I have a question. OP 在哪里高就?进了F or G了吗
: :)

l********n
发帖数: 1038
12
剑指offer那本书的代码,用静态分析工具分析,发现1000多个可能的错误
s*****2
发帖数: 68
13
原来LZ一直在Job版潜水,多来参加题目讨论呀!
l*********8
发帖数: 4642
14
请问英文书与中文书的区别是什么?

【在 z******t 的大作中提到】
: 圣诞节快乐^_^
: 拙著《Coding Interviews: Questions, Analysis & Solutions》已经通过Apress出版
: 社于近日出版。这本书收集了107个典型的编程面试题,并从如下5个方面讨论编程面试
: 的知识点以及解题方法:
: (1) the basics of programming languages, data structures and algorithms,
: (2) approaches to writing code with high quality,
: (3) tips to solve difficult problems,
: (4) methods to optimize code,
: (5) soft skills required in interviews.
: 这本书在Apress出版社网站的链接:

z******t
发帖数: 59
15
多谢关注。是的,我在思科。
在现在的岗位最大的好处是我的时间比较自由,因此才有时间一年写一本书。换到其他
公司,我不知道自己是否还抽出这么多时间做自己想做的事情。

【在 T******7 的大作中提到】
: 他google+上写的思科。
:
: 吗

z******t
发帖数: 59
16
当时只考虑测试代码运行的结果,还真没有用静态分析工具分析过。
请问你是用什么静态分析工具?多谢^_^ 回头我也去分析一下。

【在 l********n 的大作中提到】
: 剑指offer那本书的代码,用静态分析工具分析,发现1000多个可能的错误
z******t
发帖数: 59
17
英文书是中文版的翻译版和加强版。
英文书是按照中文版的框架写的,中文版的内容绝大部分都包含在英文版里,但英文版
的内容要多一些。中文版讨论了52个面试题,而英文版的面试题超过了100个。

【在 l*********8 的大作中提到】
: 请问英文书与中文书的区别是什么?
T*******e
发帖数: 4928
18
co ask

【在 l*********8 的大作中提到】
: 请问英文书与中文书的区别是什么?
h****n
发帖数: 1093
19
支持一下大牛吧,回头有卖的话就去买一本

【在 z******t 的大作中提到】
: 圣诞节快乐^_^
: 拙著《Coding Interviews: Questions, Analysis & Solutions》已经通过Apress出版
: 社于近日出版。这本书收集了107个典型的编程面试题,并从如下5个方面讨论编程面试
: 的知识点以及解题方法:
: (1) the basics of programming languages, data structures and algorithms,
: (2) approaches to writing code with high quality,
: (3) tips to solve difficult problems,
: (4) methods to optimize code,
: (5) soft skills required in interviews.
: 这本书在Apress出版社网站的链接:

T*******e
发帖数: 4928
20
谢谢解答!

【在 z******t 的大作中提到】
: 英文书是中文版的翻译版和加强版。
: 英文书是按照中文版的框架写的,中文版的内容绝大部分都包含在英文版里,但英文版
: 的内容要多一些。中文版讨论了52个面试题,而英文版的面试题超过了100个。

相关主题
关于atoi的overflowAmazon phone screen面经
系统设计题如何摸清面试官想要的答案?面试最郁闷的是
[更新GG Intern Interview 过程]Microsoft , Google 和Facebook的面试题。分享一点面试经历
进入JobHunting版参与讨论
s**s
发帖数: 70
21
agree

【在 T******7 的大作中提到】
: 给发个pdf 版本吧。
: 。。。

x***a
发帖数: 29
22
订了一本
O******i
发帖数: 269
23
leetcode不出书,都让CC150和河海涛抢了先机了。
p*****b
发帖数: 291
24
这个要表示敬佩一下.
l********n
发帖数: 1038
25
开源的很多呀

【在 z******t 的大作中提到】
: 当时只考虑测试代码运行的结果,还真没有用静态分析工具分析过。
: 请问你是用什么静态分析工具?多谢^_^ 回头我也去分析一下。

S******y
发帖数: 1330
26
Niu ren ah
s********l
发帖数: 998
27
有pdf版卖不?
pdf的方便多了 还可以加注释

【在 z******t 的大作中提到】
: 圣诞节快乐^_^
: 拙著《Coding Interviews: Questions, Analysis & Solutions》已经通过Apress出版
: 社于近日出版。这本书收集了107个典型的编程面试题,并从如下5个方面讨论编程面试
: 的知识点以及解题方法:
: (1) the basics of programming languages, data structures and algorithms,
: (2) approaches to writing code with high quality,
: (3) tips to solve difficult problems,
: (4) methods to optimize code,
: (5) soft skills required in interviews.
: 这本书在Apress出版社网站的链接:

B*******1
发帖数: 2454
28
我强烈推荐二爷也出书,每题分别提供python,java和c solution。
l*********8
发帖数: 4642
29
有电子版买的。

【在 s********l 的大作中提到】
: 有pdf版卖不?
: pdf的方便多了 还可以加注释

s********l
发帖数: 998
30
pdf的? 不喜欢kindle的~~

【在 l*********8 的大作中提到】
: 有电子版买的。
相关主题
[合集] 从be interviewed 到interview 的一些感受 (1) 希望对即将新手问个初级问题, 面试coding的时候数字转字符串用itoa还是stringstream?
[合集] 报一个offer,并推荐一个very good interview coding 网站facebook phone面试题
atoi很不好写,头都大了...几道MS面试题
进入JobHunting版参与讨论
d****n
发帖数: 1637
31
能给看看chapter 5 的pdf不?谢谢啊。
p*****2
发帖数: 21240
32
我现在用ruby

【在 B*******1 的大作中提到】
: 我强烈推荐二爷也出书,每题分别提供python,java和c solution。
d****n
发帖数: 1637
33
作者自序写书历程:

我很快和Apress谈成了合作意向。另外两家出版社中,O'Reilly对面试这个选题不太感
兴趣,Wrox由于已经出过一本编程面试的书而不想再重复这个主题。
在版权问题上和Apress的编辑来来回回写了很多封Email。我在计划书里坦承
英文版的书和中文版的《剑指Offer》将有相似性,会采用中文版书中整体结构以及绝
大部分例题。这让版权意识很强的老外很紧张,担心这会侵犯出版《剑指Offer》的电
子工业出版的版权。直到我最后证明电子工业出版只有《剑指Offer》的中文(含简体
中文和繁体中文)版权而没有英文版权,他们才松了口气最终签订合同
...

http://blog.csdn.net/cadcisdhht/article/details/7965773
O******i
发帖数: 269
34
还是出中文的好,不然可能很多阿三得利。

【在 d****n 的大作中提到】
: 作者自序写书历程:
: “
: 我很快和Apress谈成了合作意向。另外两家出版社中,O'Reilly对面试这个选题不太感
: 兴趣,Wrox由于已经出过一本编程面试的书而不想再重复这个主题。
: 在版权问题上和Apress的编辑来来回回写了很多封Email。我在计划书里坦承
: 英文版的书和中文版的《剑指Offer》将有相似性,会采用中文版书中整体结构以及绝
: 大部分例题。这让版权意识很强的老外很紧张,担心这会侵犯出版《剑指Offer》的电
: 子工业出版的版权。直到我最后证明电子工业出版只有《剑指Offer》的中文(含简体
: 中文和繁体中文)版权而没有英文版权,他们才松了口气最终签订合同
: ...

l*****a
发帖数: 14598
35
这100个题目中有多少是不常见的呢?
如果买来一本书,发现绝大多数题目都是见过的/常见的
可能不太爽

【在 z******t 的大作中提到】
: 英文书是中文版的翻译版和加强版。
: 英文书是按照中文版的框架写的,中文版的内容绝大部分都包含在英文版里,但英文版
: 的内容要多一些。中文版讨论了52个面试题,而英文版的面试题超过了100个。

w*******6
发帖数: 1897
36
哈哈,幸会幸会。圣诞快乐
s*****n
发帖数: 956
37
可能出书的目的就是省了你上网去找常见题目的时间了,哈哈

【在 l*****a 的大作中提到】
: 这100个题目中有多少是不常见的呢?
: 如果买来一本书,发现绝大多数题目都是见过的/常见的
: 可能不太爽

d****n
发帖数: 1637
38
看了下楼主的《剑指Offer——名企面试官精讲典型编程题》
第7章,第一个实例简直就是面试官装B的一个实例。
说什么atoi 返回0的时候也可能是错误,会设置一个全局变量。
根本就是瞎扯。或者说最近的libc里面根本没有提。害的我找了一圈
###############man 3 atoi :############
DESCRIPTION
The atoi() function converts the initial portion of the string
pointed to by nptr to int. The behaviour is the same as
strtol(nptr, (char **)NULL, 10);
except that atoi() does not detect errors.
###############atoi.c###################
00001 /*
00002 * This file is shared between libc and the kernel, so don't put
anything
00003 * in here that won't work in both contexts.
00004 */
00005
00006 #ifdef _KERNEL
00007 #include
00008 #include
00009 #else
00010 #include
00011 #include
00012 #endif
00013
00014 /*
00015 * Standard C function: parse a string that represents a decimal
integer.
00016 * Leading whitespace is allowed. Trailing gunk is allowed too. Doesn'
t
00017 * really report syntax errors in any useful way.
00018 */
00019
00020 int
00021 atoi(const char *s)
00022 {
00023 static const char digits[] = "0123456789"; /* legal digits in
order */
00024 unsigned val=0; /* value we're accumulating */
00025 int neg=0; /* set to true if we see a minus sign
*/
00026
00027 /* skip whitespace */
00028 while (*s==' ' || *s=='\t') {
00029 s++;
00030 }
00031
00032 /* check for sign */
00033 if (*s=='-') {
00034 neg=1;
00035 s++;
00036 }
00037 else if (*s=='+') {
00038 s++;
00039 }
00040
00041 /* process each digit */
00042 while (*s) {
00043 const char *where;
00044 unsigned digit;
00045
00046 /* look for the digit in the list of digits */
00047 where = strchr(digits, *s);
00048 if (where==NULL) {
00049 /* not found; not a digit, so stop */
00050 break;
00051 }
00052
00053 /* get the index into the digit list, which is the
value */
00054 digit = (where - digits);
00055
00056 /* could (should?) check for overflow here */
00057
00058 /* shift the number over and add in the new digit */
00059 val = val*10 + digit;
00060
00061 /* look at the next character */
00062 s++;
00063 }
00064
00065 /* handle negative numbers */
00066 if (neg) {
00067 return -val;
00068 }
00069
00070 /* done */
00071 return val;
00072 }
z******t
发帖数: 59
39
谢谢指正。这个题目的确引发了不少争议。
atoi这个API在Windows和在Linux上的实现略有不同。书中提到的观点是参考了Windows
的实现。下面是这两段话从MSDN上拷贝下来的:
Each function returns the int value produced by interpreting the input
characters as a number. The return value is 0 for atoi and _wtoi, if the
input cannot be converted to a value of that type.
In the case of overflow with large negative integral values, LONG_MIN is
returned. atoi and _wtoi return INT_MAX and INT_MIN on these conditions. In
all out-of-range cases, errno is set to ERANGE. If the parameter passed in
is NULL, the invalid parameter handler is invoked, as described in Parameter
Validation. If execution is allowed to continue, these functions set errno
to EINVAL and return 0.
MSDN上对应的链接是:
http://msdn.microsoft.com/en-us/library/yd5xkb5c(v=vs.110).aspx
从上面的文字,可以看出Windows实现的atoi在处理错误的时候,是可能返回0并设置全
局变量errno的。
Linux似乎分成了两个不同的API:atoi只做数值转换但不做错误处理,strtol完成类似
的功能但做错误处理。
我无意去比较Windows和Linux两种API设计风格的优劣。本来API的设计就充满了妥协、
取舍。我们是更需要API的简易性可用性、还是需要需要API的完整性准确性?这里面就
有取舍,不同的人的观点可能就不一样。
由于在书中的讨论偏重于设计一个功能完整的API,希望应聘者对错误处理能有全面的
考虑,所以采取了现在这种写法。
不知道我这样的解释能否被接受?

【在 d****n 的大作中提到】
: 看了下楼主的《剑指Offer——名企面试官精讲典型编程题》
: 第7章,第一个实例简直就是面试官装B的一个实例。
: 说什么atoi 返回0的时候也可能是错误,会设置一个全局变量。
: 根本就是瞎扯。或者说最近的libc里面根本没有提。害的我找了一圈
: ###############man 3 atoi :############
: DESCRIPTION
: The atoi() function converts the initial portion of the string
: pointed to by nptr to int. The behaviour is the same as
: strtol(nptr, (char **)NULL, 10);
: except that atoi() does not detect errors.

s*******y
发帖数: 44
40
heard, ding

【在 z******t 的大作中提到】
: 圣诞节快乐^_^
: 拙著《Coding Interviews: Questions, Analysis & Solutions》已经通过Apress出版
: 社于近日出版。这本书收集了107个典型的编程面试题,并从如下5个方面讨论编程面试
: 的知识点以及解题方法:
: (1) the basics of programming languages, data structures and algorithms,
: (2) approaches to writing code with high quality,
: (3) tips to solve difficult problems,
: (4) methods to optimize code,
: (5) soft skills required in interviews.
: 这本书在Apress出版社网站的链接:

相关主题
几道MS面试题问个google面试题
最新微软SDE II面试题问个Amazon面试题
今天的面试题ms面试问了atoi,结果搞了半天我还是搞错了
进入JobHunting版参与讨论
w**********o
发帖数: 140
41
NB
s**********r
发帖数: 8153
42
这么牛!膜拜一下牛人。
顺便说一下,如果你把pdf版post到网上或者给俺们中国人用,你就是大大大大大好人
了!
s**********r
发帖数: 8153
43
好贵
e******i
发帖数: 106
44
大牛有pdf版么,屌丝买不起啊
g********o
发帖数: 132
45
mark~~
y****n
发帖数: 743
46
我对C/C++很初级,关于这个atoi请教大牛们一个问题:
不理解为什么要调用strchr?平均5次循环,10byte的常量空间?
...
static const char digits[] = "0123456789";
...
where = strchr(digits, *s);
...
digit = (where - digits);
...
如果我写成这样,有什么问题没有?
if ((*s >= '0') && (*s <= '9'))
digit = *s - '0';

【在 d****n 的大作中提到】
: 看了下楼主的《剑指Offer——名企面试官精讲典型编程题》
: 第7章,第一个实例简直就是面试官装B的一个实例。
: 说什么atoi 返回0的时候也可能是错误,会设置一个全局变量。
: 根本就是瞎扯。或者说最近的libc里面根本没有提。害的我找了一圈
: ###############man 3 atoi :############
: DESCRIPTION
: The atoi() function converts the initial portion of the string
: pointed to by nptr to int. The behaviour is the same as
: strtol(nptr, (char **)NULL, 10);
: except that atoi() does not detect errors.

v***n
发帖数: 5085
47
http://www.amazon.com/Coding-Interviews-Questions-Analysis-Solu
looks good, will get one.

【在 z******t 的大作中提到】
: 圣诞节快乐^_^
: 拙著《Coding Interviews: Questions, Analysis & Solutions》已经通过Apress出版
: 社于近日出版。这本书收集了107个典型的编程面试题,并从如下5个方面讨论编程面试
: 的知识点以及解题方法:
: (1) the basics of programming languages, data structures and algorithms,
: (2) approaches to writing code with high quality,
: (3) tips to solve difficult problems,
: (4) methods to optimize code,
: (5) soft skills required in interviews.
: 这本书在Apress出版社网站的链接:

r*****e
发帖数: 792
48
中文版的我有一本,那个blog我也都看过,应该说还是有帮助的。而且有些问题的解决
方法挺巧妙的。比如说排列,组合的解法就感觉更好理解记忆,虽然我看过好几种解法
。总体的难度没有leetcode高,但是真正面试FG的时候其实题也没那么难。
英文版的题多了些,应该还是有参考价值的吧,过一段准备换个工作,到时候
买本看看。毕竟看书和在leetcode上看的感觉和视角不一样。

【在 v***n 的大作中提到】
: http://www.amazon.com/Coding-Interviews-Questions-Analysis-Solu
: looks good, will get one.

p*********y
发帖数: 17
49
我觉得没什么大问题,提下strtol更好,这个是用全局变量的。

Windows
In
Parameter

【在 z******t 的大作中提到】
: 谢谢指正。这个题目的确引发了不少争议。
: atoi这个API在Windows和在Linux上的实现略有不同。书中提到的观点是参考了Windows
: 的实现。下面是这两段话从MSDN上拷贝下来的:
: Each function returns the int value produced by interpreting the input
: characters as a number. The return value is 0 for atoi and _wtoi, if the
: input cannot be converted to a value of that type.
: In the case of overflow with large negative integral values, LONG_MIN is
: returned. atoi and _wtoi return INT_MAX and INT_MIN on these conditions. In
: all out-of-range cases, errno is set to ERANGE. If the parameter passed in
: is NULL, the invalid parameter handler is invoked, as described in Parameter

f*******w
发帖数: 1243
50
原来你就是何海涛,哈哈
相关主题
函数atoi的实现系统设计题如何摸清面试官想要的答案?
请教一道G家面试题[更新GG Intern Interview 过程]Microsoft , Google 和Facebook的面试题。
关于atoi的overflowAmazon phone screen面经
进入JobHunting版参与讨论
f*******w
发帖数: 1243
51
能不能post其中一个小section的pdf试读?
amazon的试读只有第一章的没什么意义…
P*******b
发帖数: 1001
52
这本书好吗?那么贵

【在 z******t 的大作中提到】
: 圣诞节快乐^_^
: 拙著《Coding Interviews: Questions, Analysis & Solutions》已经通过Apress出版
: 社于近日出版。这本书收集了107个典型的编程面试题,并从如下5个方面讨论编程面试
: 的知识点以及解题方法:
: (1) the basics of programming languages, data structures and algorithms,
: (2) approaches to writing code with high quality,
: (3) tips to solve difficult problems,
: (4) methods to optimize code,
: (5) soft skills required in interviews.
: 这本书在Apress出版社网站的链接:

s*******r
发帖数: 2697
53
顶下核桃哥 呵呵

【在 z******t 的大作中提到】
: 圣诞节快乐^_^
: 拙著《Coding Interviews: Questions, Analysis & Solutions》已经通过Apress出版
: 社于近日出版。这本书收集了107个典型的编程面试题,并从如下5个方面讨论编程面试
: 的知识点以及解题方法:
: (1) the basics of programming languages, data structures and algorithms,
: (2) approaches to writing code with high quality,
: (3) tips to solve difficult problems,
: (4) methods to optimize code,
: (5) soft skills required in interviews.
: 这本书在Apress出版社网站的链接:

1 (共1页)
进入JobHunting版参与讨论
相关主题
面试最郁闷的是最新微软SDE II面试题
分享一点面试经历今天的面试题
[合集] 从be interviewed 到interview 的一些感受 (1) 希望对即将问个google面试题
[合集] 报一个offer,并推荐一个very good interview coding 网站问个Amazon面试题
atoi很不好写,头都大了...ms面试问了atoi,结果搞了半天我还是搞错了
新手问个初级问题, 面试coding的时候数字转字符串用itoa还是stringstream?函数atoi的实现
facebook phone面试题请教一道G家面试题
几道MS面试题关于atoi的overflow
相关话题的讨论汇总
话题: atoi话题: digit话题: coding话题: questions话题: interviews