Thursday, August 19, 2010

Amazon 1st round questions

here is the
Amazon 1st round questions...

Part A
-------

1.int foo(int n)
{
if(n<=0) return -1;
else
print n;
n=n/2;
return foo(n);
}

find the complexity ? Ans: O(log n)

2.What is the Big 'O' notation for (n+10)*(n-6) ?

Ans : O(n^2)

3.which is better function A or c? under what circumstances?

void A()
{
while(testandset(lock));
}

void c()
{
while(testandset(lock))
{
try{
sleep(x);
}
catch(Exception e){ }
}
}

testandset function is....

boolean testandset(lock)
{
if(lock) return false;
lock = Locketd;
return true;
}

4. Execution time of the tasks are 4,4,7,8,9 . by what way these task should execute so that average time shoubld be least and write the schedule.

5. write the query to find second highest mark.
Student(rollnumber int , name varchar,marks int)

6. find the minimum of x,y without using branching statements?
a)(y-x)-(x-y)<<1
b) x>y?x:y
c) y+((x-y)&-(x d)x^((x^y)&-(x
7.write the grammar for the expression 1+2*3(4+5)*(6*7)

8.another TOC question to find what the given transition diagram does?

9.given a java program(binary search program) , debug the program.

10. given a number, find whether it is a power of 2?

a)num & (num-1)
b)num && (num & (num-1))
c)num && (num & num-1)
d)num && (num-1)

11. given a code:
int hashcode()
{
return 0;
}
find complexity ?
12. x % y ---> leaves remainder 24
2x % y ---> leaves remainder 11
what is the value of y?


Part B
------

1. given an array {5,3,6,2,7,1,4}. sort the odd position elements into descending order and even position elements into ascending order.

O/P : { 7,6,5,4,1,2,3}

2. given two numbers.
reverse 2 numbers.
add those two reversed numbers.

Input : 31000
2500

Output : 65

In placements, every company 's first round ll be very basic. clearing the first round is the big hurdle. it contains the questions of all field.

3 comments:

  1. Hi Kannan,

    Amazon 1st round questions being contrived to exist for many projects simply so it can be run will be the first to hit the wall, but those projects where the functions to make existing transactions cheaper in real world applications will find the elusive `real-world demand.
    A few months ago, I shut everything down in AWS. I didn't close the account because I wanted to spin some things back up down the road when I had the time. A month later, I got a final bill for services that had been running mid-month when I closed them. Being somewhat Type A, I went into the Billing Console to review the charges and confirm what they were. Should have been the end of the story.

    When an instance is stopped, it performs a normal shutdown and then transitions to a paused state. When an instance is terminated, it performs a normal shutdown, then the attached Amazon EBS volumes are deleted unless the volume’s deleteOnTermination attribute is set to false.


    I read multiple articles and watched many videos about how to use this tool - and was still confused! Your instructions were easy to understand and made the process simple.

    Cheers,
    Kevin

    ReplyDelete
  2. Hey Brother,

    Such vivid info on the Amazon 1st round questions Flabbergasted! Thank you for making the read a smooth sail!

    I have just received an email that says, AWS Training USA "We're writing to provide you with an electronic invoice for your use of AWS services for the billing period April 1 - April 30, 2018. Additional information regarding your bill, individual service charge details, and your account history are available on the Billing & Cost Management Page."

    Thanks a lot. This was a perfect step-by-step guide. Don’t think it could have been done better.

    Thank you
    Irene Hynes

    ReplyDelete
  3. KiaOra,


    A spot on observation on what probably is “the” underlying details of the Amazon 1st round questions.Too many people don’t even think about wherever there will be actual demand and more importantly what happens if this demand comes later (or maybe a lot later) than they expect AWS Tutorial



    I would like to post an announcement for anyone who needs server resources at AWS. Basically, I have 600$ worth of AWS Credit and I am looking for people who would like to use these credits since I don't need them. The only issue here is that they expire at April 30th.




    It was cool to see your article pop up in my google search for the process yesterday. Great Guide.
    Keep up the good work!


    Shukran,
    Ajeeth

    ReplyDelete