Tesla interview question

find the error in a a simple squaring function whose argument is a volatile pointer to an integer.

Interview Answer

Anonymous

4 Jan 2016

volatile pointer is not safe, it should be a volatile const pointer. long long int tesla_func_squared(volatile * const int ptr) { //code; }

5