System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Multiple Choice Questions
Q1411: ________ specifies that allocated memory will be initialized to zero.
- A: HEAP_CREATE_ENABLE_EXECUTE
- B: HEAP_REALLOC_IN_PLACE_ONLY
- C: HEAP_ZERO_MEMORY
- D: HEAP_NO_SERIALIZE
View Answer
C
Q1412: If allocation fails and exceptions are disabled, HeapAlloc() returns _______.
- A: a zero pointer
- B: an exception
- C: a warning
- D: NULL
View Answer
D
Q1413: The failure of HeapFree() can be diagnosed using _______.
- A: GetHeapInfo()
- B: GetLastError()
- C: HeapStatus()
- D: HeapGetInfo()
View Answer
B
Q1414: HeapReAlloc() allows resizing memory blocks using _______.
- A: lpMem and dwBytes
- B: dwFlags and hHeap
- C: lpMem and HeapSize
- D: dwBytes and HeapSize
View Answer
A
Q1415: Which API is used to determine the size of an allocated block in the heap?
- A: HeapAlloc()
- B: HeapSize()
- C: HeapReAlloc()
- D: HeapCompact()
View Answer
B
Q1416: The only valid flag for HeapSize() is _______.
- A: HEAP_ZERO_MEMORY
- B: HEAP_REALLOC_IN_PLACE_ONLY
- C: HEAP_NO_SERIALIZE
- D: HEAP_GENERATE_EXCEPTION
View Answer
C
Q1417: Serialization is required when threads
- A: are independent
- B: use separate heaps
- C: use common resources
- D: are single-threaded
View Answer
C
Q1418: If threads are autonomous, serialization is
- A: essential
- B: optional
- C: not required
- D: forced
View Answer
C
Q1419: The flag _______ provides an estimated 16% performance improvement.
- A: HEAP_GENERATE_EXCEPTION
- B: HEAP_REALLOC_IN_PLACE_ONLY
- C: HEAP_ZERO_MEMORY
- D: HEAP_NO_SERIALIZE
View Answer
D
Q1420: HEAP_NO_SERIALIZE should be used only when
- A: the program is multi-threaded
- B: memory is insufficient
- C: conflicts exist
- D: program is single-threaded or has isolated heaps
View Answer
D