WorksheetsPre-Assessment- C,C++, Data Structure & SQL_10th June 24
Total questions: 20
Worksheet time: 10mins
Which of the following is the correct syntax to include a header file in a C program?
#header <stdio.h>
#include stdio.h
#include <stdio.h>
#include "stdio.h"
Which of the following statements is correct about a do-while loop in C?
The loop condition is checked before the loop is executed.
The loop condition is checked after the loop is executed.
It is similar to a for loop.
It can only be used to iterate through arrays.
Which of the following correctly declares and initializes an array of integers in C?
int arr = {1, 2, 3};
int arr[] = {1, 2, 3};
int arr[3] = 1, 2, 3;
int arr(3) = {1, 2, 3};
Which of the following correctly defines a structure in C?
struct { int a; float b; }
struct myStruct { int a; float b; };
structure myStruct { int a; float b; }
struct { int a; float b; } myStruct;
What is the correct mode to open a file for reading and writing in C, where the file is created if it does not exist?
"r+"
"w+"
"a+"
"rw"
Which of the following functions is used to allocate memory dynamically in C?
alloc()
malloc()
calloc()
memalloc()
What is the correct way to free dynamically allocated memory in C?
release(ptr);
free(ptr);
delete(ptr);
dealloc(ptr);
Which of the following is NOT a pillar of Object-Oriented Programming?
Encapsulation
Inheritance
Compilation
Polymorphism
Which of the following statements is true about encapsulation in C++?
Encapsulation is the process of inheriting properties from a base class.
Encapsulation is the technique used to achieve polymorphism.
Encapsulation binds together the data and functions that manipulate the data.
Encapsulation allows one class to access the private members of another class.
Which of the following operators cannot be overloaded in C++?
+
=
::
++
What is the correct syntax for catching all exceptions in C++?
catch(...)
catch(Exception e)
catch(*)
catch_all()
Which of the following is not a component of the Standard Template Library (STL) in C++?
Algorithms
Containers
. Iterators
Threads
Which of the following data structures uses LIFO (Last In First Out) order?
Queue
Stack
Array
Linked List
What is the time complexity of searching for an element in an unsorted array?
O(1)
O(n)
O(log n)
O(n log n)
Which of the following statements is true about Binary Search Trees (BST)?
Every node has at most two children.
The left subtree contains only nodes with values greater than the parent node.
The right subtree contains only nodes with values less than the parent node.
It is a complete binary tree.
In an ER diagram, which of the following represents a relationship?
Ellipse
Rectangle
Diamond
Line
Which SQL statement is used to retrieve data from a database?
GET
FETCH
SELECT
RETRIEVE
Which type of join returns all rows when there is a match in either left or right table?
INNER JOIN
LEFT JOIN
RIGHT JOIN
FULL OUTER JOIN
Is images and videos being the example of the Structured data?
Yes
No
A _____ is a place where we can used to store huge amounts of structured data from different databases in a one place.
database
data lake
cloud
data warehouse
