System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 41
Q901:
LockFileEx and UnlockFileEx functions have ________ parameter lists.
A. Different
B. Highly similar
C. Completely different
D. No parameters
Correct Answer:
B
Chapter: 41
Q902:
In LockFileEx, the parameter lpOverlapped is a pointer to a(n) ________.
A. OVERLAPPED structure
B. FILE descriptor
C. MEMORY buffer
D. LOCK flag
Correct Answer:
A
Chapter: 41
Q903:
The function LockFileEx is defined in Windows to control file ________.
A. Locking
B. Opening
C. Closing
D. Deleting
Correct Answer:
A
Chapter: 41
Q904:
LockFileEx returns TRUE if the lock operation ________.
A. succeeds
B. fails
C. raises an error
D. blocks
Correct Answer:
A
Chapter: 41
Q905:
The DWORD data type in LockFileEx is used to represent a ________.
A. 32-bit unsigned integer
B. 16-bit integer
C. Character string
D. Boolean value
Correct Answer:
A
Chapter: 42
Q906:
Locks should be released ________ the usage is completed.
A. before
B. after
C. during
D. the next day
Correct Answer:
B
Chapter: 42
Q907:
Holding a file lock longer than necessary can negatively impact ________.
A. system security
B. user performance
C. other programs' performance
D. network speed
Correct Answer:
C
Chapter: 42
Q908:
Which of the following is a consequence of not releasing file locks promptly?
A. Improved speed
B. Blocked programs
C. More memory
D. Less disk space
Correct Answer:
B
Chapter: 42
Q909:
Programs should be designed to release locks using ________.
A. appropriate functions
B. hardware devices
C. user input
D. special hardware
Correct Answer:
A
Chapter: 42
Q910:
The main reason for releasing file locks quickly is to avoid ________.
A. system crashes
B. program blocking
C. data corruption
D. unnecessary delays
Correct Answer:
D
Chapter: 42
Q911:
Programs holding locks longer than needed can cause ________ in multi-program environments.
A. performance issues
B. faster execution
C. memory leaks
D. security breaches
Correct Answer:
A
Chapter: 42
Q912:
File locks should be released ________ to prevent negative impact on system resources.
A. immediately
B. after several hours
C. only during shutdown
D. never
Correct Answer:
A
Chapter: 43
Q913:
File locking can generate ________ similar to those caused by mutual exclusion locks.
A. deadlocks
B. race conditions
C. memory leaks
D. buffer overflows
Correct Answer:
A
Chapter: 43
Q914:
If a read or write returns false due to a lock conflict, the byte transfer count will be ________ the number requested.
A. equal
B. greater
C. less
D. unknown
Correct Answer:
C
Chapter: 43
Q915:
A shared lock allows other processes to ________ the file but not write to it.
A. read
B. write
C. delete
D. modify
Correct Answer:
A
Chapter: 43
Q916:
Improper use of shared locks can generate ________ errors.
A. unexpected
B. compiler
C. logical
D. syntax
Correct Answer:
A
Chapter: 43
Q917:
Shared locks restrict ________ access to a file while allowing read access.
A. write
B. read
C. delete
D. modify
Correct Answer:
A
Chapter: 43
Q918:
Deadlocks in file locking occur due to ________ resource contention.
A. mutual
B. exclusive
C. time-based
D. random
Correct Answer:
A
Chapter: 44
Q919:
The Windows Registry is a ________ database.
A. hierarchical
B. relational
C. flat
D. network
Correct Answer:
A
Chapter: 44
Q920:
The Windows Registry stores low-level settings for the Windows OS and ________.
A. hardware applications
B. websites
C. network protocols
Correct Answer:
B