Pergunta de entrevista da empresa NetApp

A C program to find index of an item in given array

Respostas da entrevista

Sigiloso

27 de dez. de 2010

I provided a right solution. The function that I need to write had parameter int check(int x[], int size, int element) where size= size of array, elememt = item who's index to be searched and array[] = array itself The interviewer pointed out only one mistake in my function implementation wherein I wrote int *y = x ; which is RIGHT as it assigns the address of the first element of the array to y pointer. Then I wrote int *y= &x[0]; and he was fine with that. I think he had never tried to assign a pointer in previous fashion before. I am confident that he had taken this point as a wrong implementation while giving interview result to manager. If it is then thats crazy.

1

Sigiloso

14 de jan. de 2014

^ The above is correct. x == &x[0].