Amazon Interview Report
- 0of 0 votes
AnswersA string representation of a n-ary tree is given in the following format
- Prashi December 20, 2008
(a(b(v)(w))(c(k(d)))(e))
This string can be interpreted as root followed by all its children enclosed in (). Every children is then represented in the same way as root.
Eg: In above string a is root. b,c,e are its children, while v and w are b's children and k is c's child which in turn is parent of d.
I was supposed to write a code for converting the string into the corresponding n-ary tree.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswerQuestion involved indexing from DBMS.
- Prashi December 20, 2008
Given a set of attributes how will you improve the retrieval time for a query involving these attributes.
-> You are allowed to change the physical storage
-> You can create index files
-> You need to minimize block accesses and memory used.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Database - 0of 0 votes
AnswersGiven a n-ary tree of resources arranged hierarchically. A process needs to lock a resource node in order to use it. But,
- Prashi December 20, 2008
A node cannot be locked if any of its descendant or ancestor is locked.
I was supposed to
-> write the structure of node
-> write codes for
-> islock()- returns true if a given node is locked and false if it is not
-> lock()- locks the given node if possible and updates lock information
-> unlock()- unlocks the node and updates information.
Codes should be :
Islock –O(1)
Lock()- O(log n)
unLock()- O(log n)| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersThere are two rabbits: Rabit A and Rabit B. Both of them run a 100 m race . When rabbit A finishes the race rabbit B is at 90 m mark. They run at constant speed. Without calculating time , speed or distance , by just analyzing the given data tell when A starts from 10 m behind the 0 m mark (110 m run for A) and B starts at 0 mark only , who wins and why ?
- Prashi December 20, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Brain Teasers - -1of 0 votes
AnswersA kidnaper wishes to write a ransom note using letters from a magazine article. You are given with the ransom note and magazine article find whether kidnaper can write a note using the article or not.
- Prashi December 20, 2008
I was supposed to write a bug free code for thin in O(n+m) time complexity, O(1) space complexity.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer String Manipulation Algorithm - 0of 0 votes
AnswersGiven two int arrays A and B containing keys of binary tree. Is it possible for both the array elements to form identical binary tree in any combination or permutation .State the conditions .
- Prashi December 20, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersWrite a code to check whether a number (int) is a palindrome or not. The code was supposed to be bug free and all exceptions handled. The code was supposed to return true if function worked properly and false if function created an error.
- Prashi December 20, 2008
Int IS_Palindrom (int num, int *p)
{
}
return value conveys state of the function and *p contains result of the function.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Coding - 0of 0 votes
AnswersThey asked about various storage class specifiers of C : static,register,extern
- Prashi December 20, 2008
Their scope and existence during a program execution.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer C - 0of 0 votes
AnswersGiven a string : abbbccddddeee
- Prashi December 20, 2008
Encode it to : ab3c2d4e3
Write a program to do so and also write test cases for the same.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer String Manipulation