0% 67 Year1st Year2nd Year3rd Year4th YearStateAndhra PradeshArunachal PradeshAssamBiharChhattisgarhGoaGujaratHaryanaHimachal PradeshJharkhandKarnatakaKeralaMadhya PradeshMaharashtraManipurMeghalayaMizoramNagalandOdishaPunjabRajasthanSikkimTamil NaduTelanganaTripuraUttar PradeshUttarakhandWest Bengal 1 / 20 Category: ( C++ ) 1. What is the time complexity of std::map::find()? A) O(logn)O(log n)O(logn) B) O(n)O(n)O(n) C) O(logn)O(log n)O(logn) D) O(1)O(1)O(1) 2 / 20 Category: ( C++ ) 2. What is the result of this code? #include int main() { int x = 10, y = 20; std::swap(x, y); std::cout << x << " " << y; return 0; } A) Undefined behavior B) 20 10 C) 10 20 D) Compilation error 3 / 20 Category: ( C ) 3. What will be the output of following program? #include void main() { int colour = 2; switch (colour) { case 0: printf("Black"); case 1: printf("Red"); case 2: printf("Aqua"); case 3: printf("Green"); default: printf("Other"); } } A) AquaGreen B) Red C) Aqua D) AquaGreenOther 4 / 20 Category: ( C++ ) 4. What is the output of the following? #include int main() { for (int i = 0; i < 5; ++i) { if (i == 3) continue; std::cout << i; } return 0; } A) Compilation error B) 0124 C) 01234 D) 12345 5 / 20 Category: ( C++ ) 5. What is the value of x after the following code? int x = 5; x = x++ + ++x; A) 12 B) 10 C) Undefined behavior D) 11 6 / 20 Category: ( C ) 6. Which function is used to allocate memory in C? A) free B) realloc C) All of the above D) malloc 7 / 20 Category: ( C++ ) 7. Which C++ feature does the "Rule of Five" pertain to? A) Template metaprogramming B) Resource management and memory safety C) Compilation time D) Error handling 8 / 20 Category: (Java) 8. Which of the following is true about volatile keyword in Java? A) Guarantees atomicity for readmodifywrite operations. B) Guarantees visibility and ordering of changes. C) Provides exclusive lock on the variable. D) Prevents thread context switching. 9 / 20 Category: (Java) 9. In a hospital management system, the Patient class has methods like admit() and discharge(). These methods' signatures are the same in subclasses but have different implementations. What is this an example of? A) Static Polymorphism B) Encapsulation C) Runtime Polymorphism D) Composition 10 / 20 Category: (Java) 10. In a concurrent program, which ExecutorService method will block until all submitted tasks are complete? A) submit() B) invokeAll() C) shutdownNow() D) execute() 11 / 20 Category: (Java) 11. In a gaming application, multiple players access a shared leaderboard. Which of the following ensures data consistency? A) Synchronized Collections B) Garbage Collection C) Thread Pool D) Volatile Keyword 12 / 20 Category: (Java) 12. What will be the output of the following code? java class Test { public static void main(String[] args) { String s1 = "abc"; String s2 = new String("abc"); System.out.println(s1 == s2); } } A) true B) false C) Runtime exception D) Compilation error 13 / 20 Category: (Java) 13. What is the key difference between LinkedList and ArrayList? A) ArrayList allows duplicate elements, but LinkedList does not. B) LinkedList is synchronized, but ArrayList is not. C) LinkedList provides faster random access than ArrayList. D) ArrayList uses contiguous memory, while LinkedList uses nodebased memory. 14 / 20 Category: ( C++ ) 14. What does std::future provide in C++? A) Exception handling B) Memory management C) Real-time threading D) A mechanism to retrieve the result of an asynchronous operation 15 / 20 Category: (Java) 15. In a banking application, if a Withdrawal operation exceeds the balance, a BalanceInsufficientException is thrown. What is this an example of? A) Checked Exception B) Error Handling C) Runtime Exception D) Synchronization 16 / 20 Category: ( C ) 16. Which is true about calloc in C? A) Allocates and initializes memory to 0 B) Resizes memory C) Allocates memory but doesn't initialize D) Frees memory 17 / 20 Category: ( C ) 17. What is the output of this code? #include #define VALUE 10 + 5 int main() { printf("%d", VALUE * 2); return 0; } A) Compilation error B) 20 C) 25 D) 30 18 / 20 Category: ( C++ ) 18. What is the difference between std::vector and std::list? A) std::vector is contiguous in memory, std::list is not B) std::list is contiguous in memory C) std::list is faster for random access D) std::vector uses dynamic memory allocation for each element 19 / 20 Category: ( C ) 19. What will be the output of this code? #include int main() { int x = 5; int y = x++ + ++x; printf("%d", y); return 0; } A) 11 B) 12 C) Undefined behavior D) 13 20 / 20 Category: ( C ) 20. What is the output of the following code? #include int main() { int x = 10; if (x == 10) printf("x is 10\n"); else; printf("x is not 10\n"); return 0; } A) x is 10 B) Compilation error C) x is 10 x is not 10 D) Undefined behavior Your score is LinkedIn Facebook Twitter VKontakte 0%