0%
67

1 / 20

Category: (Java)

1. In an ecommerce system, you want to hide sensitive user details like passwords. Which OOP principle helps achieve this?

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; }

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");
}
}

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?

5 / 20

Category: (Java)

5. What is the key difference between LinkedList and ArrayList?

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);
}
}

7 / 20

Category: ( C++ )

7. What is the purpose of alignas in C++?

8 / 20

Category: ( C++ )

8. Which of these is a non-static member initialization in C++11?

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?

10 / 20

Category: ( C )

10. Which of the following functions cannot be used with FILE* in C?

11 / 20

Category: ( C )

11. What will happen if you free a pointer twice?

12 / 20

Category: (Java)

12. Which of the following is true about volatile keyword in Java?

13 / 20

Category: ( C++ )

13. What is the purpose of typeid in C++?

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; }

15 / 20

Category: ( C )

15. What will happen if you access memory beyond the array size in C?

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;

}

17 / 20

Category: ( C )

17. What would be output following C program?

#include
int main()
{
char* str = "IncludeHelp";
printf("%c\n", *&*str);
return 0;
}

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?

19 / 20

Category: ( C++ )

19. Which C++ feature allows iteration over a collection without exposing its implementation?

20 / 20

Category: ( C++ )

20. What happens if you attempt to access an out-of-bounds element in a std::vector using operator[]?

Scroll to Top