Intern Interview Questions in Los Angeles, CA | Glassdoor # Intern Interview Questions in Los Angeles, CA

From retail to finance to medicine, every industry needs interns to provide additional support and assistance. Interview questions will vary greatly depending on the industry and role you are looking for. Expect to answer questions about how you work on teams and provide examples of any relevant work experience. To ace your interview, make sure to research the particular position you are applying for.

## Top Interview Questions

Sort: RelevancePopular Date

### Mechanical Engineering Intern at Medtronic was asked...

May 4, 2010

Dec 9, 2013
 Find the max value in an array. The array is "semi-sorted". Here is an example: { 1 3 4 7 9 10 12 13 12 6 3 } As you can see, the array increases and then decreases at one point (13). 18 AnswersSimply walk the array to find the max in O(n) time. Compare the current max to the next element all the way until the end of the array.O(logn) approach: int max_value_in_semisorted_array(int* arr, int start, int end) { if (start == end) return arr[start]; int middle = (end + start) / 2; if (arr[middle] > arr[start]) return max_value_in_semisorted_array(arr, middle, end); else return max_value_in_semisorted_array(arr, start, middle); }No, your O(logn)-approach doesn't work. Try this: 1 5 8 10 9 8 7 6 5 4Show More ResponsesThe previous O(log n) approach doesn't handle arrays of odd length. int findPeak(int * array, int start, int end) { if ((start == end) || ((start == (end - 1)) && (array[start] > array[end]))) return array[start]; if ((start == (end - 1)) && (array[start] > array[end])) return array[end]; int middle = floor((start + end) / 2); if (array[middle] > array[start]) return (findPeak(array, middle, end)); else return (findPeak(array, start, middle)); } Remember to include math.h for the floor function.It seems, that it doesn't matter if the array is of odd or even length(btw, my example is not odd :)). This approach doesn't work when the max element is in the first half of your array and the middle element is greater than the first one. We cannot guarantee that if the middle element is greater than the first, our array increases monotonically from x to x[middle] and we should search the max element in the range from middle to end.It is necessary to check two elements on each side of our middle element to find out where the array increases , where decreases, and where the peak is. And only then we can guarantee something about our max.The maximum is obviously just the inflection point in the list... some of the posted solutions here are absurdly complex for this.Brute force solution can be ofcourse O(N). But we can make it better: mid = (start + end )/2 if mid > mid + 1 && mid > mid - 1 return mid else if mid mid -1 search mid -> end else if mid > mid + 1 && mid mid@Mo - This won't be work for an array where the max element is hidden in the first / second half of the main array. Eg: {1,3,9,1,-2,6,2,2,5,-1}In your test case, I see that the numbers increase, decrease, increases, decreases and so on. I thought the question says the list is semi sorted. So my program assumes that the numbers increase and then decrease. We need to find the peak. At least that is my understanding.private static int recFindPeak(int[] a, int start, int end) { if(start == end) return a[start]; int mid = (start+end)/2; if((a[mid] > a[mid+1])&&(a[mid] > a[mid-1])) return a[mid]; else if(a[mid] > a[mid-1]) return recFindPeak(a, mid+1, end); else return recFindPeak(a, start, mid-1); }My codes: int findPeak(vector num) { if (num.empty()) return 0; int lower = 0; int upper = num.size()-1; while (lower num[mid+1]) return num[mid]; else if (num[mid-1] < num[mid] && num[mid] < num[mid+1]) lower = mid+1; else upper = mid-1; } }1. Walk from begin to mid comparing a[i] a[j] and stop decrementing j when this condition fails. 3. If a[i] < a[j], then return a[j], else return a[i].Show More Responses1) find the pivot of the highest number of the semi sorted list ,using binary search on the array.(logn) 2) From their do the linear serach for finding max ,also compare with last element of the semi sorted list.public class KindsOfQuestion { static int Max(int[] arr, int start, int end) { //int max=0; if (start == end) return arr[start]; if((end-start)==1 && arr[end]>arr[start]) { return arr[end]; } if((end-start)==1 && arr[end] arr[start]) if (arr[middle] > arr[middle-1]) return Max(arr, middle, end); else return Max(arr, start, middle); } public static void main(String[] args) { int[] arr=new int[]{1,5,8,10,9,8,7,6,5,4};//,TODO,Auto-generated,method,stub System.out.println("Max is:"+Max(arr,0,arr.length-1)); } }strange, some lines missing for above solution: shouldn't be one line : if((end-start)==1 && arr[end] arr[start]) but: if((end-start)==1 && arr[end]<=arr[start]) { return arr[start]; }def maxInSemiSortedArray(inputData): low, high = 0, len(inputData) -1 while(low inputData[mid-1] and inputData[mid] > inputData[mid+1]: return inputData[mid] elif inputData[mid] < inputData[mid+1]: low = mid + 1 else: high = mid -1def maxInSemiSortedArray(inputData): low, high = 0, len(inputData) -1 while(low inputData[mid-1] and inputData[mid] > inputData[mid+1]: return inputData[mid] elif inputData[mid] < inputData[mid+1]: low = mid + 1 else: high = mid -1

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

May 3, 2012
 Write a power function power(a , b) returns a^b8 Answersint power (double a, int b) { for (int i = 1, i <= b, i++) { a *= a; } return a; }There are some conditions you are missing. What if b is <=0 ?The conditions made by the Hulu rep was to assume b > 0. However there is a better way to do this problem.Show More Responseslong power(int a, int n) { if(n%2==0) return power(a,n/2)*power(a,n/2); else if (n%2==1&&n!=1) return power(a,n-1)*a; else //n==1 return a; }double power(int a, int n){ double res=1; while(n!=0){ if((n&1)==1) { if(n>0) res*=a; else res/=a; } a*=a; n /=2; } return res; }def power(a,b): if b is 1: return a return a * (power(a, b--))double pow(int a,int b) { if(b0) { if(b%2==1) res*=a; a*=a; b>>1; } return res }def power(a, b): return a**b

Apr 25, 2014

### Engineering Intern at Cisco Systems was asked...

Apr 4, 2010
 how efficient is it to implement fibonacci of a nth number using recursion. 2 Answersnot efficient. if you apply recursion to a nth fibonacci , the order of efficiency reduce by the order of c^n. if you implement it iteratively, it can be solved in nearly O(n).It wont be the best solution using recursion. Need to use iterative approach using 3 variables. SC: o(n), TC = o(1)

### Engineering Intern at ITG Software was asked...

May 15, 2012
 Swapping of two integers without a third variable2 Answerspermutationa=a-b b=a+b a=b-a

### Summer Trading Intern at Madison Tyler Holdings was asked...

Aug 9, 2010
 How much distance is their between the hour and minute hand at 5:12?3 Answers42 degrees?How did you get that? The answer is 61.5its 84

### Tax Intern at PwC was asked...

Mar 29, 2011
 How many balloons would fit in this room?2 AnswersI was asked to explain how I came up with my number. I don't think the number I gave was too relevant but I think the question was aimed towards learning about my thought process in how I came to my conclusion.Estimating the room to be 10 x 10 x 10 and a fully filled up balloon to 1 cubit foot, I would be able to fit about 1000 fully filled balloons. Or you could say -"that depends upon the size of the average balloon and whether they are filled up or empty! Like you said, its the thought process and not the number!

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

Mar 28, 2013
 flatten iterator2 Answers(newton-raphson) public static float findzero() { float delta = 0.01f; float epsilon = 0.00001f; float x = 0.0f; float fxn = f(x); while (Math.abs(fxn) > epsilon) { float fxnp = (f(x+delta) - f(x-delta)) / (2 * delta); x = x - fxn / fxnp; fxn = f(x); } return x; }(flatten iterator) public static Iterator flattenIterator(Iterator nested) { return new FIterator(nested); } class FIterator { Iterator currentIterator = null; Iterator nested = null; public FIterator(Iterator nested) { this.nested = nested; } public boolean hasNext() { while ( ((null != currentIterator) && (!currentIterator.hasNext())) || ((null != currentIterator) && (nested.hasNext()))) { currentIterator = nested.next(); } return (currentIterator != null); } public Object next() { if (!hasNext()) return null; return currentIterator.next(); } }

### Software Engineering Intern at SanDisk was asked...

Feb 11, 2014
 They asked a brain teaser about how many people will fit in a room. 1 Answerdid dimensional analysis and sampling.
110 of 2,104 Interview Questions