Skip to main content

System Programming MCQs with Answers

Practice important System Programming MCQs with answers and explanations.

Chapter: 65
Q1361:
Memory is committed to the heap
A. at the end of execution
B. on demand
C. during OS boot
D. initially
Correct Answer: D
Chapter: 65
Q1362:
If required memory increases beyond initial size
A. Heap fails
B. Pages are swapped
C. Heap is reallocated
D. More pages are automatically allocated
Correct Answer: D
Chapter: 65
Q1363:
What happens if the heap exceeds dwMaximumSize?
A. It resets
B. Exception is thrown
C. Heap does not grow
D. Process is terminated
Correct Answer: C
Chapter: 65
Q1364:
Which flag causes an exception on memory allocation failure?
A. HEAP_NO_SERIALIZE
B. HEAP_CREATE_ENABLE_EXECUTE
C. HEAP_GENERATE_EXCEPTIONS
D. HEAP_NOTIFY
Correct Answer: C
Chapter: 65
Q1365:
Which flag helps in performance when serialization isn't needed?
A. HEAP_SERIALIZE
B. HEAP_NO_SERIALIZE
C. HEAP_CREATE_PERFORMANCE
D. HEAP_PRIORITY
Correct Answer: B
Chapter: 65
Q1366:
What does HEAP_CREATE_ENABLE_EXECUTE allow?
A. Read-only heap
B. Auto-deletion
C. Executing code from heap
D. Memory compression
Correct Answer: C
Chapter: 65
Q1367:
Which Windows security feature prevents code execution from heap?
A. DEP
B. NTFS
C. ACL
D. Firewall
Correct Answer: A
Chapter: 65
Q1368:
What is the correct way to destroy a heap?
A. CloseHandle()
B. HeapRelease()
C. DeleteHandle()
D. HeapDestroy()
Correct Answer: D
Chapter: 65
Q1369:
What does HeapDestroy() take as input?
A. Heap size
B. Heap structure
C. Heap handle
D. Page count
Correct Answer: C
Chapter: 65
Q1370:
Using CloseHandle() on a heap handle is
A. Recommended
B. Required
C. Not appropriate
D. A warning only
Correct Answer: C
Chapter: 65
Q1371:
What should not be destroyed using HeapDestroy()?
A. Heap from HeapCreate()
B. Default heap from GetProcessHeap()
C. Allocated memory pages
D. None of these
Correct Answer: B
Chapter: 65
Q1372:
Which of the following is NOT a valid HeapCreate() parameter?
A. flOptions
B. dwInitialSize
C. dwHeapAccess
D. dwMaximumSize
Correct Answer: C
Chapter: 65
Q1373:
The API HeapCreate returns a ________.
A. page number
B. heap pointer
C. heap handle
D. error code
Correct Answer: C
Chapter: 65
Q1374:
To enable heap-based code execution, which flag is used?
A. HEAP_EXECUTE
B. HEAP_CREATE_ENABLE_EXECUTE
C. HEAP_CODE_ALLOWED
D. HEAP_PERMIT_EXECUTION
Correct Answer: B
Chapter: 65
Q1375:
If memory requirements are unknown, deferring commitment is
A. discouraged
B. mandatory
C. recommended
D. risky
Correct Answer: C
Chapter: 65
Q1376:
Heap is a ________ resource in Windows.
A. unlimited
B. shared
C. limited
D. independent
Correct Answer: C
Chapter: 65
Q1377:
Using HEAP_NO_SERIALIZE improves performance by
A. allocating less memory
B. avoiding synchronization
C. using global scope
D. reducing I/O overhead
Correct Answer: B
Chapter: 65
Q1378:
The heap is growable beyond dwMaximumSize when
A. it is NULL
B. it is non-zero
C. it is zero
D. it is 1 GB
Correct Answer: C
Chapter: 65
Q1379:
Executing code from heap without HEAP_CREATE_ENABLE_EXECUTE causes
A. no issue
B. heap overflow
C. access violation
D. exception
Correct Answer: D
Chapter: 65
Q1380:
Using HeapDestroy() with default process heap can cause
A. exception
B. success
C. error
D. normal termination
Correct Answer: A

Test Your Knowledge

Take a timed quiz on System Programming

🚀 Start Quiz Now