I was given a short function in C (dictated because we were hanging on a phone): int foo(int a) { int result = 0; while (a >>= 1) result += 1 return result } And my task was to say what's wrong with this function, what's its purpose and what would I write my colleague who submitted it for a code review
Engineer Intern Interview Questions
20,638 engineer intern interview questions shared by candidates
Given a mathematical expression, what data structure would you use to evaluate the expression? How would you design the above question to use Trees/Graphs.
You have two operations: add by one and multiply by 2. Find the minimum number of operations to get from 0 to any particular integer.
Use C to count the number of set bits in an int.
Not very difficult - logic questions involving a different language.
(following the previous one) You got only ONE baby bottle sample. You would like to know the max height you can drop it without breaking the bottle. Let set the unit as 1 foot. And the highest height you can reach is at N feet. So how would you find the (max) safe height?
Compare and Book and a Three Ring Binder using data structures and classes.
Reverse all the characters in a string before you encounter an 'x'. abcdxdd - > dcbaxdd
Given the sum, find all pairs of 2 numbers that have the sum.
How many D-flip flops are needed in a 7 state finite state machine
Viewing 341 - 350 interview questions