NVIDIA Interview Question for Software Engineer / Developers

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

Algo:-

1. convert number in to hex.
2. take every number of hex convert it into ASCII
3. use putchar to print.

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

``````char table[16] = { '0', '1', '2','3','4','5','6','7','8','9','A','B','C','D', 'E','F' };
void printhex(int input)
{
int index = input%16;
input/=16;
if(input) printhex(input);
putchar(table[index]);
}``````

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

unsigned char hextbl[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};

void printhex(unsigned int v)
{
int i;
int start = 0;
for (i=7;i>0;i--)
{
unsigned int p = (0xF<<(i*4)) & v;
if (p)
{
printf("%c", hextbl[p>>(i*4)]);
start = 1;
}
else
{
if (start) printf("0");
else continue;
}
}
printf("%c", hextbl[p & 0xF]);
}

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.

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.

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.

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.