d**f 发帖数: 264 | 1 很多时候,on-site的时候会讨论一些非常看似general的question,但是interviewer可
以从跟你的交谈中,得到很多信息.我想请问几个问题,大家跟interviewer交流的时候,
有什么经验.
1. How to check mem leaking ?
2. How to check int overflow ?
3. There is a bug in your program. How to find it ? | s*****n 发帖数: 5488 | 2
use secondary mem allocation system.
add a fxcop or what rule to check all cases,
a + b < a
get a repro first. if you still cannot figure out, add instrumentation.
add asserts.
add checkpoints.
【在 d**f 的大作中提到】 : 很多时候,on-site的时候会讨论一些非常看似general的question,但是interviewer可 : 以从跟你的交谈中,得到很多信息.我想请问几个问题,大家跟interviewer交流的时候, : 有什么经验. : 1. How to check mem leaking ? : 2. How to check int overflow ? : 3. There is a bug in your program. How to find it ?
| d**f 发帖数: 264 | 3
1.This is answer to how to avoid mem leaking.
If there is mem leaking already in other peoples code, how to check?
2. if you want assign a+b to c, you need check if b < (NMAX-a).
Another thing you need pay attention to, 0
mid = i+(j-i)/2;
3.
debug tools. gdb,windbg
memory debug tools
crash dump analysis
static code analysis
Q: There is a program. Sometime it works, sometime it crash.How to find this
bug?
A: Mostly it is caused by uninitialized vars or overflow or pointer mistake.
Q: If the program is written by C#.
A: ?
【在 s*****n 的大作中提到】 : : use secondary mem allocation system. : add a fxcop or what rule to check all cases, : a + b < a : get a repro first. if you still cannot figure out, add instrumentation. : add asserts. : add checkpoints.
|
|