Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

LSP QUIZ

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

Addressing used in Application layer and Transport layer are:

a)

Specific address and logical address

b)

Port address and specific address

c)

Specific address and service point

address

d)

physical address and port

address

2.

What type of address is used to identify a specific process on a host?

a)

Logical address

b)

MAC address

c)

Port number

d)

IP address

3.

Identify the below address structure:

struct in_addr {

in_addr_t

s_addr; };

struct sockaddr_in {

uint8_t sin_len;

sa_family_t

sin_family;

in_port_t

sin_port;

struct in_addr sin_addr;

char sin_zero[8];

};

a)

IPV4

b)

IPV6

c)

None

d)

Both

4.

In TCP connection termination final FIN Message is send from ___ to ______.

a)

User, Client

b)

Server, Client

c)

Client, Server

d)

Kernel, Server

5.

The client process does not call bind() because

a)

The server does the client

side binding

b)

Kernel assigns an ephemeral port to

client process

c)

Client side binding is not done

d)

TCP assigns an ephemeral port to

the client process

6.

Which one of the following socket API functions converts an unconnected active TCP socket into passive TCP socket.

a)

connect()

b)

listen()

c)

accept ()

d)

scoket()

7.

What are the two operations that can be performed on semaphores?

a)

sem_getvalue and sem_trywait

b)

sem_open and sem_close

c)

sem_post and sem_wait

d)

sem_init and sem_destroy

8.

What is the return value of sem_wait if it is successful?

Answer choices

a)

errno

b)

-1

c)

0

d)

1

9.

What is the purpose of the sem_unlink function?

a)

To initialize a semaphore

b)

To retrieve the value of a semaphore

c)

To destroy a semaphore

d)

To unlink a named semaphore

10.

What is a critical section?

a)

A part of code that can be executed by multiple processes simultaneously

b)

A part of code that manages shared resources in a mutually exclusive manner

c)

A type of semaphore used in POSIX

d)

A programming error that causes deadlock

11.

What does the system() function do?

a)

It reads data from a file.

b)

It executes a shell command.

c)

It writes data to a file.

d)

It opens a file.

12.

What does the read() function return on success?

a)

The file descriptor.

b)

A status code.

c)

The number of bytes actually read.

d)

The number of bytes requested.

13.

What is the purpose of the open() function?

a)

To close a file.

b)

To associate a file descriptor with a file.

c)

To write data to a file.

d)

To read data from a file

14.

Which of the following is a valid symbolic name for standard output?

a)

STDERR

b)

STDOUT_FILENO

c)

STDIN_FILENO

d)

STDERR_FILENO

15.

Which command is an example of a filter in UNIX?

a)

write

b)

open

c)

read

d)

cat

16.

What does the O_APPEND flag do?

a)

It truncates a file.

b)

It opens a file in read-only mode.

c)

It appends data to the end of a file.

d)

It creates a new file.

17.

What is the purpose of the PATH variable in a shell?

a)

It controls the permissions of files.

b)

It sets the default shell for the user.

c)

It stores the history of commands executed.

d)

It defines the sequence of directories the shell searches for commands.

18.

What does the '&' symbol do in a command line?

a)

It runs the command in the foreground.

b)

It runs the command in the background.

c)

It terminates the command.

d)

It pauses the command execution.

19.

Which of the following is NOT a type of shell mentioned?

a)

Bourne shell

b)

C shell

c)

Korn shell

d)

Python shell

20.

What does the command 'sleep 5' do?

a)

Displays the current time.

b)

Counts to five.

c)

Runs the command in the background.

d)

Pauses the execution for 5 seconds.