0%
67

1 / 20

Category: (Java)

1. What does the compareTo() method return when two objects are equal?

2 / 20

Category: ( C++ )

2. What is the primary difference between delete and delete[]?

3 / 20

Category: ( C++ )

3. What is the use of std::priority_queue?

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?

5 / 20

Category: ( C )

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

6 / 20

Category: ( C )

6. Which header file is required to use the strlen function?

7 / 20

Category: ( C )

7. What does the malloc function return if memory allocation fails?

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;

}

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: (Java)

10. Which of the following best represents "hasa" relationships in Java?

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?

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;

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

14 / 20

Category: (Java)

14. An online shopping application has a Cart class that stores Product objects. How should this relationship be modeled?

15 / 20

Category: ( C )

15. What does the following program output?

#include

void main() {

int a = 0;

while (a++ < 5) {} printf("%d", a); }

16 / 20

Category: ( C++ )

16. What happens when a derived class constructor calls a base class constructor?

17 / 20

Category: ( C++ )

17. Which of the following algorithms is NOT part of STL?

18 / 20

Category: ( C++ )

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

19 / 20

Category: ( C++ )

19. What is the primary purpose of decltype?

20 / 20

Category: ( C )

20. Which of the following is NOT a valid preprocessor directive?

Scroll to Top