NVIDIA Interview Question for Software Engineer / Developers






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

Signed integer max 2^31, Unsigned 2^32. You are asking for trouble if unsigned number is big.

- Anonymous February 26, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Right, I understand that. But does this answer the question? I think he asked for something like casting. I.e. if we add signed and unsigned numbers, which will be cast to which?

- Lide February 26, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

6.3.1.3 Signed and unsigned integers.

I think i found it. You made me look, but this is a 2007 draft of C99. I still cannot find the grammar.

1 When a value with integer type is converted to another integer type other than _Bool, if the value can be represented by the new type, it is unchanged.
2 Otherwise, if the new type is unsigned, the value is converted by repeatedly adding or subtracting one more than the maximum value that can be represented in the new type until the value is in the range of the new type.49)
3 Otherwise, the new type is signed and the value cannot be represented in it; either the result is implementation-defined or an implementation-defined signal is raised.

- Anonymous February 26, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

integer promotion, it is called.

- Anonymous February 26, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

answer should be unsigned
unsigned integer + integer = unsigned integer.
check out this
#include<iostream.h>
#include<conio.h>

int main()
{

unsigned int a=10000;
int b=2147483647 ;
cout<<a+b;
getch();
return 0;
}

- rohit February 26, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Is it something like adding int value+float will always give int value ??

- priya June 07, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

implicit type conversion rules always promote the variable . Do keep in mind that few operations( binary operators ) are not acceptable between different type variable for example int^float can not happen it will not demote the type of float to int.

- Delpiero May 30, 2013 | Flag


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