CrazyEngineers
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • ISHAN TOPRE

    MemberOct 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?
    Are you sure? This action cannot be undone.
    Cancel
  • pinki_seetu

    MemberOct 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:
    1. 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.
    2. Raise the window. Very frequent and critical
    3. Resize the top window Frequent operation.
    4. Add a new window. Infrequent operation
    5. Remove a window. Infrequent operation
    Write the complexity of implementing operation a-e. Also explain the algo for operations a and b.

    this is microsoft question
    Are you sure? This action cannot be undone.
    Cancel
  • rahul69

    MemberOct 26, 2013

    pinki_seetu
    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:
    1. 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.
    2. Raise the window. Very frequent and critical
    3. Resize the top window Frequent operation.
    4. Add a new window. Infrequent operation
    5. Remove a window. Infrequent operation
    Write the complexity of implementing operation a-e. Also explain the algo for operations a and b.

    this is microsoft question
    I am giving u directions, so that u can solve this question yourself 😒
    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.
    😀.
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register