Nvidia
Nvidia
1. A room has 100 bulbs and 100 switches. 100 people go in one by one. 1st person
goes in and toggles none of the switches. 2nd person goes in and toggles all switches
other than the multiples of 2 (2,4,6..). 3rd person goes in and toggles all switches
other than the multiples of 3 ( 3,6,9..), and so on ( till 100th person toggling all
switches except 100th switch).
Once this process is finished, which bulbs are in ‘on’ state (assuming all bulbs
to be in ‘off’ state initially)?
3. An escalator has 100 steps. A kid going up also climbs 15 steps during the upward
motion. Another kid runs up in the downward elevator and reaches top along with the
first kid. How many steps are covered by second kid?
4. Write the minimal expression (code line) for a > b, where a= a0a1a2 and
b=b0b1b2. Assuming a and b are three digit numbers and are not equal.
5. Find an FSM (Finite State Automata) for any number which is divisible by 3.
6. Write a C++ function to check if two strings (all alphabets are in uppercase in
both strings) of equal sizes are mirror images of each other. (e.g. HAM and MAH are
mirror images of each other)
7.
The given circuit is assembled using only NAND gates. Draw a truth table, including
the intermediate points E, F and G, and state which single gate the output H
represents.
8. The hit to miss ratio of a CPU cache is 19:1. It takes 0.5 millisecond for a single
access of cache and 0.25 second for main memory access.
a) Find the average time taken for single data access.
b) What is the probability that implementing CPU cache is inefficient as compared to
using only main memory?
h) A function may have any number of return statements each returning different
values. (True/False)