Monday, December 26, 2016

DailyHunt Interview Experience

First Round (F2F)

1. Calculate angle between hour and minute hand in a clock.
http://www.geeksforgeeks.org/calculate-angle-hour-hand-minute-hand/

2. Given a binary representation of a number, find the longest contiguous sequence of 0s between 2 1.
For example , if binary representation of a number is 1000100, then answer should be 4.

If binary representation of a number is 1000, then it should return 0.

3. Difference between comparable and comparator.

4. What happens internally when we remove a key from HashMap.


Saturday, December 3, 2016

Microsoft Interview Experience

Online Coding Test 


1.  Given a boolean matrix mat[N][N] of size MXN, modify it such that if a matrix call mat[i][j] is 1, then make all cells of its row and column as 1.
http://www.geeksforgeeks.org/a-boolean-matrix-question/

2. Given a positive integer n, generate all possible unique ways to represent n as sum of positive integers.

3.  There is an array of strings. For example:
Victor, Veronica, Farah, Veronica, Farah, Veronica
Farah and Veronica occurs maximum no of times. As Veronica comes after Farah in alphabetical order, output should be Veronica.


F2F Round 1

1. Clone a linked list with next and random pointers

2. Generate 0 and 1 with 25% and 75% probability

3. Given an infinite stream of integers, find Kth largest element at any point of time.


F2F Round 2

1. Design an entry and exit system for a mall where at max n people can be there at one point of time inside mall

2. Given a matrix where each cell contains x no of gold coins and a constraint that you can only move right or down from top left corner to bottom right corner, find the maximum no of coins that you can collect. Write a code for the same.

F2F Round 3

1. Print all possible partition of a given string into dictionary words. (Variant of word break problem)





Thursday, October 6, 2016

Uber interview Questions

1. Telephonic Round

1) Design an expiry cache similar to redis cache.
http://blog.gainlo.co/index.php/2016/05/17/design-a-cache-system/

2) Add 1 to a linked list

A number is represented in linked list such that each digit corresponds to a node in linked list. Add 1 to it. For example 1999 is represented as (1->9->9->9) and adding 1 to it should change it to (2->0->0->0).
http://www.geeksforgeeks.org/add-1-number-represented-linked-list/

3) Given a array in which numbers are in the unsorted order, find if any triplet a, b , c  exist such that x < a+b+c < y.

For example, let's say array is:
0.5, 0.1, 1.1, 0.9, 12, 12, 98
Check whether any triplets exist where 1 < a+b+c < 2

Thursday, August 11, 2016

Design Level Questions

  1. Design twitter

2. Design a key-value store
http://blog.gainlo.co/index.php/2016/06/14/design-a-key-value-store-part-i/

3. Design a cache system
http://blog.gainlo.co/index.php/2016/05/17/design-a-cache-system/

4. Design hit counter
http://blog.gainlo.co/index.php/2016/09/12/dropbox-interview-design-hit-counter/

5. Design tiny url
http://n00tc0d3r.blogspot.in/

6. Design elevator system
http://thought-works.blogspot.in/2012/11/object-oriented-design-for-elevator-in.html

7. Design parking system

8. Design monitoring system.
Hint: Observer Pattern
https://www.careercup.com/question?id=5121055761891328

9. Design your own hash map

10.  Design restaurant reservation system.
https://www.careercup.com/question?id=5733795254763520

11. How Uber scales?
http://highscalability.com/blog/2015/9/14/how-uber-scales-their-real-time-market-platform.html

12. Design bookmyshow.com
https://www.careercup.com/question?id=6193420734300160

13. Design ATM
http://www.math-cs.gordon.edu/courses/cs211/ATMExample/

14. Design crossroad traffic signal system

// Facebook Interview Question
15. Design an instagram API which supports following feature:

  • Upload Photos
  • Follow/Unfollow
  • Get User Feed
// Google Interview Question
16.  Design a system to return an unique ID for each request. For most of requests, the ID value should increase as time goes, the system should handle 1000 requests per second at least.



Helpful links to refer for design questions:

https://www.interviewbit.com/

https://geekibuti.blogspot.in/