1. In C++, what does the `new` keyword do?
A) Allocates memory on the stack
B) Allocates memory on the heap
C) Initializes a variable
D) Deletes an object
2. In C++, what is the default access specifier for members of a class?
A) Public
B) Private
C) Protected
D) None of the above
3. What will happen if you attempt to delete a pointer that was not allocated with `new`?
A) It will cause a compile error.
B) It will cause a runtime error.
C) It will simply do nothing.
D) It will cause a memory leak.
4. In C++, how do you prevent a base class from being inherited?
A) By declaring it as private
B) By declaring the destructor as private
C) By declaring it as final
D) By declaring it as abstract
Tessolve Semiconductor Private Limited 1
5. What will be the output of the below C++ program?
A) 3 1 3
B) Compile-time error
C) 2 1 4
D) None of these
6. What is the purpose of the `virtual` keyword in C++?
A) To declare a constant variable
B) To enable polymorphism
C) To create a static method
D) To define a template
7. Which of the following correctly defines a copy constructor?
A) `ClassName(ClassName &obj);`
B) `ClassName(const ClassName &obj);`
C) `ClassName(ClassName obj);`
D) `ClassName(ClassName *obj);`
8. Which of the following statements is true regarding the 'const' keyword?
A) It can only be used with pointers.
Tessolve Semiconductor Private Limited 2
B) It can be used with member functions.
C) It cannot be used with classes.
D) It can only be used with global variables.
9. What happens if you try to access an outofbounds element in a vector?
A) It throws an exception
B) It returns a default value
C) Undefined behaviour occurs
D) It crashes the program
10. What will happen in the following C++ code snippet?
a) 4
b) 5
c) address of arr
d) 7
11. What is the output of 'sorted([3, 1, 4, 1, 5, 9], reverse=True)'?
a) [9, 5, 4, 3, 1, 1]
b) [1, 1, 3, 4, 5, 9]
c) Error
Tessolve Semiconductor Private Limited 3
d) None
12. What is the output of '3 + "3"' in Python?
a) 6
b) "33"
c) Error
d) 9
13. What is the time complexity of inserting an element at the beginning of a Python list?
a) O(1)
b) O(n)
c) O(log n)
d) O(n log n)
14. What is the correct syntax to define a function in Python?
a) 'function myFunc():'
b) 'def myFunc():'
c) 'def myFunc[]:'
d) 'func myFunc():'
15. Which data structure follows **FIFO**?
a) Stack
b) Queue
c) Tree
d) Graph
16. What does the following code output?
print(any([0, [], None, False]))
A) False
B) True
C) Error
Tessolve Semiconductor Private Limited 4
D) None
17. What will 'print("a" in "apple")' return?
a) True
b) False
c) None
d) Error
18. What is the output of the following code?
A) 0 1 2
B) 1 2 3
C) 0 1 2 3
D) 1 2 3 4
19. Which of the following is not a valid Python data structure?
A. List
B. Tuple
C. Dictionary
D. Array
20. Which of the following methods can be used to find the length of a list in Python?
A. length()
B. len()
C. size()
D. count()
21. What is the primary purpose of a hash function in a hash table?
A. To sort the elements
Tessolve Semiconductor Private Limited 5
B. To map keys to indices
C. To compress data
D. To encrypt data
22.Which of the following is not a SQL data type?
A. INTEGER
B. VARCHAR
C. BOOLEAN
D. ARRAY
23.Which SQL clause is used to filter records?
A. WHERE
B. FILTER
C. SORT
D. GROUP BY
24.What does the COUNT() function do in SQL?
A. Counts the number of columns in a table
B. Counts the number of rows in a table
C. Counts the number of characters in a string
D. Counts the number of tables in a database
25.Which SQL keyword is used to sort the resultset?
A. SORT BY
B. ORDER BY
C. GROUP BY
D. ARRANGE BY
============================= o ===========================
Tessolve Semiconductor Private Limited 6