0% 67 Year1st Year2nd Year3rd Year4th YearStateAndhra PradeshArunachal PradeshAssamBiharChhattisgarhGoaGujaratHaryanaHimachal PradeshJharkhandKarnatakaKeralaMadhya PradeshMaharashtraManipurMeghalayaMizoramNagalandOdishaPunjabRajasthanSikkimTamil NaduTelanganaTripuraUttar PradeshUttarakhandWest Bengal 1 / 20 Category: ( C ) 1. What is the output of the following code? #include int main() { int a = 5; int *p = &a; *p = 10; printf("%d", a); return 0; } A) Garbage value B) 5. C) Compilation error D) 10 2 / 20 Category: ( C++ ) 2. What is the value of x after this code? int x = 5; x += x++ + ++x; A) 11 B) Undefined behavior C) 15 D) 17 3 / 20 Category: (Java) 3. 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) Runtime exception C) false D) true 4 / 20 Category: (Java) 4. A ridesharing application uses a Singleton class to manage its global configuration settings. What is a downside of this approach? A) High CPU overhead B) Difficult to implement C) Difficulty in unit testing D) Increased memory usage 5 / 20 Category: ( C ) 5. What will happen if you free a pointer twice? A) No effect B) Compilation error C) Program crash or undefined behavior D) Memory will be freed again 6 / 20 Category: ( C ) 6. What is the output of the following code? #include int main() { int x = 5; printf("%d", x = x == 5); return 0; } A) Undefined behavior B) 1 C) 0 D) 5 7 / 20 Category: ( C ) 7. What is the result of the following code? #include int main() { int a = 10, b = 0; int c = a / b; printf("%d", c); return 0; } A) Compilation error B) 0 C) Undefined behavior D) Runtime error 8 / 20 Category: ( C++ ) 8. What does the keyword override ensure? A) Verifies that a method overrides a base class virtual method B) Prevents a method from being inherited C) Disables dynamic polymorphism D) Ensures thread-safe execution 9 / 20 Category: ( C ) 9. What is the value of the expression 5 && 0 || 3 && 4? A) Undefined behavior B) 1 C) 0 D) 4 10 / 20 Category: (Java) 10. An online shopping application has a Cart class that stores Product objects. How should this relationship be modeled? A) Using encapsulation B) Using inheritance C) Using polymorphism D) Using aggregation 11 / 20 Category: (Java) 11. 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) Prevents thread context switching. D) Provides exclusive lock on the variable. 12 / 20 Category: ( C++ ) 12. What is the output of this code? int x = 5; int &y = x; y = 10; std::cout << x; A) Undefined behavior B) 5 C) 10 D) Compilation error 13 / 20 Category: (Java) 13. A company requires an interface Employee with a calculateSalary() method for different roles like Manager and Engineer. Which concept is used here? A) Interface B) Abstract Class C) Static Polymorphism D) Multithreading 14 / 20 Category: (Java) 14. What is the output of the following code? java class Test { public static void main(String[] args) { int[][] arr = {{1, 2}, {3, 4}}; System.out.println(arr[1][1]); } } A) 4 B) Compilation error C) 2 D) IndexOutOfBoundsException 15 / 20 Category: ( C++ ) 15. Which type of memory is managed by std::allocator? A) Stack memory B) Dynamic heap memory C) Memory for global variables D) Constant memory 16 / 20 Category: ( C++ ) 16. What is the default access modifier for members of a struct? A) Protected B) No default exists C) Public D) Private 17 / 20 Category: ( C++ ) 17. 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 18 / 20 Category: ( C++ ) 18. What does std::future provide in C++? A) Memory management B) A mechanism to retrieve the result of an asynchronous operation C) Real-time threading D) Exception handling 19 / 20 Category: ( C ) 19. What is the maximum size of a file that can be handled by fseek() in C? A) Limited by system architecture B) No limit C) 2 GB D) 4 GB 20 / 20 Category: (Java) 20. How does Java handle recursion depth? A) It optimizes using tailcall optimization. B) It automatically optimizes memory. C) Recursion is not supported in Java. D) It uses the call stack and may throw StackOverflowError. Your score is LinkedIn Facebook Twitter VKontakte 0%