wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Technical Aptitude Assessment

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

1. What is the output of the following C code? int main() { int a = 5, b = 10; printf("%d", a + b); return 0; } A) 15 B) 510 C) 5 D) 10

a)

A) 15

b)

C) 5 + 10

c)

B) 15.0

d)

A) 20

2.

2. Which of the following is a valid declaration of a pointer in C? A) int *ptr; B) int ptr*; C) *int ptr; D) ptr int*;

a)

int ptr;

b)

A) int *ptr;

c)

ptr* int;

d)

*ptr int;

3.

3. What will be the output of the following C code? int main() { int x = 10; printf("%d", ++x); return 0; } A) 10 B) 11 C) 12 D) Compilation error

a)

D) Runtime error

b)

C) 10

c)

B) 11

d)

A) 9

4.

4. In C, which of the following is used to allocate memory dynamically? A) malloc() B) alloc() C) new() D) create()

a)

calloc()

b)

realloc()

c)

A) malloc()

d)

free()

5.

5. What is the size of an int data type in C on a 32-bit system? A) 2 bytes B) 4 bytes C) 8 bytes D) 1 byte

a)

B) 4 bytes

b)

5 bytes

c)

6 bytes

d)

3 bytes

6.

6. Which of the following is NOT a feature of Object-Oriented Programming in C++? A) Encapsulation B) Inheritance C) Polymorphism D) Compilation

a)

Abstraction

b)

D

c)

Overloading

d)

Debugging

7.

7. What is the output of the following C++ code? class Test { public: void display() { cout << "Hello"; } }; int main() { Test t; t.display(); return 0; } A) Hello B) Error C) Hello World D) No output

a)

A) Hello

b)

C) Hello Universe

c)

B) Compilation Error

d)

D) Output is empty

8.

8. In C++, which keyword is used to inherit a class? A) inherit B) extends C) implements D) :

a)

F) subclass

b)

D) :

c)

G) baseclass

d)

E) derive

9.

9. What is the purpose of the 'virtual' keyword in C++? A) To create a virtual machine B) To allow method overriding C) To declare a constant D) To create a new thread

a)

B) To allow method overriding

b)

D) To manage memory allocation

c)

C) To define a new data type

d)

A) To implement garbage collection

10.

10. Which of the following is a correct way to declare a property in C#? A) public int Property { get; set; } B) public int Property() C) int Property { get; set; } D) public Property int;

a)

public int Property;

b)

int Property() { }

c)

private int Property { }

d)

A) public int Property { get; set; }

11.

11. What is the output of the following C# code? Console.WriteLine(5 + 10); A) 15 B) 510 C) 5 D) 10

a)

A) 15

b)

A) 25

c)

C) 50

d)

B) 15.0

12.

12. In C#, which of the following is used to handle exceptions? A) try-catch B) if-else C) switch-case D) for-loop

a)

A) try-catch

b)

do-while

c)

foreach

d)

try-finally

13.

13. What does the 'using' directive do in C#? A) Imports namespaces B) Declares variables C) Defines classes D) Creates methods

a)

F) Handles exceptions

b)

A) Imports namespaces

c)

E) Manages memory

d)

G) Executes code

14.

14. Which of the following is a valid SQL statement to retrieve all records from a table named 'Employees'? A) SELECT * FROM Employees; B) GET * FROM Employees; C) RETRIEVE * FROM Employees; D) FETCH * FROM Employees;

a)

QUERY * FROM Employees;

b)

A) SELECT * FROM Employees;

c)

PICK * FROM Employees;

d)

LOAD * FROM Employees;

15.

15. What will be the output of the following SQL query? SELECT COUNT(*) FROM Employees; A) Total number of employees B) Error C) 0 D) All employee names

a)

List of employee IDs

b)

Average age of employees

c)

Total salary of employees

d)

A) Total number of employees

16.

16. Which SQL clause is used to filter records? A) WHERE B) SELECT C) FROM D) ORDER BY

a)

A) WHERE

b)

JOIN

c)

GROUP BY

d)

HAVING

17.

17. In SQL, which of the following is used to update existing records in a table? A) MODIFY B) UPDATE C) CHANGE D) SET

a)

ALTER

b)

REMOVE

c)

B) UPDATE

d)

INSERT

18.

18. What is the purpose of the 'async' keyword in ASP.NET Core? A) To run code synchronously B) To define asynchronous methods C) To create new threads D) To handle exceptions

a)

C) To improve application security

b)

D) To optimize database connections

c)

A) To execute tasks in parallel

d)

B) To define asynchronous methods

19.

19. Which of the following is a valid way to create a new controller in ASP.NET Core? A) public class HomeController : Controller B) class HomeController : BaseController C) public HomeController() D) Controller HomeController;

a)

A) public class HomeController : Controller

b)

public void HomeController()

c)

class HomeController : ControllerBase

d)

public class HomeController : BaseController

20.

20. What is the default method for handling HTTP GET requests in ASP.NET Core? A) Get() B) Post() C) Index() D) Retrieve()

a)

Fetch()

b)

Load()

c)

Query()

d)

A) Get()