Software Developers Interview Questions

96,321 software developers interview questions shared by candidates

/* * Suppose we have a sorted array in ascending order, with no duplicates: * * {1, 2, 3, 4, 5, 6, 7} * * Somehow an unknown amount of numbers at the beginning are shifted to the end, * creating an array that looks like: * 0 1 2 3 4 5 6 * {3, 4, 5, 6, 7, 1, 2} * * Let us call the new array a shifted cyclic array. * * Now, given a Shifted Cyclic Array int a[], and its length n (> 0), write a function * to find the smallest number in the array. */
avatar

Software Developer

Interviewed at Storm8

3.7
Jan 11, 2012

/* * Suppose we have a sorted array in ascending order, with no duplicates: * * {1, 2, 3, 4, 5, 6, 7} * * Somehow an unknown amount of numbers at the beginning are shifted to the end, * creating an array that looks like: * 0 1 2 3 4 5 6 * {3, 4, 5, 6, 7, 1, 2} * * Let us call the new array a shifted cyclic array. * * Now, given a Shifted Cyclic Array int a[], and its length n (> 0), write a function * to find the smallest number in the array. */

The interviewer started with some small talk. Talked a little bit about my research work. Then went on with technical questions. Openned terminal on his computer. First he asked about if I know anything about zombie process. Then he asked about ‘malloc’. Then he told me, how would I implement a malloc like function in a separate memory space like some PCI connected to the main memory. The question was not very clear to me. I tried to explain how I could implement that memory over the extra connected memory. I am not sure if he was very happy about it. Then he went onto his terminal. A C program was there. Just two lines char* str1 = “string1”; char str2[] = “string2”; He told me to print the two strings. I did and then he told me to change the ‘t’ in both of the string to ‘T’. I told him that we cannot change the first string. He asked me why? I could not tell it clearly. I just showed him that, it generates a segmentation fault. I told it might be in some place in the memory which we cannot edit. He kept asking the question to prove my point. Then gave me hint and let me print the addresses of main, some variables which have higher value sounded like they are in the stack part. Printing the values of main showed very low address which shows that, it’s in the code segment. The char* variable was in a little more higher address which clearly shows that, it is in the data segment, which suggests that we can not edit anything on the data segment. So need to know what’s more there in the data segment? Then he showed some networking terms ip ipconfig ping some more (around 6-7) which I forgot. He told me to explain in short what these functions do. Then he asked me to write a script on python, which will read a file and add all the numbers on the third column. He showed me the file with cat command. It as a space separated text like 1 7 8 9 6 5 5 0 8 8 4 5 7 2 4 6 8 9 0 7 4 5 1 7 9 6 0 3 8 0 1 7 8 9 4 6 8 0 8 6 9 8 6 9 7 0 7 6 4 0 1 2 3 4 5 6 7 8 4 5 6 7 8 9 1 0 1 3 4 8 3 5 1 7 8 9 4 6 8 0 8 6 9 8 6 9 Then he gave me a problem on linked list. The problem was to delete all the nodes with a particular number on it. I just needed to write the main function and call that from the main file. The structure and main file was already written. I just needed to add the function prototype to the *.h file.
avatar

Software Developer

Interviewed at Arista Networks

4.1
Sep 14, 2015

The interviewer started with some small talk. Talked a little bit about my research work. Then went on with technical questions. Openned terminal on his computer. First he asked about if I know anything about zombie process. Then he asked about ‘malloc’. Then he told me, how would I implement a malloc like function in a separate memory space like some PCI connected to the main memory. The question was not very clear to me. I tried to explain how I could implement that memory over the extra connected memory. I am not sure if he was very happy about it. Then he went onto his terminal. A C program was there. Just two lines char* str1 = “string1”; char str2[] = “string2”; He told me to print the two strings. I did and then he told me to change the ‘t’ in both of the string to ‘T’. I told him that we cannot change the first string. He asked me why? I could not tell it clearly. I just showed him that, it generates a segmentation fault. I told it might be in some place in the memory which we cannot edit. He kept asking the question to prove my point. Then gave me hint and let me print the addresses of main, some variables which have higher value sounded like they are in the stack part. Printing the values of main showed very low address which shows that, it’s in the code segment. The char* variable was in a little more higher address which clearly shows that, it is in the data segment, which suggests that we can not edit anything on the data segment. So need to know what’s more there in the data segment? Then he showed some networking terms ip ipconfig ping some more (around 6-7) which I forgot. He told me to explain in short what these functions do. Then he asked me to write a script on python, which will read a file and add all the numbers on the third column. He showed me the file with cat command. It as a space separated text like 1 7 8 9 6 5 5 0 8 8 4 5 7 2 4 6 8 9 0 7 4 5 1 7 9 6 0 3 8 0 1 7 8 9 4 6 8 0 8 6 9 8 6 9 7 0 7 6 4 0 1 2 3 4 5 6 7 8 4 5 6 7 8 9 1 0 1 3 4 8 3 5 1 7 8 9 4 6 8 0 8 6 9 8 6 9 Then he gave me a problem on linked list. The problem was to delete all the nodes with a particular number on it. I just needed to write the main function and call that from the main file. The structure and main file was already written. I just needed to add the function prototype to the *.h file.

Viewing 101 - 110 interview questions

Glassdoor has 96,321 interview questions and reports from Software developers interviews. Prepare for your interview. Get hired. Love your job.