System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 133
Q2841:
Which language feature in ANSI C is used for preventing unwanted optimization?
A. static
B. inline
C. volatile
D. private
Correct Answer:
C
Chapter: 133
Q2842:
The use of volatile makes sure that the latest value of a variable is always ________.
A. Ignored
B. Estimated
C. Retrieved
D. Assumed
Correct Answer:
C
Chapter: 133
Q2843:
A thread may switch after modifying a variable in a register without ________ it back.
A. Saving
B. Printing
C. Logging
D. Writing
Correct Answer:
D
Chapter: 133
Q2844:
If a variable is shared across threads and modified, you should declare it as ________.
A. private
B. volatile
C. const
D. signed
Correct Answer:
B
Chapter: 133
Q2845:
Registers are used by compilers for ________ operations.
A. Secondary
B. Intermediate
C. Final
D. Background
Correct Answer:
B
Chapter: 133
Q2846:
Latent defects refer to problems that exist ________.
A. In the source code
B. But go unnoticed after compilation
C. After testing
D. In the OS
Correct Answer:
B
Chapter: 133
Q2847:
Volatile is especially useful when thread outcomes depend on the variable's ________.
A. Initial value
B. Average value
C. Latest value
D. Final state
Correct Answer:
C
Chapter: 133
Q2848:
ANSI C's volatile qualifier is intended to work with ________.
A. Static code
B. Immutable values
C. Shared variables
D. Error handlers
Correct Answer:
C
Chapter: 133
Q2849:
Compiler optimization affects program performance by modifying ________ strategies.
A. Synchronization
B. Access and caching
C. Display
D. Storage allocation
Correct Answer:
B
Chapter: 133
Q2850:
Volatile makes sure every operation on a variable reads and writes directly to ________.
A. Cache
B. Disk
C. Memory
D. Stack
Correct Answer:
C
Chapter: 133
Q2851:
A volatile variable may degrade performance due to skipping ________.
A. Synchronization
B. Memory allocation
C. Optimization
D. Compilation
Correct Answer:
C
Chapter: 134
Q2852:
What does the volatile qualifier not guarantee in multi-processor systems?
A. Register usage
B. Execution speed
C. Order of visibility across processors
D. Cache flushing
Correct Answer:
C
Chapter: 134
Q2853:
Processor cores store values in ________ before writing them back to memory.
A. Main memory
B. Disk
C. Cache
D. Stack
Correct Answer:
C
Chapter: 134
Q2854:
Which technique ensures memory is accessed in the desired order?
A. Volatile qualifier
B. Register allocation
C. Memory barrier
D. Thread locking
Correct Answer:
C
Chapter: 134
Q2855:
Memory barriers are also known as ________.
A. Interrupts
B. Memory fences
C. Static guards
D. Mutexes
Correct Answer:
B
Chapter: 134
Q2856:
Volatile ensures values are updated in ________.
A. L2 cache
B. L1 cache
C. Main memory
D. GPU
Correct Answer:
B
Chapter: 134
Q2857:
Each core typically has its own ________.
A. L3 cache
B. Data bus
C. Instruction pointer
D. Level-1 cache
Correct Answer:
D
Chapter: 134
Q2858:
Level-2 cache is commonly shared by ________ on the same chip.
A. All processors
B. All cores on a chip
C. All memory types
D. GPU and CPU
Correct Answer:
B
Chapter: 134
Q2859:
If core 0 updates a variable using a memory barrier, the updated value will be ________ for core 3.
A. Unchanged
B. Delayed
C. Coherent
D. Compressed
Correct Answer:
C
Chapter: 134
Q2860:
Memory barriers make the memory view across processors more ________.
A. Synchronized
B. Randomized
C. Segmented
D. Fragmented
Correct Answer:
A