0% 67 Year1st Year2nd Year3rd Year4th YearStateAndhra PradeshArunachal PradeshAssamBiharChhattisgarhGoaGujaratHaryanaHimachal PradeshJharkhandKarnatakaKeralaMadhya PradeshMaharashtraManipurMeghalayaMizoramNagalandOdishaPunjabRajasthanSikkimTamil NaduTelanganaTripuraUttar PradeshUttarakhandWest Bengal 1 / 20 Category: (Java) 1. 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 2 / 20 Category: (Java) 2. What will the following code output? java class Test { public static void main(String[] args) { String str = "hello"; str.concat(" world"); System.out.println(str); } } A) hello B) hello world C) Compilation error D) Runtime error 3 / 20 Category: (Java) 3. In the Stream API, which of these is not a terminal operation? A) reduce() B) map() C) forEach() D) collect() 4 / 20 Category: (Java) 4. Which method must be implemented when implementing the Runnable interface? A) execute() B) start() C) run() D) process() 5 / 20 Category: ( C ) 5. What is the size of a pointer in a 64-bit system? A) 4 bytes B) Depends on the compiler C) 8 bytes D) 16 bytes 6 / 20 Category: ( C++ ) 6. What is the output of this program? #include template void print(T x) { std::cout << x; } int main() { print(5); return 0; } A) Undefined behavior B) 5 C) 0 D) Compilation error 7 / 20 Category: ( C++ ) 7. What is the output of this code? int a = 5, b = 10; std::swap(a, b); std::cout << a << " " << b; A) 10 5 B) 10 5 C) Compilation error D) Undefined behavior 8 / 20 Category: (Java) 8. In a ticket booking application, multiple users try to book the last available ticket simultaneously. Which Java feature can handle this scenario? A) Synchronization B) Multithreading C) Exception Handling D) Polymorphism 9 / 20 Category: (Java) 9. What is the purpose of the ForkJoinPool class? A) Optimizes performance by limiting thread creation. B) Manage thread lifecycles in GUIbased programs. C) Provides an alternative to ThreadPoolExecutor. D) Divide a task into smaller subtasks and execute them concurrently. 10 / 20 Category: ( C++ ) 10. What will happen when this code is executed? #include class Test { public: Test() { std::cout << "Constructor"; } ~Test() { std::cout << "Destructor"; } }; int main() { Test* t = new Test(); return 0; } A) Only prints "Constructor" B) Undefined behavior C) Prints "Destructor" D) Prints "ConstructorDestructor" 11 / 20 Category: ( C++ ) 11. What does the keyword explicit do in C++? A) Disables default constructors B) Prevents implicit conversions and copy-initialization C) Marks a class as final D) Enables compile-time error checking 12 / 20 Category: ( C ) 12. Which of the following functions cannot be used with FILE* in C? A) fopen() B) fprintf() C) fscanf() D) strcpy() 13 / 20 Category: ( C ) 13. Which is true about calloc in C? A) Frees memory B) Allocates and initializes memory to 0 C) Resizes memory D) Allocates memory but doesn't initialize 14 / 20 Category: ( C ) 14. What is the output of this program? #include int main() { int a = 5, b = 10; printf("%d %d", a, b); return 0; } A) Garbage values B) Compilation error C) 10 5 D) 5 10 15 / 20 Category: ( C++ ) 15. What does the following code snippet indicate? void foo() noexcept { } A) The function is thread-safe B) The function has no arguments C) The function does not throw exceptions D) The function can throw exceptions 16 / 20 Category: ( C ) 16. What is the output of the following ? #include void main() { int a[5] = { 5, 1, 15, 20, 25 }; int i, j, m; i = ++a[1]; j = a[1]++; m = a[i++]; printf("%d, %d, %d", i, j, m); } A) 2, 1, 15 B) 1, 2, 5 C) 2, 3, 20 D) 3, 2, 15 17 / 20 Category: (Java) 17. In a payment gateway system, retrying a failed transaction can cause data corruption if not handled carefully. What technique helps avoid this? A) Deadlock Prevention B) Exception Propagation C) Race Condition D) Idempotent Operations 18 / 20 Category: ( C++ ) 18. Which header file is required for std::thread? A) <system> B) <future> C) <thread> D) <threading> 19 / 20 Category: ( C++ ) 19. What will happen when this code runs? #include class A { public: A() { std::cout << "Constructor"; } ~A() { std::cout << "Destructor"; } }; int main() { A obj; return 0; } A) Only prints "Destructor" B) Only prints "Constructor" C) Prints "ConstructorDestructor" D) Compilation error 20 / 20 Category: ( C ) 20. Which function is used to allocate memory in C? A) free B) malloc C) All of the above D) realloc Your score is LinkedIn Facebook Twitter VKontakte 0%