There is an array A[N] of N numbers. You have to compose an array Output[N] such that Output[i] will be equal to multiplication of all the elements of A[N] except A[i]. For example Output[0] will be multiplication of A[1] to A[N-1] and Output[1] will be multiplication of A[0] and from A[2] to A[N-1].
Solve it without division operator and in O(n).
You have a list of numbers X1, X2, X3, ... Xn Populate the list Y with numbers Y1, Y2, Y3,...Yn, where Yi is the product of Y1 * Y2 * .. Y(i-1) * Y(i+1) * Y(i+2)...Yn What if you were not allowed to use division operator? Can you still compute the results in O(n * log n)? How about O(n)?
Mr. X meet Mr. Y during an early morning walk.
Mr Y asks the age of Mr. X\'s children and Mr. X is a math professor so gives Mr Y a problem to solve.
Mr X says
-> I have 3 children
-> The product of their ages is 36
-> The sum of their age is equal to the number of houses in my street.
-> And my first daughter has blue eyes.
Using these clues Mr Y was able to say the ages of the 3 children.
You are given a bunch of lines(non-parallel), and they intersect each other(thereby forming multiple quadrilaterals(A polygon having four sides)). Given this, how many colors are needed to color the quadrilaterals, such that there are no 2 quadrilaterals, sharing a common edge, having the same color? why?
A couple invites n-1 other couples to dinner. Once everyone arrives, each person shakes hands with everyone he doesn't know. Then, the host asks everyone how many hands they shook, and each person replies with a different number. Assuming that everyone knows his or her own spouse, how many hands did the hostess shake?
If a 2-d matrix were to be represented in (a) row-major order and (b) column-major order, what would be the corresponding index given the indices of the 2-d matrix?