Replies
Welcome, guest
Join CrazyEngineers to reply, ask questions, and participate in conversations.
CrazyEngineers powered by Jatra Community Platform
-
@ishan-nohePN • Oct 22, 2011
Hey, It is really surprising that these companies are coming to us. I could't believe that initially. What do you think could be the job profile offered by these people? -
@pinki-seetu-vqLhsl • Oct 26, 2013
hello any one tell me how to solve this problem
You have to design a desktop manager. There are n windows that can be open at the same time. For each window we are storing the 2 opposite corner coordinates and the z-index of the window. In case of overlapping windows, the window with a higher z-index comes above the second, and the window on the top has the highest z-index. Whenever a window needs to be brought onto the top, its z-index is allotted as max(z-index)+1.
Design data structure to present the above problem and to implement the following operations:
- Hit testing: You click at a point (x,y), choose all the windows in which this point lies and return the top most windows amongst the selected windows. Very frequent and critical.
- Raise the window. Very frequent and critical
- Resize the top window Frequent operation.
- Add a new window. Infrequent operation
- Remove a window. Infrequent operation
this is microsoft question -
@rahul69-97fAOs • Oct 26, 2013
I am giving u directions, so that u can solve this question yourself 😒pinki_seetuhello any one tell me how to solve this problem
You have to design a desktop manager. There are n windows that can be open at the same time. For each window we are storing the 2 opposite corner coordinates and the z-index of the window. In case of overlapping windows, the window with a higher z-index comes above the second, and the window on the top has the highest z-index. Whenever a window needs to be brought onto the top, its z-index is allotted as max(z-index)+1.
Design data structure to present the above problem and to implement the following operations:
- Hit testing: You click at a point (x,y), choose all the windows in which this point lies and return the top most windows amongst the selected windows. Very frequent and critical.
- Raise the window. Very frequent and critical
- Resize the top window Frequent operation.
- Add a new window. Infrequent operation
- Remove a window. Infrequent operation
this is microsoft question
The question is pretty straightforward.😀 The first thing u have to do is to decide upon the data structure for the given problem, for example u could use an array of objects as the data structure, but then, u also have to consider about the time complexity etc. and then decide which data structure is best.
Then u have to implement all operations one by one,
Those operations which are frequent and critical, should have less execution time and proper exception handling. The procedure u need to do is given in question itself,
After implementing operations u need to write complexity, so do explain time as well as space complexity of different operations that u do implement.
😀.