nvidia interview experience
location:
NVIDIA
San Thomas Expressway, Santa Clara
duration
2 hours, 1PM to 3PM
2 interviewers, each for 1 hour
------------------------------------------
cdj
xor eax, edx
sub eax, edx
问我这段代码干嘛。就是算负数的补码(Two's Complement),正数没变化
logic puzzle,
4 fuses, each fuse burns out in 40 minutes, create a fuse that can burn
in
20 minutes. slightly flawed problem. Because when you burn the fuse from
two
ends, it is not exactly 20 minutes. (Two combustion points are
certainly
faster than one.)
1 runtime analysis problem for the Scale heavier object identification.
You
have 8 objects that look identical to each other but 1 of the object is
heavier than the others. Please design an algorithm to pick out the
heavier
object.
You can always split the 8 objects into two groups and recursively split
the
heavier group into 2 groups until 1 object is left out. That object is
the
heavier one. However, that algorithm will require log2n time.
Better approach is you split the 8 objects into three groups and
recursively
split the one containing the heavier object(if the two groups on the
scale
are of the same weight, the heavier one must be in the third group.
Otherwise, the heavier one is in the heavier group on the scale.) into
another 3 groups until 1 object is left out. That object is the heavier
one.
That algorithm will require log3n time.
2nd interviewer asked about my research which I talked about for 20 mins
and
asked me about a programming question.(write the code to implement
binary
search algorithm.)
Do not use memory copy, pass the original array recursively to the
function
BinarySearch.