london interview questions shared by candidates
Given an array of integers, delete the max and min numbers (both could appear more than once) in place. Do it in O(n) without shifting.
Go through the array twice. In the first run save the min and max, in the second run remove them. Both steps are O(N), so the entire algo is also O(N), it does not matter that the array is walked twice.
1. find max and min in first loop 2. In second loop following if element is min/max = simply increment a counter else a[i-counter] = a[i].
1. find max and min in first loop. 2. In second loop if a[i] is min/max then simply increment a counter else a[i-counter] = a[i].
imagine an investment bank with 300 terminals that you manage is shutting down 30 terminals and it has nothing to do with technical problems with terminals in their equity trading division. If they have made that decision and you remain with managing 270 terminals how would you deal with that decision as it will be a big disappointment to you as a sales representative/relationship manager?