Friday, July 5, 2024
HomeData ModellingDynamic ProgrammingMicrosoft Interview Experience | Set 53

Microsoft Interview Experience | Set 53

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.
Eg –
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.

Example –
(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)

O/P –
Thread 1 & 3 conflicts with thread 5
All other operations are safe.

Round 2 –
https://www.neveropen.co.za/turn-an-image-by-90-degree/

Level order traversal ->
Using queue
Using recursion

Round 3 –
http://stackoverflow.com/questions/746082/how-to-find-list-of-possible-words-from-a-letter-matrix-boggle-solver
> My solution was mutation of this – https://www.neveropen.co.za/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 neveropen and would like to contribute, you can also write an article and mail your article to review-team@neveropen.co.za. See your article appearing on the neveropen main page and help other Geeks.

Feeling lost in the world of random DSA topics, wasting time without progress? It’s time for a change! Join our DSA course, where we’ll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 neveropen!

Dominic Rubhabha Wardslaus
Dominic Rubhabha Wardslaushttps://neveropen.dev
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments