Round 0 –
Second max element in BST
Sort an array of integers such that –
– All odd numbers are in left side and sorted in increasing order.
– all even numbers are sorted in decreasing order and start where odd numbers end.
I/P – 2, 3, 4, 5, 8 , 10, 12, 11
O/P – 3, 5, 11, 12, 10, 8, 4, 2
I used quick sort partition logic to separate odd and even numbers and then ran quick sort on both halves.
Round 1 –
Assume an RAM of size 1024 bytes. There are multiple processes running on the system. Your application will get this information –
(Thread Id, Memory Block, time, R/W) – which essentially tells that the thread T was using memory block M at time t and operation could be read or write.
Memory conflict is defined as –
– Let x be standard unit of time measurement.
– Multiple read operations at the same location are not cause of conflict.
– One write operation between x+5 to x-5 to location M, will be cause of conflict for a thread accessing location M at time x.
– Example – If thread T1 accessed memory location M at time x+1 and if a thread T2 accesses location M before time x+6 then T1 and T2 are candidate of conflict given one of then do write operation.
You are given with the list of threads accessing memory locations, you have to find conflicts.
(1, 512, 1, R)
(2, 432, 2, W)
(3, 512, 3, R)
(4, 932, 4, R)
(5, 512, 5, W)
(6, 932, 6, R)
(7, 835, 7, R)
(8, 432, 8, R)
Thread 1 & 3 conflicts with thread 5
All other operations are safe.
Level order traversal ->
Round 3 –
> My solution was mutation of this – https://www.geeksforgeeks.org/mobile-numeric-keypad-problem/
Round 4 –
3D boggle solver and 3D cross word solver.
Design data structure to store and give a solution.
If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to firstname.lastname@example.org. 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.