0% 67 Year1st Year2nd Year3rd Year4th YearStateAndhra PradeshArunachal PradeshAssamBiharChhattisgarhGoaGujaratHaryanaHimachal PradeshJharkhandKarnatakaKeralaMadhya PradeshMaharashtraManipurMeghalayaMizoramNagalandOdishaPunjabRajasthanSikkimTamil NaduTelanganaTripuraUttar PradeshUttarakhandWest Bengal 1 / 20 Category: (Java) 1. What does the compareTo() method return when two objects are equal? A) 1 B) null C) 1 D) 0 2 / 20 Category: ( C++ ) 2. What is the primary difference between delete and delete[]? A) delete deallocates memory, delete[] does not B) delete[] is used for arrays, delete is for single objects C) delete[] is faster D) delete[] automatically resizes arrays 3 / 20 Category: ( C++ ) 3. What is the use of std::priority_queue? A) To maintain sorted data B) To provide fast access to the largest or smallest element C) To implement linked lists D) To provide dynamic array functionality 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) Increased memory usage D) Difficulty in unit testing 5 / 20 Category: ( C ) 5. Which function is used to allocate memory in C? A) malloc B) free C) All of the above D) realloc 6 / 20 Category: ( C ) 6. Which header file is required to use the strlen function? A) <math.h> B) <stdio.h> C) <string.h> D) <stdlib.h> 7 / 20 Category: ( C ) 7. What does the malloc function return if memory allocation fails? A) Undefined behavior B) A pointer to the allocated memory C) NULL D) A segmentation fault 8 / 20 Category: ( C ) 8. What is the output of this code? #include int main() { int a[5] = {1, 2, 3, 4, 5}; printf("%d", *(a + 3)); return 0; } A) 5 B) 4 C) 3 D) 2 9 / 20 Category: (Java) 9. A car rental system has a Vehicle class with subclasses like Car and Bike. If Vehicle cannot be instantiated, which feature is being used? A) Encapsulation B) Overriding C) Interface D) Abstract Class 10 / 20 Category: (Java) 10. Which of the following best represents "hasa" relationships in Java? A) Composition B) Inheritance C) Polymorphism D) Abstraction 11 / 20 Category: (Java) 11. In an order management system, a final class Order is used to prevent extension. What is the primary advantage of this? A) Prevents overriding critical logic B) Improves inheritance hierarchy C) Promotes polymorphism D) Ensures immutability 12 / 20 Category: ( C++ ) 12. 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 13 / 20 Category: (Java) 13. 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) IndexOutOfBoundsException B) Compilation error C) 4 D) 2 14 / 20 Category: (Java) 14. An online shopping application has a Cart class that stores Product objects. How should this relationship be modeled? A) Using inheritance B) Using encapsulation C) Using aggregation D) Using polymorphism 15 / 20 Category: ( C ) 15. What does the following program output? #include void main() { int a = 0; while (a++ < 5) {} printf("%d", a); } A) 6 B) 5 C) Infinite loop D) Compilation error 16 / 20 Category: ( C++ ) 16. What happens when a derived class constructor calls a base class constructor? A) The base class constructor is executed first B) The derived class constructor is executed first C) Both are executed simultaneously D) Only the derived class constructor is executed 17 / 20 Category: ( C++ ) 17. Which of the following algorithms is NOT part of STL? A) std::sort B) std::count C) std::search_string D) std::find 18 / 20 Category: ( C++ ) 18. 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) 19 / 20 Category: ( C++ ) 19. What is the primary purpose of decltype? A) To create dynamic types B) To declare constants C) To check type compatibility D) To deduce the type of an expression at compile time 20 / 20 Category: ( C ) 20. Which of the following is NOT a valid preprocessor directive? A) #endif B) #ifdef C) #define D) #while Your score is LinkedIn Facebook Twitter VKontakte 0%