darpanshah08
BAN USER
- 0of 0 votes
AnswerThe last one, he gave me one single line : " amazon is a . blah blah blah.." then he told me to compress it.
- darpanshah08 in United States for Amazon Prime
I used the indexes,occurences. But then he told me to use other way. after he gave me some hint, I was able to find out the palindrome pattern. we can use that too to compress the string.
Then he told me to write algorithm for palindrome, I wrote with O(n/2) complexity. then he told me to find any longest palindrome from the string. I need to use my palindrome algorithm too.
I tried a lot and then I came up with O(n^3) solutions. he pushed me to try to reduce with O(n^2) solution. However, I could not come up with that solution.| Report Duplicate | Flag | PURGE
US Software Engineer - 0of 0 votes
AnswersBased on the above question, he asked me that I have a very large file with all the details of product, like id, name, qty_sold, date. then he told me to find out the products that will have a better chances to be sold out next week. I have to find out the products that will sell more in next week.
- darpanshah08 in United States for Amazon Prime| Report Duplicate | Flag | PURGE
US Software Engineer - 0of 0 votes
AnswersSecond round was intersting: that guy gave me a situation, like I have a file with columns product_id, qty, date, product_name.
- darpanshah08 in United States for Amazon Prime
I need to sort them based on qty that has been sold out on day. For example, this product has been sold highest on this day.| Report Duplicate | Flag | PURGE
US Software Engineer Algorithm Hash Table - 0of 0 votes
AnswersIn my First round, very first question that guy asked me is to generate an algorithm to check whether string is palindrome or not. After that in the same round, he asked me to create a class that duplicates the Stack property.
First, String Palindrome:
Used stringbuilder, i.e.StringBuilder sb = new StringBuilder(str); System.out.println(sb.reverse());
then he told me to not to use StringBuilder, so i convert string into the char array, then apply loop till half the size of the string. and check character by character. He said ok. "looks good".
- darpanshah08 in United States for Amazon Prime| Report Duplicate | Flag | PURGE
US Software Engineer Stacks String Manipulation