Senior Interview Questions
senior interview questions shared by candidates
Top Interview Questions
Senior Product Manager at Amazon was asked...
The manager of component 'A' says his functionality is more important than that of component 'B.' The manager of component 'B' says his is more important than that of component 'A.' You can only implement one A or B, but not both - which do you choose to implement. 13 AnswersI reference the Product Plan and select the component w/ the higher priority. The interview says "There is no Product Plan." I say "I select the one w/ the higher ROI." They say "there is no ROI." I say "then I choose the component whose manager has the best rationale." I would say to do my own research I would say whichever is more valuable to customer & gives competitive advantage to Amazon. Show More Responses The key question to ask is definition of "IMPORTANT". Is it important to the managers (ego equation), important to the end consumer or important for Amazon. The first one needs to be thrown out immediately and the others must be quantified based on achievability, impact on end user and ROI. Agreed. Need to drill into what "important" means. Great catch My guess is that Amazon was looking to quantify/define "important" from the customer perspective. I would recommend doing a data collection plan on the "functionality" - can you quantify the functionality and its execution be turned into hours saved, steps minimized, bottlenecks reduced, inefficiencies gained? I would recommend doing a data collection plan on the "functionality" - can you quantify the functionality and its execution be turned into hours saved, steps minimized, bottlenecks reduced, inefficiencies gained? In addition to the above suggestions, I would look at cost and time to market and then score both options. Then define value metrics. The cheapest and most valuable either as a technology sustainer or for customer wins. Given that it's Amazon, customer value will hold up the highest as one of their corporate culture virtues. How was "important" defined and what data backs up the claim? What is the impact of selecting component A v. B on budget, time to market, feature creep, deadlines, etc. Another key data point is what is the risk of selecting one over the other? Are both important enough to change the release plan, or can one be added later as a product improvement? I would collect data and take the decision. Type of data that you need collect depends on functionalities. This must be escalated to the program management team or a higher authority to make a decision. This decision should not be made at the level of a product management. Each organization follows different strategy and long/short term goals. At the same time they also do have different principles. Amazon is the most customer centric company. So if I assume the manager if from amazon, they need to look towards more customer success in both plan A and plan B. Couple of other factors also need to be quantitatively calculated to take the better decision. NPV should be calculated for both projects. Whichever project has higher NPV than IRR should be selected. If both project has higher NPV than IRR then higher NPV value project should be selected to proceed. |
Senior Software Engineer at Facebook was asked...
Write some pseudo code to raise a number to a power. 11 Answerspretty trivial... int raise(num, power){ if(power==0) return 1; if(power==1) return num; return(raise(num, power-1)*num); } double Power(int x, int y) { double ret = 1; double power = x; while (y > 0) { if (y & 1) { ret *= power; } power *= power; y >>= 1; } return ret; } Show More Responses In Ruby: def power(base, power) product = 1 power.times do product *= base end product end puts "2^10 = 1024 = #{power(2,10)}" puts "2^0 = 1 = #{power(2,0)}" puts "2^1 = 2 = #{power(2,1)}" If I were an interviewer, I would ask the Aug 29, 2010 poster why he used bitwise operators, and whether he would deploy that code in a production environment, or if he merely wanted to demonstrate, for purposes of the interview, that he understands bitwise operations. Because it uses dynamic programming and is lots more efficient than your algorithm. If the power is not integer, use ln and Taylor series If I'm the interviewer, none of above answers is acceptable. What if y < 0? what if y < 0 and x == 0? I'm seeing an endless recursion that will eventually overflow the stack, and the none-recursive one just simply returns 1. There is a way to do this in a logN way rather than N. function power(x, n) { if n == 1 return x; // Even numbers else if (n%2 == 0) return square( power (x, n/2)); // Odd numbers else return power(x, n-1); } This is from Programming pearls.. interesting way. small mistake function power(x, n) { if n == 1 return x; // Even numbers else if (n%2 == 0) return square( power (x, n/2)); // Odd numbers else return power(x, n-1) * x; } # Solution for x ^ n with negative values of n as well. def square(x): return x * x def power(x, n): if x in (0, 1): return x if n == 0: return 1 if n < 0: x = 1.0 / x n = abs(n) # Even number if n % 2 == 0: return square(power(x, n/2)) # Odd number else: return x * power(x, n - 1) print ("0 ^ 0 = " + str(power(0, 0))) print ("0 ^ 1 = " + str(power(0, 1))) print ("10 ^ 0 = " + str(power(10, 0))) print ("2 ^ 2 = " + str(power(2, 2))) print ("2 ^ 3 = " + str(power(2, 3))) print ("3 ^ 3 = " + str(power(3, 3))) print ("2 ^ 8 = " + str(power(2, 8))) print ("2 ^ -1 = " + str(power(2, -1))) print ("2 ^ -2 = " + str(power(2, -2))) print ("2 ^ -8 = " + str(power(2, -8))) |
Senior Software Engineer at Google was asked...
Given an array of numbers, replace each number with the product of all the numbers in the array except the number itself *without* using division. 8 AnswersO(size of array) time & space: First, realize that saying the element should be the product of all other numbers is like saying it is the product of all the numbers to the left, times the product of all the numbers to the right. This is the main idea. Call the original array A, with n elements. Index it with C notation, i.e. from A[0] to A[n - 1]. Create a new array B, also with n elements (can be uninitialized). Then, do this: Accumulator = 1 For i = 0 to n - 2: Accumulator *= A[i] B[i + 1] = Accumulator Accumulator = 1 For i = n - 1 down to 1: Accumulator *= A[i] B[i - 1] *= Accumulator Replace A with B It traverses A twice and executes 2n multiplicates, hence O(n) time It creates an array B with the same size as A, hence O(n) temporary space # A Python solution (requires Python 2.5 or higher): def mult(arr, num): return reduce(lambda x,y: x*y if y!=num else x, arr) arr = [mult(arr,i) for i in arr] # O(n^2) time, O(n) space Create two more arrays. One array contains the products of the elements going upward. That is, B[0] = A[0], B[1] = A[0] * A[1], B[2] = B[1] * A[2], and so on. The other array contains the products of the elements going down. That is, C[n] = A[n], C[n-1] = A[n] * A[n-1], and so on. Now A[i] is simply B[i-1] * C[i+1]. Show More Responses def without(numbers): lognums = [math.log10(n) for n in numbers] sumlogs = sum(lognums) return [math.pow(10, sumlogs-l) for l in lognums] Here are my 2 cents to do this in memory without creating temporary arrays. The simple solution , if division was allowed, was multiple all the elements of the array i.e. tolal = A[0]*A[1]]*....*A[n-1] now take a loop of array and update element i with A[i] = toal/A[i] Since division is not allowed we have to simulate it. If we say X*Y = Z, it means if X is added Y times it is equal to Z e.g. 2*3 = 6, which also means 2+2+2 = 6. This can be used in reverse to find how mach times X is added to get Z. Here is my C solution, which take pointer to array head A[0] and size of array as input void ArrayMult(int *A, int size) { int total= 1; for(int i=0; i< size; ++i) total *= A[i]; for(int i=0; i< size; ++i) { int temp = total; int cnt = 0; while(temp) { temp -=A[i]; cnt++; } A[i] = cnt; } } Speed in O(n) and space is O(1) #include #define NUM 10 int main() { int i, j = 0; long int val = 1; long A[NUM] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; // Store results in this so results do not interfere with multiplications long prod[NUM]; while(j < NUM) { for(i = 0; i < NUM; i++) { if(j != i) { val *= A[i]; } } prod[j] = val; i = 0; val = 1; j++; } for(i = 0; i < NUM; i++) printf("prod[%d]=%d\n", i, prod[i]); return 0; } void fill_array ( int* array, size ) { int i; int t1,t2; t1 = array[0]; array[0] = prod(1, size, array ); for(i = 1; i < size; i++){ t2 = array[i]; array[i] = prod(i, array.size(), array)*t1; t1 *= t2; } int prod(start, end, array){ int i; int val(1); for(i = start; i < end; i++ ) val *= array[i]; return val; } One or more comments have been removed. |
Senior Software Engineer at Google was asked...
What sort would you use if you required tight max time bounds and wanted highly regular performance. 6 AnswersVector sort. Guaranteed to be O(n log n) performance. No better, no worse. That is so say, a "Balanced Tree Sort" is guaranteed to be O(n log n) always. Show More Responses Merge sort and heapsort are always guaranteed to be n*log(n). Quicksort is usually faster on the average but can be as bad as O(n^2), although with very low probability. Heapsort also does it sorting in-place, without needing an extra buffer, like mergesort. Lastly, heapsort is much easier to implement and understand than balancing trees mentioned by earlier posts. for something like this you generally want bubble sort or insertion sort. It's not about being fast it's about being consistent. Make it do exactly the same thing every time. Use a sorting network. There's some precomputation time, but runtime will be very consistent (the only variability is branch prediction performance) |
Tell me how you would scale a social media software platform? 3 AnswersI didn't have a good answer for this one. Its such a tricky question. I guess its by the analytic we use to know the page views and all.. Try to define "scale", ask for clarifications. Are we trying to scale to more users or to more ad providers? Are there any current bottlenecks? What is the goal here? How about we improve the experience by providing more relevant ads? etc... |
Senior Project Manager at EchoStar was asked...
Suppose you are working on a project with an original scope of a few months and you are told that you instead now have a few days -- how would you handle it? 5 AnswersAssuming the scope reduction is feasible, I would toss out everything except the highest priority deliverable. As long as the project is on track and I am in day >55, I'd say; " No issue." I would say evaluate the overall impacts and risks then communicate it with your sponsor (customer). Let he/she to decide then document it. Show More Responses I'd ask 'why'? Something radically changed since the last time this was discussed. Understanding what it was that changed is critical to determining the best course of action. Adding manpower, reducing scope, working 24/7, or pushing back might all be reasonable (or horrible) solutions. By first understanding the (new) need, you can then develop a solution. Depends: Who is telling me this? What stage is the project in on the project life cycle? Review these factors in light of the impacts, set change management process and communication plan. There are no cookie cutter approached - each project is unique. |
Senior Data Scientist at Glassdoor was asked...
How would you test if survey responses were filled at random by certain individuals, as opposed to truthful selections? 5 AnswersI would design the test in a way that certain information is asked two different ways. if two answers disagree with each other I would seriously doubt the validity of the answers. This is a very basic psychometrics question. Calculate Cronbach's alpha for the survey items. If it is low (below .5), it is very likely that the questions were answered at random. We need to find the histograms of the questions in the survey to see the distribution of each answer in each question. All question histograms will likely follow the normal distribution if they are truthful selection. If one response with more than of half of total answers being located outside of 95% confidential interval in each histogram, the response will be categorized as random fall out of mean plus tw Show More Responses Similar to Cronbach’s alpha, calculate corrected item-total correlations. Since the item is part of the total, you will need to remove it from each estimate to correct for this. Otherwise, you will get inflated estimates. Drop items with very low item-total correlations (either 1.5. Good luck. One or more comments have been removed. |
What would you do if senior management demanded delivery of software in an impossible deadline? 3 AnswersGive them the choice of reduced scope, more resources, or changed dates. They can only pick 2. It is possible to keep scope, resources & timeline (dates) unchanged, but compromise on quality. This will impact team retention, especially the stronger engineers on the team, over the longer run. The leadership team must understand the consequences. The feasibility which could lead to happen this type of situations is due to critical business needs. It means senior management would be actively involved and here agile framework will come into play. Delivering the workable product and then further developing the solution would be the best possible shot for win win situation. |
Senior Java Developer at Contextweb was asked...
How would you scale access to a system like Twitter 3 AnswersThere's probably no real correct answer, though the solutions go from common to esoteric in a pretty normal progression: caching, shared-cache like memcache, optimize usage, prefetch, then get creative. This is more about testing reasoning and how far you'll go to solve a problem. I was thinking geographically distributed servers. Cf |
Senior Data Scientist at Netflix was asked...
How would you build and test a metric to compare two user's ranked lists of movie/tv show preferences? 3 AnswersProbably incorrectly. 1) Develop a list of shows/movies that are representative of different taste categries (more on this later) 2) Obtain ranking of the items in the list from 2 users 3) Use Spearman's rho (or other test that works with rankings) to assess dependence/conguence between the 2 people's rankings. * To find shows/movies to include in the measurement instrument, maybe do cluster analysis on large number of viewer's viewing habits. Look at the mean average precision of the movies that the users watch out of the rankings. So if out of 10 recommended movies one user prefers the third and the other user prefers the sixth, the recommendation engine of the user who preferred the third would be better. InterviewQuery.com has it more in depth of an answer. |
See Interview Questions for Similar Jobs
- Product Manager
- Director
- Senior Manager
- Software Engineer
- Project Manager
- Senior Software Engineer
- Program Manager
- Manager
- Vice President
- Senior Program Manager
- Senior Director
- Marketing Manager
- Business Analyst
- Product Marketing Manager
- Consultant
- Associate Product Manager
- Associate
- Senior Consultant
- Senior Project Manager
- Senior Product Marketing Manager