Software Engineer Intern Interview Questions in New York State | Glassdoor

# Software Engineer Intern Interview Questions in New York State

81

Software engineer intern interview questions shared by candidates

## Top Interview Questions

Sort: RelevancePopular Date

Jul 28, 2009

Jul 5, 2012

### Software Engineering Intern at Jane Street was asked...

Feb 17, 2010
 Explain tail recursion.3 Answerstail recursion is tail recursionTail recursion does computation before recursive calls. A typical implementation is to pass the current result as a parameter to recursive call.A tail recursive function is one that performs a recursive call as its final step. Tail recursion is important because it can be more efficient - you can reuse the same stack frame for the next call, saving some time and memory. For example, a NON tail recursive Fibonacci function in OCaml (forgive me if I mess the syntax up any, most of the functional programming I've done is in Haskell): let rec fib n = match n with 0 -> 1 | 1 -> 1 | n -> fib (n - 1) + fib (n - 2) Obviously, the call to fib isn't the last thing that gets evaluated. That'd be the sum of the two recursive calls. Here's a tail recursive Fibonacci function, from Literate Programming Wiki: let fib n = let rec aux n b a = if n <= 0 then a else aux (n-1) (a+b) b in aux n 1 0 It works by "carrying along" the present sum as an argument in the aux function. That way, each call of aux can only make one recursive call (in the else branch), and the Fibonacci numbers are calculated as part of that recursive call.

### Software Engineer Intern at CourseKit was asked...

Feb 11, 2012
 How would you find the n-th greatest element in a binary search tree?2 AnswersI was able to choose the language to code the solution in.Traverse the BST in 'inorder'. That gives a sorted sequence.

Feb 22, 2012
 textbook algorithms questions2 AnswersCan you tell me which questions they asked u? please send me an email to 5aht@gmx.at ...thanks!please post an example

### Software Engineer Intern at Cisco Systems was asked...

Sep 11, 2012
 How would you go about finding the kth to last element in a singly linked list?2 AnswersFirst check the size of the linkedList- O(1) operation Then walk through the linkedList from the head to the nth element, use a counter to keep track of how many elements you have walked through. return linkedListSize-number of elements you have walked through.use 2 pointers pointer 1 is 7 units ahead in position relative to pointer 2. Increment both pointer 1 reach end -> return pointer 2

### Software Development Engineer Intern at Amazon was asked...

Jan 20, 2014
 Second Round: This was a bit difficult. The question is to generate sample math problems(additions) for a 8th grade student and the results should be stored in such a way that they can be printed when required. Sample problem is 7+8=_____ The constraints are:- 1) The numbers that are to be added should be <=9 2) The result should be <=172 Answersthis actually fairly simple, for the second constraint its x+y <=17, then all you need to do is have a random generator that finds some x solve for y (i.e. y<=17-x, that way you dont have to use the random generator twice and then have run it multiple times to make sure the result is valid) then a simple if statement to test whether user input is correctone more thing to get every result less than 17 , you would have to another if statement that uses 2 randomly generatored numbers if x+y <=17 isnt true do what i mentioned earlier

May 31, 2012