0% 67 Year1st Year2nd Year3rd Year4th YearStateAndhra PradeshArunachal PradeshAssamBiharChhattisgarhGoaGujaratHaryanaHimachal PradeshJharkhandKarnatakaKeralaMadhya PradeshMaharashtraManipurMeghalayaMizoramNagalandOdishaPunjabRajasthanSikkimTamil NaduTelanganaTripuraUttar PradeshUttarakhandWest Bengal 1 / 20 Category: (Java) 1. In an ecommerce system, you want to hide sensitive user details like passwords. Which OOP principle helps achieve this? A) Polymorphism B) Abstraction C) Encapsulation D) Inheritance 2 / 20 Category: ( C++ ) 2. What is the output of this program? #include int main() { int x = 0; while (x < 3) { x++; } std::cout << x; return 0; } A) 3 B) 0 C) 2 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) AquaGreenOther B) Red C) Aqua D) AquaGreen 4 / 20 Category: (Java) 4. A bank application requires different types of accounts such as SavingsAccount and CurrentAccount. What OOP concept is used to achieve this? A) Abstraction B) Encapsulation C) Inheritance D) Polymorphism 5 / 20 Category: (Java) 5. What is the key difference between LinkedList and ArrayList? A) ArrayList uses contiguous memory, while LinkedList uses nodebased memory. B) ArrayList allows duplicate elements, but LinkedList does not. C) LinkedList provides faster random access than ArrayList. D) LinkedList is synchronized, but ArrayList is not. 6 / 20 Category: (Java) 6. 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) Runtime exception B) Compilation error C) true D) false 7 / 20 Category: ( C++ ) 7. What is the purpose of alignas in C++? A) To ensure dynamic memory allocation B) To handle unaligned data C) To specify memory alignment requirements for variables D) To align arrays in STL 8 / 20 Category: ( C++ ) 8. Which of these is a non-static member initialization in C++11? A) int x = 10; B) x = 10; C) int x; D) static int x = 10; 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) Interface B) Abstract Class C) Encapsulation D) Overriding 10 / 20 Category: ( C ) 10. Which of the following functions cannot be used with FILE* in C? A) strcpy() B) fscanf() C) fopen() D) fprintf() 11 / 20 Category: ( C ) 11. What will happen if you free a pointer twice? A) Memory will be freed again B) Program crash or undefined behavior C) Compilation error D) No effect 12 / 20 Category: (Java) 12. Which of the following is true about volatile keyword in Java? A) Provides exclusive lock on the variable. B) Guarantees atomicity for readmodifywrite operations. C) Prevents thread context switching. D) Guarantees visibility and ordering of changes. 13 / 20 Category: ( C++ ) 13. What is the purpose of typeid in C++? A) Template specialization B) Runtime type identification (RTTI) C) Determines size of a type D) Dynamic memory allocation 14 / 20 Category: ( C++ ) 14. What happens when this code is executed? #include void func() { throw std::runtime_error("Error"); } int main() { try { func(); } catch (const std::exception& e) { std::cout << e.what(); } return 0; } A) Compilation error B) Terminates without printing C) Prints "Error" D) Undefined behavior 15 / 20 Category: ( C ) 15. What will happen if you access memory beyond the array size in C? A) Segmentation fault B) Undefined behavior C) Program crashes gracefully D) Compiler detects the error 16 / 20 Category: ( C ) 16. What will be the output of this code? #include int main() { int x = 5; int y = x++ + ++x; printf("%d", y); return 0; } A) 12 B) 11 C) 13 D) Undefined behavior 17 / 20 Category: ( C ) 17. What would be output following C program? #include int main() { char* str = "IncludeHelp"; printf("%c\n", *&*str); return 0; } A) *I B) Error C) IncludeHelp D) I 18 / 20 Category: (Java) 18. 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) Runtime Exception C) Error Handling D) Synchronization 19 / 20 Category: ( C++ ) 19. Which C++ feature allows iteration over a collection without exposing its implementation? A) Static polymorphism B) Type deduction C) Operator overloading D) Range-based for loops 20 / 20 Category: ( C++ ) 20. What happens if you attempt to access an out-of-bounds element in a std::vector using operator[]? A) Returns the last element B) Compilation error C) Results in undefined behavior D) Throws an exception Your score is LinkedIn Facebook Twitter VKontakte 0%