0% 67 Year1st Year2nd Year3rd Year4th YearStateAndhra PradeshArunachal PradeshAssamBiharChhattisgarhGoaGujaratHaryanaHimachal PradeshJharkhandKarnatakaKeralaMadhya PradeshMaharashtraManipurMeghalayaMizoramNagalandOdishaPunjabRajasthanSikkimTamil NaduTelanganaTripuraUttar PradeshUttarakhandWest Bengal 1 / 20 Category: (Java) 1. In a ticket booking application, multiple users try to book the last available ticket simultaneously. Which Java feature can handle this scenario? A) Multithreading B) Exception Handling C) Polymorphism D) Synchronization 2 / 20 Category: ( C ) 2. what will be the output of the following program? #include int main() { int a = 10; printf("%d", a++ * a++); return (0); } A) 110 B) No output C) 100 D) 105 3 / 20 Category: ( C ) 3. What would be output following C program? #include int main() { char* str = "IncludeHelp"; printf("%c\n", *&*str); return 0; } A) *I B) I C) Error D) IncludeHelp 4 / 20 Category: ( C ) 4. What does the following code print? #include int main() { int x = 10; int y = 5; printf("%d", x++ + ++y); return 0; } A) Compilation error B) 17 C) 15 D) 16 5 / 20 Category: (Java) 5. What is the purpose of the ForkJoinPool class? A) Manage thread lifecycles in GUIbased programs. B) Provides an alternative to ThreadPoolExecutor. C) Divide a task into smaller subtasks and execute them concurrently. D) Optimizes performance by limiting thread creation. 6 / 20 Category: (Java) 6. What will the following code produce? java class Test { public static void main(String[] args) { int[] arr = {1, 2, 3}; for (int i : arr) { arr[i] = i + 1; } System.out.println(Arrays.toString(arr)); } } A) [1, 3, 4] B) [1, 2, 3] C) ArrayIndexOutOfBoundsException D) [1, 2, 4] 7 / 20 Category: ( C++ ) 7. Which of the following is true for virtual functions in C++? A) Virtual functions must be const B) Virtual functions must always be redefined in derived classes C) Virtual functions cannot have a body D) Virtual functions support runtime polymorphism 8 / 20 Category: ( C ) 8. What does the following code print? #include int main() { int x = 5; printf("%d", ++x + x++); return 0; } A) Undefined behavior B) 10 C) 12 D) 11 9 / 20 Category: ( C ) 9. Which function is used to allocate memory in C? A) free B) malloc C) realloc D) All of the above 10 / 20 Category: ( C ) 10. Which of the following statements is incorrect? A) Arrays can be assigned to pointers B) A void pointer can point to any type of data C) Pointers store memory addresses D) sizeof(int*) is equal to sizeof(char*) on the same system 11 / 20 Category: ( C++ ) 11. What is the output of the following code? int x = 10; int y = 20; const int* ptr = &x; ptr = &y; *ptr = 30; A) 30 B) Compilation error C) Undefined behavior D) 20 12 / 20 Category: ( C++ ) 12. What is RAII in C++? A) A memory leak prevention mechanism B) Resource acquisition is initialization C) Redundant access index in arrays D) A design pattern for algorithms 13 / 20 Category: ( C++ ) 13. Which type of memory is managed by std::allocator? A) Memory for global variables B) Constant memory C) Dynamic heap memory D) Stack memory 14 / 20 Category: ( C++ ) 14. What happens if you attempt to access an out-of-bounds element in a std::vector using operator[]? A) Compilation error B) Returns the last element C) Results in undefined behavior D) Throws an exception 15 / 20 Category: (Java) 15. In a library management system, a Book class has a getDetails() method that behaves differently for Fiction and NonFiction subclasses. Which OOP concept is demonstrated? A) Overloading B) Encapsulation C) Abstract Classes D) Polymorphism 16 / 20 Category: (Java) 16. 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) Composition B) Runtime Polymorphism C) Encapsulation D) Static Polymorphism 17 / 20 Category: ( C++ ) 17. What is emplace_back used for in std::vector? A) To remove elements from the vector B) To directly allocate memory C) To construct an object in-place in the vector D) To add elements at the beginning of the vector 18 / 20 Category: ( C++ ) 18. What is the value of x after this code? int x = 5; x += x++ + ++x; A) Undefined behavior B) 15 C) 11 D) 17 19 / 20 Category: (Java) 19. Which of the following best describes the use of the super keyword in a subclass? A) To define a superclass variable B) To override a superclass method C) To restrict access to superclass members D) To call a constructor or method from the superclass 20 / 20 Category: (Java) 20. 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) Compilation error B) true C) Runtime exception D) false Your score is LinkedIn Facebook Twitter VKontakte 0%