0%
67

1 / 20

Category: (Java)

1. In a ticket booking application, multiple users try to book the last available ticket simultaneously. Which Java feature can handle this scenario?

2 / 20

Category: ( C )

2. what will be the output of the following program?

#include
int main()
{
int a = 10;
printf("%d", a++ * a++);
return (0);
}

3 / 20

Category: ( C )

3. What would be output following C program?

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

4 / 20

Category: ( C )

4. What does the following code print?

#include

int main() {

int x = 10;

int y = 5;

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

return 0;

}

5 / 20

Category: (Java)

5. What is the purpose of the ForkJoinPool class?

6 / 20

Category: (Java)

6. What will the following code produce?
java
class Test {
public static void main(String[] args) {
int[] arr = {1, 2, 3};
for (int i : arr) {
arr[i] = i + 1;
}
System.out.println(Arrays.toString(arr));
}
}

7 / 20

Category: ( C++ )

7. Which of the following is true for virtual functions in C++?

8 / 20

Category: ( C )

8. What does the following code print?

#include

int main() {

int x = 5;

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

return 0;

}

9 / 20

Category: ( C )

9. Which function is used to allocate memory in C?

10 / 20

Category: ( C )

10. Which of the following statements is incorrect?

11 / 20

Category: ( C++ )

11. What is the output of the following code?

int x = 10;

int y = 20;

const int* ptr = &x;

ptr = &y;

*ptr = 30;

12 / 20

Category: ( C++ )

12. What is RAII in C++?

13 / 20

Category: ( C++ )

13. Which type of memory is managed by std::allocator?

14 / 20

Category: ( C++ )

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

15 / 20

Category: (Java)

15. In a library management system, a Book class has a getDetails() method that behaves differently for Fiction and NonFiction subclasses. Which OOP concept is demonstrated?

16 / 20

Category: (Java)

16. In a hospital management system, the Patient class has methods like admit() and discharge(). These methods' signatures are the same in subclasses but have different implementations. What is this an example of?

17 / 20

Category: ( C++ )

17. What is emplace_back used for in std::vector?

18 / 20

Category: ( C++ )

18. What is the value of x after this code?

int x = 5;

x += x++ + ++x;

19 / 20

Category: (Java)

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

20 / 20

Category: (Java)

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

Scroll to Top