zahidbuet106
BAN USER- 1of 1 vote
AnswersSuppose we are detecting fraud cheques and we found the cheques with the following list of patterns are fraud:
- zahidbuet106 in United States
111122234455
1234
22334455
11111111
234567
etc.
Now if you have a new cheque and wan to detect fraud in O(1) time what data structure you want to use?| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersSuppose a customer buys items for $10 in a shop and the cashier swipe her card at a POS charging $10. Assume that the card has $100 balance before swiping. POS sends the $10 transaction to a machine A in the Amazon cloud. A calls a service to update transaction and card balance, and then sends acknowledgement back to the POS. But the ack got lost in the middle and POS sends another $10 transaction request. How would you make sure that the balance is $90, not $80. And how would you distinguish multiple try with two legitimate $10 transaction back to back.
- zahidbuet106 in United States
Hint: You can't use more than one transaction entry in Database and you don't have the rollback provision.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Database - 0of 0 votes
AnswersGiven a BST and a node, write the BST data structure and a method in Java
- zahidbuet106 in United States
Node findNode(Node n)
that will find the next node of n in the BST. For example, if the tree looks like:
7
/ \
5 11
/ \ /
4 6 9
/ \
2 15
Then,
findNode(2) = 4,
findNode(4) = 5,
findNode(5) = 6
findNode(6)=7
findNode(7)=9
findNode(9)=11
findNode(11)=15
Note that you are not given the root of the tree.
Hint: you may assume that you have parent pointer.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm
The tree doesn't look good. Here it is again
root: 7, left 5, right 11
5: left 4, right 6
4: left 2
11: left 9
9: right 15
Repmarilynarhea, Computer Scientist at ABC TECH SUPPORT
I live my life very happily by god grace and I am working as a Gaming machine servicer and my ...
Specifically, those are prefixes. So, you want to find any prefix that matches with the new cheque to detect fraud. Straight forward answer is to use a Trie.
- zahidbuet106 February 13, 2013