1. Incoming stream of characters () defines an onion of depth 1, (()) of 2. Find all onions with their in an incoming stream of characters. Discuss complexity.
Stream can be (()) () )) ((( (
2. Biggest challenge faced / where you innovated?
i. Demonstrate High Level Design
3. Parking Lot Problem A, B , C lots with different car sizes. Efficient way of allocating available slot.
A: Maintain linked list of available slots. Complexity discussion.
1. Matrix of 1s and 0s. 1s are sorted in beginning of each row. Findan efficient way of finding the row with maximum 0s in it.
A: Find row which has lowest sum. Complexity discussion.
e.g. 1 1 1 0 0 0 1 1 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 0 0
2. How to find two sets(of size m,n) are dis-joint(have no elements common) efficiently
A: Use hash map. Complexity is O(n) in worst case.
Follow up Q: How are hash maps stored in memory?
If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course. In case you are prepared, test your skills using TCS, Wipro, Amazon and Microsoft Test Serieses.