employer cover photo
employer logo
employer logo

National Instruments

Is this your company?

National Instruments Interview Question

Q: Calculate the average of all values stored within a binary tree.

Interview Answer

Anonymous

Oct 19, 2015

This one was fairly straight forward, I used the presorting algorithm to traverse the tree, and passed my running sum and count by value in order to get the final average. What I missed was that it would have been safer to pass by reference to the memory address, but otherwise I did it fairly well.