Skip to main content

System Programming MCQs with Answers

Practice important System Programming MCQs with answers and explanations.

Chapter: 96
Q2121:
WAIT_FAILED is returned when the function ______.
A. completes successfully
B. is interrupted
C. fails due to an error
D. times out
Correct Answer: C
Chapter: 96
Q2122:
WAIT_TIMEDOUT means the wait function ______.
A. was interrupted
B. returned successfully
C. timed out before completion
D. got access
Correct Answer: B
Chapter: 96
Q2123:
WAIT_OBJECT_0+n is used when multiple ______ are signaled.
A. threads
B. objects
C. handles
D. files
Correct Answer: B
Chapter: 97
Q2124:
What does an Environment Block contain for a process?
A. Executable files
B. Environment strings
C. System calls
D. Memory addresses
Correct Answer: B
Chapter: 97
Q2125:
Each string in the Environment Block is terminated by which character?
A. Null character
B. Space
C. Tab
D. Comma
Correct Answer: A
Chapter: 97
Q2126:
Which of the following is an example of an environment variable?
A. PATH
B. PROCESS_QUERY_INFORMATION
C. EXIT_CODE
D. MAXIMUM_WAIT_OBJECTS
Correct Answer: A
Chapter: 97
Q2127:
Which API is used to get the value of an environment variable?
A. GetEnvironmentVariable()
B. SetEnvironmentVariable()
C. CreateProcess()
D. TerminateProcess()
Correct Answer: A
Chapter: 97
Q2128:
Which API is used to set or modify an environment variable?
A. GetEnvironmentVariable()
B. SetEnvironmentVariable()
C. CreateProcess()
D. ExitProcess()
Correct Answer: B
Chapter: 97
Q2129:
In SetEnvironmentVariable(), what happens if lpValue is NULL?
A. The variable value is set to empty
B. The variable is deleted
C. The variable value is unchanged
D. A new variable is created
Correct Answer: B
Chapter: 97
Q2130:
If the environment variable already exists and SetEnvironmentVariable() is called with a new value, what happens?
A. The variable is deleted
B. The variable value is modified
C. The variable is duplicated
D. The variable is ignored
Correct Answer: B
Chapter: 97
Q2131:
If lpEnvironment is set to NULL in CreateProcess(), what happens to environment variables?
A. Child process gets an empty environment
B. Child process inherits the parent environment
C. Child process gets random environment
D. Child process environment is restricted
Correct Answer: B
Chapter: 97
Q2132:
Which character is reserved and cannot be used in environment variable names?
A. $
B. =
C. #
D. %
Correct Answer: B
Chapter: 97
Q2133:
If the buffer passed to GetEnvironmentVariable() is smaller than the variable length, what happens?
A. Returns 0
B. Returns required length
C. Returns partial string
D. Throws an error
Correct Answer: B
Chapter: 97
Q2134:
Can any process modify environment variables?
A. No
B. Yes
C. Only system processes
D. Only parent process
Correct Answer: B
Chapter: 97
Q2135:
In environment strings, the format is always ______.
A. Name=Value
B. Value=Name
C. Value:Name
D. Name-Value
Correct Answer: A
Chapter: 97
Q2136:
Which access right is used to query information about a process?
A. PROCESS_SET_INFORMATION
B. PROCESS_QUERY_INFORMATION
C. PROCESS_TERMINATE
D. PROCESS_ALL_ACCESS
Correct Answer: B
Chapter: 97
Q2137:
PROCESS_TERMINATE access right allows a process to ______.
A. Query process info
B. Terminate a process
C. Set environment variables
D. Duplicate handles
Correct Answer: B
Chapter: 97
Q2138:
Which access right allows setting process information?
A. PROCESS_QUERY_INFORMATION
B. PROCESS_TERMINATE
C. PROCESS_SET_INFORMATION
D. DUPLICATE_HANDLE
Correct Answer: C
Chapter: 97
Q2139:
DUPLICATE_HANDLE access right allows a process to ______.
A. Terminate processes
B. Duplicate an object handle
C. Set environment variables
D. Create new processes
Correct Answer: B
Chapter: 97
Q2140:
What does CREATE_PROCESS access right allow?
A. Terminate a process
B. Create a new process
C. Duplicate handles
D. Query information
Correct Answer: D

Test Your Knowledge

Take a timed quiz on System Programming

🚀 Start Quiz Now