wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

DSE7

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

What is the purpose of the "fork" system call in operating systems?

a)

To create a new process

b)

To allocate memory to a process

c)

To terminate a process

d)

To switch between processes

2.

Which scheduling algorithm guarantees each process an equal amount of CPU time in a round-robin fashion?

a)

First-Come, First-Served (FCFS)

b)

Shortest Job Next (SJN)

c)

Round Robin

d)

Priority Scheduling

3.

Which memory hierarchy level has the smallest capacity and fastest access time?

a)

Main Memory (RAM)

b)

Secondary Storage (Hard Disk)

c)

Cache Memory

d)

Virtual Memory

4.

Which type of instruction allows a single assembly language instruction to generate multiple machine language instructions?

a)

Macro instruction

b)

Micro instruction

c)

Parallel instruction

d)

SIMD instruction

5.

Which sorting algorithm has a worst-case time complexity of O(n^2) but performs well for small datasets?

a)

Quick Sort

b)

Merge Sort

c)

Bubble Sort

d)

Radix Sort

6.

Which HTML snippet correctly defines a level 2 heading with the text "Important Details"?

a)

<heading>Important Details</heading>

b)

<h2>Important Details</h2>

c)

<h1>Important Details</h1>

d)

<heading2>Important Details</heading2>

7.

Which HTML snippet correctly defines a table with two rows and two columns?

a)

<table><tr><td>Row 1, Column 1</td></tr><tr><td>Row 2, Column 1</td></tr></table>

b)

<table><tr><td>Row 1, Column 1</td><td>Row 1, Column 2</td></tr><tr><td>Row 2, Column 1</td><td>Row 2, Column 2</td></tr></table>

c)

<table><row><column>Row 1, Column 1</column></row><row><column>Row 2, Column 1</column></row></table>

d)

<table><tr><td>Row 1, Column 1</td><tr><td>Row 2, Column 1</td></tr></table>

8.

. Which HTML snippet correctly adds an image with the source "image.jpg" and alt text "A beautiful landscape"?

a)

<img source="image.jpg" alt="A beautiful landscape">

b)

<image src="image.jpg" alt="A beautiful landscape">

c)

<img src="image.jpg" alt="A beautiful landscape">

d)

<picture src="image.jpg" alt="A beautiful landscape"></picture>

9.

Which HTML snippet represents an unordered list with three list items?

a)

<list><li>Item 1</li><li>Item 2</li><li>Item 3</li></list>

b)

<ul><li>Item 1</li><li>Item 2</li><li>Item 3</li></ul>

c)

<ol><li>Item 1</li><li>Item 2</li><li>Item 3</li></ol>

d)

<ul>Item 1, Item 2, Item 3</ul>

10.

The CSS property "flexbox" is commonly used for:

a)

Applying gradient backgrounds

b)

Creating responsive layouts with flexible content containers

c)

Changing the font family of text

d)

Controlling the opacity of elements

11.

When fopen() is not able to open a file, it returns?

a)

EOF

b)

NULL

c)

Runtime Error

d)

Compiler Dependent

12.

Which of the following sorting algorithms can be used to sort a random linked list with minimum time complexity?

a)

Insertion Sort

b)

Quick Sort

c)

Heap Sort

d)

Merge Sort

13.

What does the following function do for a given Linked List with first node as head?

void fun1(struct node* head)

{

  if(head == NULL)

    return;

fun1(head->next);

  printf("%d  ", head->data);

}

a)

Prints all the nodes of the Linked list

b)

Prints all the nodes of the Linked list in reverse order

c)

Prints alternate nodes of the Linked List

d)

Prints alternate nodes in reverse order

14.

#include<stdio.h>

int main()

{

  int arr[] = {10, 20, 30, 40, 50, 60};

  int *ptr1 = arr;

  int *ptr2 = arr + 5;

  printf("Number of elements between two pointer are: %d.", (ptr2 - ptr1));

  printf("Number of bytes between two pointers are: %d", (char*)ptr2 - (char*) ptr1);

  return 0;

}

Assume that an int variable takes 4 bytes and a char variable takes 1 byte

a)

Number of elements between two pointer are: 5. Number of bytes between two pointers are: 20

b)

Number of elements between two pointer are: 20. Number of bytes between two pointers are: 20

c)

Compiler Error

d)

Runtime Error

15.

Consider a compiler where int takes 4 bytes, char takes 1 byte and pointer takes 4 bytes.

#include <stdio.h>

int main()

{

  int arri[] = {1, 2 ,3};

  int *ptri = arri;

  char arrc[] = {1, 2 ,3};

  char *ptrc = arrc;

  printf("sizeof arri[] = %d ", sizeof(arri));

  printf("sizeof ptri = %d ", sizeof(ptri));

  printf("sizeof arrc[] = %d ", sizeof(arrc));

  printf("sizeof ptrc = %d ", sizeof(ptrc));

  return 0;

}

a)

sizeof arri[] = 3 sizeof ptri = 4 sizeof arrc[] = 3 sizeof ptrc = 4

b)

sizeof arri[] = 12 sizeof ptri = 4 sizeof arrc[] = 3 sizeof ptrc = 1

c)

sizeof arri[] = 3 sizeof ptri = 4 sizeof arrc[] = 3 sizeof ptrc = 1

d)

sizeof arri[] = 12 sizeof ptri = 4 sizeof arrc[] = 3 sizeof ptrc = 4

16.

In a set, what is the purpose of the "union" operation?

a)

Remove an element from the set

b)

Add an element to the set

c)

Find the intersection of two sets

d)

Combine two sets into a single set

17.

Which of the following functions from “stdio.h” can be used in place of printf()?

a)

fputs() with FILE stream as stdout

b)

fprintf() with FILE stream as stdout

c)

fwrite() with FILE stream as stdout

d)

All of the above

18.

Look at this series: 22, 21, 23, 22, 24, 23, ... What number should come next?

a)

22

b)

24

c)

26

d)

25

19.

Look at this series: 7, 10, 8, 11, 9, 12, ... What number should come next?

a)

7

b)

12

c)

10

d)

13

20.

. Look at this series: 2, 1, (1/2), (1/4), ... What number should come next?

a)

1/3

b)

1/8

c)

2/8

d)

1/16