Amazon Interview Question for Software Engineer in Tests Software Engineer / Developers






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

actually hex A is different from character 'A'.
0xA = 10 = '\n'
'A' = 41 = 0x29

- aj April 16, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I did not follow the question - is this equivalent to converting hexadecimal given as a string into a decimal integer ?

- acoder September 22, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

If I understand correctly, the question is:
If you have to print the character out in ASCII format, what should you ask yourself first?

That question should be: Is the given string (that is in Hex) is already encoded in ASCII or not?
If each character uses 1 byte, it is very likely that it is already in ASCII.

- isara.a September 24, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Hey isara..

damn true what u said...goood one..!!

- Anonymous September 27, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Hexadecimal has characters are from 0-9 and A-F. all these characters can be represented in 1 byte. So all hexadecimal numbers are already in ascii format.

Is there anything wrong here?

- dce.sunil September 27, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I see whats going on with this question- I looked up the meaning of ASCII- its an encoding format that uses 7 bits - it can be represented by binary, decimal, hexadecimal etc. So if we are given a hex string, then as isara hinted, the question would be what is the input format ? I guess that depends on the Hardware/system that is used to feed the input!

Initially I got the impression that what was being asked was something like atoi().

- acoder September 27, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

but hex numbers take 4 bits while unsigned ascii takes 8 bits

//code
while(*str)
{
printf("%c", (*str<<4)|*(str+1));
str++;
if(str)
str++;
else break;
}

- mail2vcp@gmail.com September 30, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Ex: AE0F912EA
then AE 0F 91 2E and A are ascii characters

- mail2vcp@gmail.com September 30, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Isn't Hex A = dec 10 = ascii '\n'?
ascii 'A' is Hex 41?
Please can u explain?

- Anym October 17, 2008 | 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