Amazon Interview Question for Software Engineer / Developers






Comment hidden because of low score. Click to expand.
0
of 0 vote

geekygospel.wordpress.com/2008/06/12/interesting-cs-interview-questions-2/

- Erik May 17, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Lock the node exclusively and then lock its proper ancestors non-exclusively in ascending order.

- Anonymous May 17, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Bool findelement() rcursively searches and return true if element found under the node
Bool findlocked() recursively checks if anything is locked in this tree

Bool Lock(Node* root, Node* element)
{
If (!findElement(root))
Return false;
Else If(root.isLocked())
{
return false;
}
Else
{
If (root == element)
{
If(findLocked(element)) return false;
Else
{
Element.lockElement(); // whatever is needed to actually lock that element
return true;
}
}
Else
{
Return (lock(root->l, element) || lock(root->r, element));
}
}
If (findElement(root->l, element)!= null )
}

- Rohit July 11, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Maintain tree like with argumented information which stores the information whether the node is locked or not ,while searching for a node in the given tree in recursive way if a node is locked , traverse back and update all the ancestors are locked. This can be done in log n time i think.

- k.krishnakarthik July 29, 2010 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More