0%
67

1 / 20

Category: ( C )

1. What is the output of the following code?

#include

int main() {

int a = 5;

int *p = &a;

*p = 10;

printf("%d", a);

return 0;

}

2 / 20

Category: ( C++ )

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

int x = 5;

x += x++ + ++x;

3 / 20

Category: (Java)

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

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. What will happen if you free a pointer twice?

6 / 20

Category: ( C )

6. What is the output of the following code?

#include

int main() {

int x = 5;

printf("%d", x = x == 5);

return 0;

}

7 / 20

Category: ( C )

7. What is the result of the following code?

#include

int main() {

int a = 10, b = 0;

int c = a / b;

printf("%d", c);

return 0;

}

8 / 20

Category: ( C++ )

8. What does the keyword override ensure?

9 / 20

Category: ( C )

9. What is the value of the expression 5 && 0 || 3 && 4?

10 / 20

Category: (Java)

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

11 / 20

Category: (Java)

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

12 / 20

Category: ( C++ )

12. What is the output of this code?

int x = 5;

int &y = x;

y = 10;

std::cout << x;

13 / 20

Category: (Java)

13. A company requires an interface Employee with a calculateSalary() method for different roles like Manager and Engineer. Which concept is used here?

14 / 20

Category: (Java)

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

15 / 20

Category: ( C++ )

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

16 / 20

Category: ( C++ )

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

17 / 20

Category: ( C++ )

17. What will happen when this code runs?

#include

class A {

public:

A() { std::cout << "Constructor"; } ~A() { std::cout << "Destructor"; } }; int main() { A obj; return 0; }

18 / 20

Category: ( C++ )

18. What does std::future provide in C++?

19 / 20

Category: ( C )

19. What is the maximum size of a file that can be handled by fseek() in C?

20 / 20

Category: (Java)

20. How does Java handle recursion depth?

Scroll to Top