0%
67

1 / 20

Category: (Java)

1. Which of the following best describes the use of the super keyword in a subclass?

2 / 20

Category: ( C++ )

2. What is the output of this program?

#include

template

void print(T x) { std::cout << x; } int main() { print(5);

return 0;

}

3 / 20

Category: ( C )

3. What will be the output of this code?

#include

int main() {

int x = 5;

int y = x++ + ++x;

printf("%d", y);

return 0;

}

4 / 20

Category: (Java)

4. In the Stream API, which of these is not a terminal operation?

5 / 20

Category: (Java)

5. A school management system has a Person class with Student and Teacher subclasses. Which Java feature allows calling overridden methods at runtime?

6 / 20

Category: ( C )

6. What is the purpose of the volatile keyword in C?

7 / 20

Category: ( C++ )

7. What is the output of sizeof(char*) in a 64-bit system?

8 / 20

Category: ( C++ )

8. What is a lambda function in C++?

9 / 20

Category: ( C++ )

9. What is the default access modifier for members of a struct?

10 / 20

Category: ( C++ )

10. What is the time complexity of std::map::find()?

11 / 20

Category: ( C++ )

11. What is the output of this program?

#include

void print() { std::cout << "Hello"; } int main() { print(); return 0; }

12 / 20

Category: ( C )

12. What does the following code print?

#include

int main() {

int x = 10;

int y = 5;

printf("%d", x++ + ++y);

return 0;

}

13 / 20

Category: ( C )

13. Given an array of integers nums[] = {10, 5, 8 ,15, 6, 3, 11} and an integer target = 19, find the indices of the two numbers in the array such that they add up to the target. You may assume that each input will have exactly one solution, and you cannot use the same element twice.
Which of the following are the correct indices?

14 / 20

Category: ( C )

14. Which of these is not a valid storage class in C?

15 / 20

Category: ( C++ )

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

16 / 20

Category: (Java)

16. How does Java handle recursion depth?

17 / 20

Category: (Java)

17. Which Java feature allows lambdas and streams?

18 / 20

Category: (Java)

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

19 / 20

Category: (Java)

19. What will the following code output?
java
class Test {
public static void main(String[] args) {
try {
System.out.println(10 / 0);
} catch (ArithmeticException e) {
throw new RuntimeException(e);
}
}
}

20 / 20

Category: ( C )

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

Scroll to Top