Interview with Intel CAD group
Last night, I had an interview with the CAD group in Intel. They are about 35 engineeris and they do phisical design CAD tools for the microprocessor group. They are located in Oregon and Santa Clara. He asked the following questions during the ~1 hour phone interview:
- What is the biggest coding project you were involved?
- What is the difference between C and C++?
- You have a class as follows:
class node
{
public:
node *l_child, *r_child;
....
}
Write the function delete_tree(node *root)... It is something like below:
{
if(root == NULL) return;
delete_tree(root->l_child);
delete_tree(root->r_child);
delete(root);
}
- What is virtual function used for in C++?
It has something to do with derived classes. If you have a pointer to a derived class and if you call a virtual function on that pointer, it goes to the correct function i.e. not to the function of the parent class. You can have an array of pointers of type *parent. Then you can construct them as being pointers to the derived classes. Then when you call a function for every element of the array, it will call the correct function for all the derived classes.
http://www.glenmccl.com/virt_cmp.htm
- You have a graph. Given a node, how do you find the total number of nodes? Each node has the information about its children.
- Explain breadth first search and depth first search.
http://www.ics.uci.edu/~eppstein/161/960215.html
Nice animation
0 Comments:
Post a Comment
<< Home