## NVIDIA Interview Questions

- 2of 2 votes
Write a function in C to create a new BST which is the mirror image of a given tree.

- 1of 1 vote
Consider the statement

result = a ? b : c;

Implement the above statement without using any conditional statements.

- 0of 0 votes
Write a multi threaded C code with one thread printing all even numbers and the other all odd numbers. The output should always be in sequence

ie. 0,1,2,3,4....etc

- 0of 0 votes
Write a piece of code to find out if the system is x86 architecure of Sparc

- 0of 0 votes
Write a function in C to create a new BST which is the mirror image of a given tree.

- 0of 0 votes
Write a multi threaded C code with one thread printing all even numbers and the other all odd numbers. The output should always be in sequence

ie. 0,1,2,3,4....etc

- 0of 0 votes
Consider the statement

result = a ? b : c;

Implement the above statement without using any conditional statments.

- 0of 0 votes
Write a piece of code to find out if the system is x86 architecture of Sparc

- 0of 0 votes
Write multi threaded code in C so that one thread prints all even numbers and other all odd numbers with the output always in sequence ie. 0,1,2,3...etc

- 0of 0 votes
Write a piece of code to find out if a system is x86 architecture or Sparc?

- 0of 0 votes
Implement a ternary operator without using any condition statements. For example

result = a ? b : c;

Implement the above statement without using ternary or any conditional statements so that result gets b or c depending on value of a. Assume a is either 1 or 0 for simplicity.

- 0of 0 votes
In Linux, we use virtual address.So each process will think it has 4 GB

memory space even if the real memory is only 2GB. Now suppose we do not have

MMU and programmer use real physical address in their program. We only have

small size of physical memory. How can we design the system?

- 0of 0 votes
We run two video game benchmarks on our new designed SOC. The two

benchmarks have the same instruction set. The benchmark with higher power

consumption always work well while the other one always get stuck. What can

be the problems?

- 0of 0 votes
In the new mobile phone, we can either choose to use a 1GHz solo core or

500MHz duo core processor. What tradeoffs should we consider?

- 0of 0 votes
This is a hardware design problem. I can not figure it out. Suppose we have 2 pipelined hardware multipliers(or something). One is working at 1GHz with 2 operations executed in parallel at the same time. The other one is at 500GHz with 4 operations. Suppose we have transistors of 3 types(low leaky(30%),middle leaky(50%) and high leaky(70%)) and here leaky means leakage power of the transistor. Which multiplier should we use considering the 3 types of transistors.

- 0of 0 votes
How will you implement run-time polymorphism in C? There are two structs. There is a common function receiving only one argument(only one). The function should accept both base struct and derived struct objects and do corresponding actions. i.e if base struct object is passed, do base struct's task and vice versa

- 0of 0 votes
The interviewer asked the following question.

`char *s = "Hello"; printf("%s",s); printf(s)`

The second print statement crashes sometimes. Why

- 0of 0 votes
Given an int, write code to return the number of bits that are 1 in O(m) time, where m is the number of bits that are 1.

- 0of 0 votes
Create the mirror image of a binary tree.

- 0of 0 votes
For a given US based phone number, write a function to return all possible alphanumberic words that can be formed with that number, based on the keypad of a standard phone.

For example, one possible value for 1-800-623-6537 could be 1-800-MCDNLDS

- 0of 0 votes
Given set of N threads generate sum of all numbers in an array of known size M

- 0of 2 votes
What is high dynamic range rendering and why is it important for realistic rendering?

- 1of 1 vote
Write a function to generate a second array of numbers containing running average of N elements from the original array

So for instance if the original array is,

2,6,4,2,3 and N=3

result = 2,4,3,4,3

you can assume the corner elements can be filled with original elements where there are not enough elements to take avg of N elements

- 2of 2 votes
You have written a memory manager and after using it your coworker complains that he is facing severe issues of fragmentation. What could be the reason(s) and how can you fix it

- 0of 0 votes
What is mip-maps and why are they used

- 0of 0 votes
Why we use 4X4 matrix for representing and calculations in transformation of 3D points when that can be done only with 3X3 matrix.

(the concept of homogenization of matrices and how they help including translation operation)

- 0of 0 votes
What the different shaders(vetex, geomtery, pixel) describe their roles and the order in which they are executed in graphics pipeline

- 2of 2 votes
given y bytes and you can transfer only x bytes at once..give a mathematical expression having only + - / * which gives the number of iterations to copy y bytes. ( dont try giving modulo operator answers )

- 1of 1 vote
Sequence of steps that happen in CPU, cache, TLB, VM, HDD leading to execution of “x = 7” which isn’t present in cache or sysmem nor translation in TLB. Also specify if any intrs, exceptions or faults are generated.

- 0of 0 votes
Assuming you have three N bit unsigned integers a, b and c, what is the min number of bits you would need to store the result of a * b + c?