This is a verified interview question from Nvidia. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Nvidia Online Assessment SDE Role MCQS" covers key patterns like Arrays.
"Pattern : 26 MCQS + 2 DSA DSA Problem Q1: https://www.codinzhub.com/question/validate-binary-string-as-power-of-2 Q2:https://www.codinzhub.com/question/lexicographically-largest-special-binary-string ### MCQ 1 What will be the output of the following program? ```c static int a; printf("%d", ++a); return 0; ``` **Answer Options:** - 0 - Indeterminate value - 1 - Compiler error ### MCQ 2 Consider three processes p1, p2, p3 respectively with compute time bursts 2, 4 and 8 time units. All processes arrive at time zero. Consider the longest remaining time first (LRTF) scheduling algorithm. In LRTF ties are broken by giving priority to the process with the lowest process id. What is the average turn around time? **Answer Options:** - 11 units - 13 units - 14 units - 16 units ### MCQ 3 ```c void main() { char buff[] = "NVIDIA"; printf("%s", buff); } ``` **Answer Options:** - NVIDIA - `NVIDIA` - Compiler error - Runtime access violation ### MCQ 4 What is the output of the following program? ```c void main() { char str1[] = "Hello"; char str2[] = "World"; str1 = str2; printf("%s %s", str1, str2); } ``` **Answer Options:** - Compiler error - Hello World - World Hello - World World ### MCQ 5 ```cpp QMS<int> *qms = new QMS<int>(); qms->PutSampleData(0); cout << qms->GetSampleData(0.0); return 0; ``` **Answer Options:** - From float getdata - Will Throw an exception - Will run but not print anything - From int getdata ### MCQ 6 In the worst case, how many copy operations are required to insert an element into a sorted array of length $N$ that is not yet full? **Answer Options:** - $O(\log N)$ - $O(N)$ - $O(1)$ - $O(N^2)$ ### MCQ 7 What will be the output of the following program? ```c main() { unsigned int y = 2; int x = -2; if (x > y) printf("X is greater than Y"); else printf("Y is greater than X"); return 0; } ``` **Answer Options:** - X is greater than Y - Y is greater than X - Compiler error - None of the above ### MCQ 8 If a singly linked list is used to implement a queue, what is the best case time complexity for inserting an element into the queue (assuming it already has $N$ elements)? **Answer Options:** - $O(1)$ - $O(N)$ - $O(N^2)$ - None of the above ### MCQ 9 What is the output of the following program? ```c main() { unsigned char ch = 0; int count = 0; while (++ch < 255) count++; printf("%d", count); } ``` **Answer Options:** - 255 - 256 - 512 - no output (infinite loop) ### MCQ 10 If the page size is 4KB and logical address is of 22 bits then number of entries in the page table will be: **Answer Options:** - 1 K - 2 K - 3 K - 4 K ### MCQ 11 What operation does this function perform? ```c int MyFunction(int a, int b) { int k = 0; while (a - k * b >= b) ++k; return a - k * b; } ``` **Answer Options:** - Division - Modulo - Weighted Average - Multiplication ### MCQ 12 Given six distinct colors, in how many unique ways can a six faced cube be painted such that no two faces have the same color? **Answer Options:** - 120 - 720 - 180 - 30 ### MCQ 13 Rahul and Ram invests in a business in a ratio of 4:5. They donate 10% of total profit to charity. If Rahul's net profit is 10 lakhs, how much is the total profit? **Answer Options:** - 20 lakhs - 25 lakhs - 30 lakhs - 35 lakhs ### MCQ 14 ABC is a triangle with angle A equal to 90 degrees, and $BC = 25$. If the area of ABC is 84, find its perimeter. **Answer Options:** - 50 - 52 - 54 - 56 ### MCQ 15 Two men, A and B, are standing 100 km away from each other. At a certain time, A starts running towards B at 20 kmph. At the same time, B starts running away from A at 10 kmph. At the same time, a Bee sitting on the shoulder of A starts flying at the speed of 50 kmph towards B. It touches B, and starts flying back towards A. It touches A and starts flying back towards B. It does this until both A and B meet. How much is the distance traveled by the Bee? **Answer Options:** - 500 km - 475 km - 450 km ### MCQ 16 A shopkeeper purchased a few apples at 10 rupees per apple. He sells half the apples at 14 rupees per apple. The remaining apples start to decay, so he sells them at only 8 rupees per apple. What is his profit/loss percentage in the overall transaction? **Answer Options:** - 10% profit - 5% profit - No profit; No loss - 5% loss ### MCQ 17 5 boys and 8 girls can complete a job in 4 days. 10 boys and 6 girls can complete the same job in 3 days. How many girls need to work with 5 boys to complete the same job in 2 days? **Answer Options:** - 3 - 4 - 4.5 - 9 ### MCQ 18 The number of different (unique, but need not make sense) words that can be formed from the letters of the word COCOONS is: **Answer Options:** - 15 - 30 - 60 - 120 ### MCQ 19 3 men can dig a trench 3 feet deep working for 3 hours a day in 3 days. How deep a trench can 6 men dig working for 6 hours a day for 6 days? **Answer Options:** - 3 - 12 - 24 - 48 ### MCQ 20 A person runs from A to B at 8 kmph and walks back from B to A at 2 kmph. The average speed of the person is: **Answer Options:** - 5 - 4 - 3.2 - 3 ### MCQ 21 There is a small virus in a large jar. The virus doubles itself every minute. The virus fills up the jar in 12 minutes. How many minutes did it take for the virus to fill up a quarter of the jar? **Answer Options:** - 3 - 10 - 11 - None of the above ### MCQ 22 3 couples need to be seated around a circular table such that no two persons of the same gender sit next to each other and spouses do not sit next to each other. In how many different configurations is this possible? **Answer Options:** - 2 - 4 - 6 - 8 ### MCQ 23 The sum of two numbers is 30. The sum of the squares of the two numbers is 458. The square of the difference between the two numbers is: **Answer Options:** - 4 - 15 - 16 - 24 ### MCQ 24 There are 256 Tennis players, find out minimum number matches required to get the second best player among them. Condition is that if player A beats B and B beats C then A beats C. **Answer Options:** - 262 - 265 - 255 - 256 ### MCQ 25 A bag contains 25 coffee and 25 caramel flavoured chocolates. Alice picks one random chocolate and eats it. After that, Bob also picks one random chocolate and eats it. What is the probability that at least one of them ate a caramel chocolate? **Answer Options:** - 75/100 - 74/99 - 37/50 - 37/49 ### MCQ 26 There are two jars of the same size that are both half full. The first jar has 10% water and 90% milk. The second jar has 10% milk and 90% water. A person transfers half the contents of the first jar to the second jar. After mixing the contents of the second jar, the person transfers half the contents of the second jar to the first jar. What is the percentage of milk in the first jar? **Answer Options:** - 58 - 64 - 72 - 90"
Join thousands of developers practicing for Nvidia.