0% found this document useful (0 votes)
51 views

Sample Paper - CS609

This document contains a 40 question multiple choice exam on system programming topics like processes, threads, synchronization, inter-process communication and more. The questions test knowledge of various Windows API functions for creating and managing processes, threads, pipes, mutexes and other resources. The exam is worth a total of 60 marks and has a time limit of 90 minutes.

Uploaded by

CyberSite Status
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views

Sample Paper - CS609

This document contains a 40 question multiple choice exam on system programming topics like processes, threads, synchronization, inter-process communication and more. The questions test knowledge of various Windows API functions for creating and managing processes, threads, pipes, mutexes and other resources. The exam is worth a total of 60 marks and has a time limit of 90 minutes.

Uploaded by

CyberSite Status
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Sample Paper

FINALTERM EXAMINATION
Fall 2022
CS609 – System Programming

Time: 90 min
Marks: 60

Question No: 1 (Marks: 01) - Please choose the correct option

1. A _____________ API is used to create a single threaded child process.


A. CreateFile()
B. CreateProcess()
C. CreateThread()
D. CreateProcessThread()

Question No: 2 (Marks: 01) - Please choose the correct option

2. Total number of parameters required for CreateProcess() API is _______.


A. 9
B. 10
C. 11
D. 12

Question No: 3 (Marks: 01) - Please choose the correct option

3. From which structure, we obtain the newly created child process’s handle and ID?
A. LPSTARTUPINFO structure
B. LPPROCESS_INFORMATION structure
C. lpEnvironment Variable
D. LPSECURITY_ATTRIBUTES

Question No: 4 (Marks: 01) - Please choose the correct option

4. _______________API is used to map a view of a file-mapping object into the address


space of a calling process.
A. CreateViewOfFile()
B. MapViewOfFile()
C. CreateFileMapping()
D. OpenFileMapping()
Question No: 5 (Marks: 01) - Please choose the correct option

5. Which one is not a disadvantage of the static linking during compilations?


A. A big executable file
B. Takes more space on disk
C. Take less physical memory
D. Consume more bandwidth

Question No: 6 (Marks: 01) - Please choose the correct option

6. In Implicit linking, the library functions are linked to the source code at ______.
A. Written time
B. Compile time
C. Run time
D. Load time

Question No: 7 (Marks: 01) - Please choose the correct option

7. In which type of linking, the DLLs are not used?


A. Static linking
B. Explicit Linking only
C. Implicit linking only
D. Both Implicit and Explicit linking

Question No: 8 (Marks: 01) - Please choose the correct option

8. The CreateProcess() API returns _______ handle(s) after successful execution.


A. Zero
B. One
C. Two
D. Three

Question No: 9 (Marks: 01) - Please choose the correct option

9. The return type of ExitProcess() API is ____.


A. DWORD
B. LPTSTR
C. HANDLE
D. VOID

Question No: 10 (Marks: 01) - Please choose the correct option

10. The number of parameters required for TerminateProcess() API is _____.


A. 1
B. 2
C. 3
D. 4

Question No: 11 (Marks: 01) - Please choose the correct option


11. After loading a DLL explicitly, we can obtain the address of any entry point in DLL
using the function ________.
A. GetModuleHandle
B. GetProcAddress()
C. LoadLibrary()
D. LoadLibraryEx()

Question No: 12 (Marks: 01) - Please choose the correct option

12. The number of parameters required for CreateJobObjectA() API is ______.


A. 0
B. 1
C. 2
D. 3

Question No: 13 (Marks: 01) - Please choose the correct option

13. The return type of CreateThread() API is _______.


A. DWORD
B. LPDWOR
C. HANDLE
D. LPTSTR

Question No: 14 (Marks: 01) - Please choose the correct option

14. The default stack size for a thread is _______________.


A. 1 MB
B. 1 KB
C. 1 Byte
D. 1 bit

Question No: 15 (Marks: 01) - Please choose the correct option

15. The number of parameters required for GetExitCodeThread() API is __________.


A. 0
B. 1
C. 2
D. 3

Question No: 16 (Marks: 01) - Please choose the correct option

16. TLS stands for ________.


A. Thread Local Storage
B. Thread Last State
C. Thread Local Size
D. Timestamp Local Storage
Question No: 17 (Marks: 01) - Please choose the correct option

17. A unit of execution that is scheduled by the application rather than by the OS Kernel, is
called as _______.
A. Fiber
B. Thread
C. Process
D. Mutex

Question No: 18 (Marks: 01) - Please choose the correct option

18. A fiber can obtain its starting address by using the API __________.
A. CreateFiber()
B. GetFiberData()
C. GetCurrrentFiber()
D. ConvertThreadToFiber()

Question No: 19 (Marks: 01) - Please choose the correct option

19. The return type of CreateFiber() API is ___________.


A. VOID
B. LPVOID
C. HANDLE
D. BOOL

Question No: 20 (Marks: 01) - Please choose the correct option

20. Which one of the following is not a Process or thread synchronization object?
A. Fiber
B. Critical Section
C. Mutex
D. Semaphore

Question No: 21 (Marks: 01) - Please choose the correct option

21. Interlocked functions apply to _______ integers.


A. 32 bits signed
B. 32 bits unsigned
C. 64 bits signed
D. 64 bits unsigned

Question No: 22 (Marks: 01) - Please choose the correct option

22. Which one of the following is not a requirement for correct thread code?
A. Global Storage
B. Volatile Storage
C. Memory Barrier
D. Critical Code Region

