Skip to main content

System Programming MCQs with Answers

Practice important System Programming MCQs with answers and explanations.

Chapter: 182
Q3961:
Reading from an empty anonymous pipe
A. read operation blocks
B. immediately returns zero
C. bytes lost
D. raises an error
Correct Answer: A
Chapter: 182
Q3962:
Write operation to an anonymous pipe
A. will block if the buffer is full
B. will always succeed
C. is non-blocking
D. is asynchronous
Correct Answer: A
Chapter: 182
Q3963:
Anonymous pipes work
A. one way
B. fully duplex
C. two way
D. network wide
Correct Answer: A
Chapter: 182
Q3964:
For two-way communication using anonymous pipes
A. you need two pipes
B. one pipe is sufficient
C. you need shared memory
D. you need named pipes
Correct Answer: A
Chapter: 182
Q3965:
ReadFile() function in anonymous pipes
A. can read as many bytes as in the pipe
B. or specified number
C. only one byte
D. only up to 256 bytes
Correct Answer: A
Chapter: 182
Q3966:
Anonymous pipes are useful for
A. communication between parent and child processes
B. network communication
C. client-server communication
D. device drivers
Correct Answer: A
Chapter: 182
Q3967:
CreatePipe() returns
A. BOOL
B. integer
C. character
D. string
Correct Answer: A
Chapter: 182
Q3968:
Anonymous pipes
A. are suitable for simple IPC
B. are suitable for complex network communication
C. allow multiple open handles
D. are message oriented
Correct Answer: A
Chapter: 182
Q3969:
If a pipe buffer is full,
A. WriteFile() blocks
B. WriteFile() discards data
C. WriteFile() throws error
D. WriteFile() completes immediately
Correct Answer: A
Chapter: 183
Q3970:
In I/O redirection using anonymous pipes, who creates the child processes?
A. Operating system
B. Parent process
C. Command line interface
D. Kernel
Correct Answer: B
Chapter: 183
Q3971:
In the example, how many child processes are created by the parent?
A. 1
B. 2
C. 3
D. 4
Correct Answer: B
Chapter: 183
Q3972:
Child processes are piped together to
A. redirect input and output
B. execute parallel code
C. monitor memory usage
D. run independently
Correct Answer: A
Chapter: 183
Q3973:
Anonymous pipes are used in the example to
A. connect standard input and output
B. connect mouse and keyboard
C. connect memory blocks
D. connect databases
Correct Answer: A
Chapter: 183
Q3974:
Which structure is used to define pipe security attributes?
A. PROCESS_INFORMATION
B. SECURITY_ATTRIBUTES
C. STARTUPINFO
D. PIPE_SECURITY
Correct Answer: B
Chapter: 183
Q3975:
In the provided code, what is the purpose of GetStartupInfo()?
A. To start a process
B. To retrieve system info
C. To initialize child process handles
D. To initialize startup structures for child processes
Correct Answer: D
Chapter: 183
Q3976:
What does the character '=' represent in the command line?
A. Command termination
B. Process separator
C. Command pipe
D. Redirection indicator
Correct Answer: D
Chapter: 183
Q3977:
Which function reads the current command line?
A. ReadCommand()
B. GetCommandLine()
C. GetInput()
D. GetLine()
Correct Answer: B
Chapter: 183
Q3978:
If no '=' separator is found in the command line, the program
A. will raise an error
B. will create a new file
C. will execute command1 only
D. will exit silently
Correct Answer: A
Chapter: 183
Q3979:
The child process created first uses
A. standard input and hWritePipe
B. standard output and hReadPipe
C. standard output and hWritePipe
D. standard input and hReadPipe
Correct Answer: C
Chapter: 183
Q3980:
The child process created second uses
A. hWritePipe as input
B. hReadPipe as input
C. hReadPipe as output
D. hWritePipe as output
Correct Answer: B

Test Your Knowledge

Take a timed quiz on System Programming

🚀 Start Quiz Now