System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 63
Q1321:
The API used to probe system memory information is
A. GetMemoryInfo()
B. RetrieveInfo()
C. GetSystemInfo()
D. GetMemoryStatus()
Correct Answer:
C
Chapter: 63
Q1322:
The GetSystemInfo() API returns a pointer to
A. PROCESS_DATA
B. THREAD_BLOCK
C. SYSTEM_INFO
D. MEMORY_MAP
Correct Answer:
C
Chapter: 63
Q1323:
The SYSTEM_INFO structure contains information about
A. page size only
B. application name only
C. page size, granularity, and memory space
D. user password only
Correct Answer:
C
Chapter: 63
Q1324:
_________ are commonly used dynamic data structures requiring dynamic memory.
A. Static arrays
B. Loops
C. Search tables
D. Conditional blocks
Correct Answer:
C
Chapter: 63
Q1325:
Windows provides __________ for handling dynamic memory allocation.
A. loops
B. conditional statements
C. APIs
D. file handles
Correct Answer:
C
Chapter: 63
Q1326:
The Win32 platform uses ________ bits for pointers.
A. 8
B. 16
C. 32
D. 64
Correct Answer:
C
Chapter: 63
Q1327:
The structure SYSTEM_INFO provides details about ________.
A. file names
B. network usage
C. page size and granularity
D. sound output
Correct Answer:
C
Chapter: 63
Q1328:
__________ memory management ensures efficient use of memory in user programs.
A. Random
B. Static
C. Optimal
D. Flexible
Correct Answer:
C
Chapter: 63
Q1329:
The remaining virtual space in Win32 is reserved for ________.
A. video rendering
B. system resources
C. shared data and drivers
D. background processes
Correct Answer:
C
Chapter: 64
Q1330:
Where does a programmer allocate memory dynamically from?
A. Stack
B. Registers
C. Heap
D. Disk
Correct Answer:
C
Chapter: 64
Q1331:
What does Windows maintain to manage dynamic memory?
A. Array
B. Queue
C. Pool of heaps
D. Linked list
Correct Answer:
C
Chapter: 64
Q1332:
How many heaps can a Windows process have?
A. Only one
B. Two
C. Many
D. None
Correct Answer:
C
Chapter: 64
Q1333:
What is traditionally considered sufficient for heap management?
A. Multiple heaps
B. One heap
C. No heap
D. Heap per module
Correct Answer:
B
Chapter: 64
Q1334:
Why might a program need multiple heaps?
A. To save disk space
B. To store logs
C. To improve efficiency
D. To reduce CPU load
Correct Answer:
C
Chapter: 64
Q1335:
Which of the following is a runtime function for heap allocation in C?
A. heapalloc()
B. allocate()
C. malloc()
D. storemem()
Correct Answer:
C
Chapter: 64
Q1336:
Which function is used to free memory in C runtime?
A. remove()
B. clear()
C. free()
D. release()
Correct Answer:
C
Chapter: 64
Q1337:
The heap in Windows is treated as what kind of object?
A. File
B. Process
C. Thread
D. Windows object
Correct Answer:
D
Chapter: 64
Q1338:
What is used to access a heap in Windows?
A. Pointer
B. Index
C. Handle
D. Name
Correct Answer:
C
Chapter: 64
Q1339:
What does the GetProcessHeap() API return on success?
A. Heap size
B. Heap address
C. Heap handle
D. Heap index
Correct Answer:
C
Chapter: 64
Q1340:
What is returned by GetProcessHeap() in case of failure?
A. NULL
B. INVALID_HANDLE_VALUE
C. -1
D. Zero
Correct Answer:
A