Software Developers Interview Questions

96,344 software developers interview questions shared by candidates

Write a program to reverse the linked list. They asked the one about writing an algorithm that reads through a file line by line, then prints out a random line. It has to print each line with equal probability. The catch is that you don't know how many lines the file has ahead of time and you can only make one pass over the file. Given an array of N integers, find the missing integer.
avatar

Software Developer

Interviewed at Jackson Therapy Partners

3.3
Dec 9, 2011

Write a program to reverse the linked list. They asked the one about writing an algorithm that reads through a file line by line, then prints out a random line. It has to print each line with equal probability. The catch is that you don't know how many lines the file has ahead of time and you can only make one pass over the file. Given an array of N integers, find the missing integer.

Round 1 - Online round. 3 hours 30 MCQ questions based on Quantitative aptitude. ( Ideally to be done in 30 mins) Questions on Profit-Loss , Ratio , time-work, volumes - surface area. The level of questions was high. 4 Programming questions - Choice was between C and Java Q1 was very easy . We are given a no 'n' , we need to count how many times 2 comes between 1 to 'n' in that range. eg : - 19 . Between 1 - 19 , 2 , 12 contain 2 so the answer will be 2. My approach was using modulus, check each digit and put this in the loop. However 8/10 cases passed. Q2 was dynamic programming. Find the length of the largest subsequence which first increases and then decreases. eg : - 8 1 2 3 4 5 6 7 6 5 . In this case length will be 9 . 1 -7 increasing and 6-5 decreasing. I was clueless, how to do this question. Q3 - Linux file system structure program. We were given that the following directories already exist . we had to find out how many mkdir calls we need to make. The directories were taken in the form of 2D character arrays. Say : home , tmp so for the path /home / abc - 1 for this (1 mkdir call for abc because home already exists) / temp / xyz / wvu - 2 for this ( temp already exists , 2 mkdir calls for xyz, wvu) Q4 : A program to reverse a linked list till k nos was given . We had to find the bug in it . Run time error was coming . The insert function in the list was entering this way eg : input is 1 2 3 4 5 6 7 8 9 The values were getting entered in the list as 9 8 7 6 5 4 3 2 1 . Head pointing to 1 Our expected output for 1 2 3 4 5 6 7 8 9 with k = 4 ( The no till which we need to reverse) 4->3->2->1 ->8->7->6->5->9->8 Basically a no k was given till which we had to reverse. Subsequent rounds read below :
avatar

Software Developer

Interviewed at Ameyo

3.5
Sep 28, 2015

Round 1 - Online round. 3 hours 30 MCQ questions based on Quantitative aptitude. ( Ideally to be done in 30 mins) Questions on Profit-Loss , Ratio , time-work, volumes - surface area. The level of questions was high. 4 Programming questions - Choice was between C and Java Q1 was very easy . We are given a no 'n' , we need to count how many times 2 comes between 1 to 'n' in that range. eg : - 19 . Between 1 - 19 , 2 , 12 contain 2 so the answer will be 2. My approach was using modulus, check each digit and put this in the loop. However 8/10 cases passed. Q2 was dynamic programming. Find the length of the largest subsequence which first increases and then decreases. eg : - 8 1 2 3 4 5 6 7 6 5 . In this case length will be 9 . 1 -7 increasing and 6-5 decreasing. I was clueless, how to do this question. Q3 - Linux file system structure program. We were given that the following directories already exist . we had to find out how many mkdir calls we need to make. The directories were taken in the form of 2D character arrays. Say : home , tmp so for the path /home / abc - 1 for this (1 mkdir call for abc because home already exists) / temp / xyz / wvu - 2 for this ( temp already exists , 2 mkdir calls for xyz, wvu) Q4 : A program to reverse a linked list till k nos was given . We had to find the bug in it . Run time error was coming . The insert function in the list was entering this way eg : input is 1 2 3 4 5 6 7 8 9 The values were getting entered in the list as 9 8 7 6 5 4 3 2 1 . Head pointing to 1 Our expected output for 1 2 3 4 5 6 7 8 9 with k = 4 ( The no till which we need to reverse) 4->3->2->1 ->8->7->6->5->9->8 Basically a no k was given till which we had to reverse. Subsequent rounds read below :

Viewing 2881 - 2890 interview questions

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