danielpiedrahita
BAN USER- 0 Answers Interview at Amazon
Hi everyone
- danielpiedrahita September 20, 2013
8 weeks ago I got a phone call from the hiring manager and he wants to give me an offer, but because of my immigration status he is looking options like send me to other location and then after one year transfer me to Seattle. because there's not more H1B visas until next year.
I'm very worried because the last time I talk with him was almost 6 weeks, I send an email to follow up the situation. but I didn't receive a reply till now. It's this mean the withdraw the offer? am I still in the process? I don't know what to think? How long I have to wait to move on?| Flag | PURGE
Another Solution
public static string reverseWords(string str)
{
string[] tokens = str.Split(' ');
StringBuilder sb = new StringBuilder();
for (int i = tokens.Length - 1; i >= 0; i--)
{
sb.Append(tokens[i]);
if(i != 0)
sb.Append(" ");
}
return sb.ToString();
}
I Agree, I think we need a littler more information about it.
- danielpiedrahita February 07, 2012Correct me if I'm wrong but the problem never gonna choose HouseC, because take the same time that HouseB, and you make less profit!!
- danielpiedrahita January 30, 20122^128 = (approximately 340 undecillion or 3.4×1038) addresses
- danielpiedrahita January 28, 2012wrong!! from 101 - 111 there only 10 digits
- danielpiedrahita January 25, 2012yeahh I think the declaration needs to be char* buf = (char*) malloc(10 * sizeof(char));
- danielpiedrahita January 25, 2012I agree with all of you, Is impossible to find a number in a not sorted array.
If the interviewer as you and your solution is not as expected. you can as the interviewer if he/she can show you the right answer or how he/she will do it!! in that way you are gonna show you are interested in the right solution and you want to learn and improved your programming skills
@amitvyasg, yes both solutions are in nature the same!! I didn't see your solution when I was writing mine.
the stack can be implement with reverse linked list!! but I assume that I have access to basic data structures. but if I need to build some special structure your solution can be tailored better to used the same structure as a stack and result list.
All depends of what you can used or what you need to built
You are thinking both list has the same size!! and if you look and the second example you gonna see that can have a list with different sizes!! the solutions are wrong if you only think and sum all the numbers on each list!
My solution
1. traverse the nodes and store each node in a seperate stack for each list.
2. for each element from each stack, put the sum in a diferent stack if one of the stack is empty continue with the other one until you have both stacks empty
3. then remove each element from the stack and add to a Linked list using the AddElement totail.
@geeeks you are right I forget the +1 if no when the letter is A the result will be 0.
- danielpiedrahita January 23, 2012Wrong answer!!! for BAD the calculation is 2732 and the correct answer is 707.
I try with AB and the result is 53 and really is 28.
the correct answer to calculate the number is using the @abhishekatuw formula
to 6
a = 0, b = 1
a = 2, b = 2
a = 4, b = 3
to 7
a = 1, b = 1
a = 3, b = 2
a = 0, b = 3
those are the conditions to get 6 or 7
I think this could work
function int random() //random number from 1 - 7
{
int a = r(5);
int b = r(5);
int r = a + b; (number from 2 to 10)
r = r - 2; (max number 8)
if(r == 8) // because never gonna get number 1,
{
r = 1;
}
return r;
}
- danielpiedrahita January 09, 2013