Question No: 23 (Marks: 01) - Please choose the correct option

23. The return type of CreateSemaphore() API is ________.


A. DWORD
B. HANDLE
C. BOOL
D. VOID

Question No: 24 (Marks: 01) - Please choose the correct option

24. The code region where only one thread can execute at a time is known as ___________.
A. program
B. critical section
C. non – critical section
D. Exception Handler

Question No: 25 (Marks: 01) - Please choose the correct option

25. Which one of the following APIs block a thread if another thread is in the section?
A. InitializeCriticalSection
B. EnterCriticalSection
C. DeleteCriticalSection
D. LeaveCriticalSection

Question No: 26 (Marks: 01) - Please choose the correct option

26. Which one of the following numbers is good spin count for heap management according
to MSDN?
A. 1000
B. 2000
C. 3000
D. 4000

Question No: 27 (Marks: 01) - Please choose the correct option

27. Which one of the following concepts limit the number of active, contending threads?
A. Mutual Exclusion
B. Thread Contention
C. Semaphore Throttle
D. Parallelism
Question No: 28 (Marks: 01) - Please choose the correct option

28. Which one of the following APIs returns a pointer to a TP_WORK structure?
A. TrySubmitThreadpoolCallback
B. WaitForThreadpoolWorkCallbacks
C. CreateThreadpoolWork
D. SubmitThreadpoolWork

Question No: 29 (Marks: 01) - Please choose the correct option

29. Thread synchronization is a process of handling situation when ___________ or more


threads need access to a shared resource.
A. One
B. Two
C. Three
D. Four

Question No: 30 (Marks: 01) - Please choose the correct option

30. Which one of the following options best describe the mutex?
A. is a binary mutex
B. does not have handles
C. must be accessed from only one process
D. can be accessed from multiple processes

Question No: 31 (Marks: 01) - Please choose the correct option

31. What will happen if a non-recursive mutex is locked more than once?
A. Starvation
B. Deadlock
C. Critical Section
D. Semaphore

Question No: 32 (Marks: 01) - Please choose the correct option

32. What are the two kinds of semaphores?


A. mutex & counting
B. binary & counting
C. counting & decimal
D. decimal & binary

Question No: 33 (Marks: 01) - Please choose the correct option

33. _________ function is supported only on the Itanium processor.


A. InterlockedExchangeAdd
B. InterlockedExchange
C. InterlockedExchangeAcquire
D. lockedCompareExchange

Question No: 34 (Marks: 01) - Please choose the correct option

34. Instead of starting a new thread for every task to execute concurrently, the task can be
passed to a _______.
A. process
B. thread pool
C. thread queue
D. CPU

Question No: 35 (Marks: 01) - Please choose the correct option

35. Each process has its own process affinity mask, which is a _______ vector.
A. bit
B. byte
C. Nibble
D. Word

Question No: 36 (Marks: 01) - Please choose the correct option

36. Which one of the followings is not a feature of named pipes?


A. message-oriented
B. unidirectional
C. independent instances of pipes
D. Networked clients can be access pipes by name

Question No: 37 (Marks: 01) - Please choose the correct option

37. Which one of the following is not a characteristic of Anonymous pipe?


A. Character based
B. Half Duplex
C. Full Duplex
D. Communicate with Linux & UNIX both

Question No: 38 (Marks: 01) - Please choose the correct option

38. Which one of the followings has two handles: Read handle and Write handle?
A. Named Pipes
B. Anonymous Pipes
C. Unnamed Pipes
D. Interprocess Pipes
Question No: 39 (Marks: 01) - Please choose the correct option

39. The return type of CreatePipe() API is ________.


E. DWORD
F. HANDLE
G. BOOL
H. VOID

Question No: 40 (Marks: 01) - Please choose the correct option

40. Total number of parameters required for CreateNamedPipe() API is _________.


A. 8
B. 9
C. 10
D. 11

Question No: 41 (Marks: 03)

What is Explicit Linking and which Windows API is used to load a DLL explicitly inside
a program?

Answer

Question No: 42 (Marks: 03)

Name the two Windows APIs that are used to return the pseudo and real handle of a
process.
Answer

Question No: 43 (Marks: 03)

Briefly describe the two parameters associated with the following Windows API.
FARPROC GetProcAddress(HMODULE hModule, LPCSTR lpProcName)
Answer
Question No: 44 (Marks: 03)

Mention the names of two type of events and which function is used to set these types?
Answer

Question No: 45 (Marks: 03)

Briefly explain system mask and process mask.

Answer

Question No: 46 (Marks: 03)

When did the mutex become the abandoned mutex?

Answer

Question No: 47 (Marks: 05)

Briefly describe each parameter in the following Widows API.


BOOL GetProcessTime(HANDLE hProcess,
LPFILETIME lpCreationTime,
LPFILETIME lpExitTime,
LPFILETIME lpKernelTime,
LPFILETIME lpUserTime );

Answer

Question No: 48 (Marks: 05)

Write the name of functions or APIs used for the following tasks.
1. Creating a job object
2. Opening a named job object
3. Adding a process to a job object
4. To destroy or close job object
Answer

Question No: 49 (Marks: 05)

Which Windows API is used to release the ownership of a mutex? Also write its
signature.

Answer

Question No: 50 (Marks: 05)

What is the purpose of dwPipeMode parameter in CreateNamedPipe() API and mention


the names of its two commonly used values.

Answer

You might also like