Friday 30 August 2013

candidate number 2 - Round 2 amazon placment august 2013

Amazon placement Round 2 August 2013

Student 2 - Round 2




Q1. A string of length n and an integer m was given, give an algo. to rotate the string counter clockwise by m. Give all the check conditions for input m. Then the interviewer asked to write a code for the same with a strict guideline that there should not be any mistake in the code . Q2 : heap, min and max heap, insertion and deletion in a heap. Time complexity of inserting n elements in a heap.

Student 3 - Round 2 of amazon interview

Student 3 - Round 2

5 comments:

  1. Suppose the given string is "ABCDE" and lets say m=2. Here n=5=strlen.The algo goes like this :
    -- reverse string from 0->(m-1) position BACDE
    -- reverse string from m->(n-1) position BAEDC
    -- reverse string from 0->(n-1) position CDEAB , the required O/P.

    ReplyDelete
  2. For Q2, just to make it clear, only DeleteMax or DeleteMin is supported by standard heaps which takes log(n) time.To be specific any random deletion of node is not practical with heap DS.
    Insertion takes log(n) as well.

    ReplyDelete
  3. please send me the study material for AMAZON on campus placement

    aayushrangwala@gmail.com

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. please send me the material regarding Amazon placement.My mail id is shivaanigovindarajan@gmail.com

    ReplyDelete