Couple of weeks back i had onsite interview in Google. I thought to share my experience with you.
- Find the largest continuous sequence present in the given array.
o/p 1 2 3 4
- Find an element in the given matrix. Matrix is sorted in row as well column-wise.
complexity constraint O(n).
- Given an array of size N+1. Array contains the elements from domain 1 to N.
Find the first repeated number in O(N) time complexity as well as O(1) Space complexity.
- Describe the algorithm to generate the power set of a given set. write the code also.
- Describe any two Design Patterns.
- Describe virtual function.
- Given a binary matrix of M*N . find the K*K sub matrix which has maximum number of 1's.
- Expected value of reassigning the min variable in following code.
- Discuss Master Theorem.
- Given 2n points on a circle.find the number of ways to draw n non intersecting chords.