NEW
Font size
WorksheetsDSE7
Total questions: 20
Worksheet time: 10mins
What is the purpose of the "fork" system call in operating systems?
To create a new process
To allocate memory to a process
To terminate a process
To switch between processes
Which scheduling algorithm guarantees each process an equal amount of CPU time in a round-robin fashion?
First-Come, First-Served (FCFS)
Shortest Job Next (SJN)
Round Robin
Priority Scheduling
Which memory hierarchy level has the smallest capacity and fastest access time?
Main Memory (RAM)
Secondary Storage (Hard Disk)
Cache Memory
Virtual Memory
Which type of instruction allows a single assembly language instruction to generate multiple machine language instructions?
Macro instruction
Micro instruction
Parallel instruction
SIMD instruction
Which sorting algorithm has a worst-case time complexity of O(n^2) but performs well for small datasets?
Quick Sort
Merge Sort
Bubble Sort
Radix Sort
Which HTML snippet correctly defines a level 2 heading with the text "Important Details"?
<heading>Important Details</heading>
<h2>Important Details</h2>
<h1>Important Details</h1>
<heading2>Important Details</heading2>
Which HTML snippet correctly defines a table with two rows and two columns?
<table><tr><td>Row 1, Column 1</td></tr><tr><td>Row 2, Column 1</td></tr></table>
<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>
<table><row><column>Row 1, Column 1</column></row><row><column>Row 2, Column 1</column></row></table>
<table><tr><td>Row 1, Column 1</td><tr><td>Row 2, Column 1</td></tr></table>
. Which HTML snippet correctly adds an image with the source "image.jpg" and alt text "A beautiful landscape"?
<img source="image.jpg" alt="A beautiful landscape">
<image src="image.jpg" alt="A beautiful landscape">
<img src="image.jpg" alt="A beautiful landscape">
<picture src="image.jpg" alt="A beautiful landscape"></picture>
Which HTML snippet represents an unordered list with three list items?
<list><li>Item 1</li><li>Item 2</li><li>Item 3</li></list>
<ul><li>Item 1</li><li>Item 2</li><li>Item 3</li></ul>
<ol><li>Item 1</li><li>Item 2</li><li>Item 3</li></ol>
<ul>Item 1, Item 2, Item 3</ul>
The CSS property "flexbox" is commonly used for:
Applying gradient backgrounds
Creating responsive layouts with flexible content containers
Changing the font family of text
Controlling the opacity of elements
When fopen() is not able to open a file, it returns?
EOF
NULL
Runtime Error
Compiler Dependent
Which of the following sorting algorithms can be used to sort a random linked list with minimum time complexity?
Insertion Sort
Quick Sort
Heap Sort
Merge Sort
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);
}
Prints all the nodes of the Linked list
Prints all the nodes of the Linked list in reverse order
Prints alternate nodes of the Linked List
Prints alternate nodes in reverse order
#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
Number of elements between two pointer are: 5. Number of bytes between two pointers are: 20
Number of elements between two pointer are: 20. Number of bytes between two pointers are: 20
Compiler Error
Runtime Error
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;
}
sizeof arri[] = 3 sizeof ptri = 4 sizeof arrc[] = 3 sizeof ptrc = 4
sizeof arri[] = 12 sizeof ptri = 4 sizeof arrc[] = 3 sizeof ptrc = 1
sizeof arri[] = 3 sizeof ptri = 4 sizeof arrc[] = 3 sizeof ptrc = 1
sizeof arri[] = 12 sizeof ptri = 4 sizeof arrc[] = 3 sizeof ptrc = 4
In a set, what is the purpose of the "union" operation?
Remove an element from the set
Add an element to the set
Find the intersection of two sets
Combine two sets into a single set
Which of the following functions from “stdio.h” can be used in place of printf()?
fputs() with FILE stream as stdout
fprintf() with FILE stream as stdout
fwrite() with FILE stream as stdout
All of the above
Look at this series: 22, 21, 23, 22, 24, 23, ... What number should come next?
22
24
26
25
Look at this series: 7, 10, 8, 11, 9, 12, ... What number should come next?
7
12
10
13
. Look at this series: 2, 1, (1/2), (1/4), ... What number should come next?
1/3
1/8
2/8
1/16
