Our team has conducted extensive research to compile a set of System Programming MCQs. We encourage you to test your System Programming knowledge by answering these multiple-choice questions provided below.
Simply scroll down to begin!
A. In the scanning for an internals function
B. Anywhere at all
C. In the iteration of the fscanf() function
D. In the beginning of the main() function
A. Initializes a subset of memory pointed to by &ctl_addr
B. Given that 0 is passed, it unsets the memory of ctl_addr
C. Initializes the region of memory pointed to by &ctl_addr
D. Allocates and initializes memory for variable ctl_addr
A. Timing Diagram
B. Sequence Diagram
C. Event Trace
D. E-R Schema
A. send()
B. sendto()
C. sendmsg()
A. SSH
B. RSH
C. EncryptoTelnet
D. rlogin
A. A client's server
B. A client's socket
C. A server's clients
D. A server's socket
A. Proper program function requires all threads to run quickly
B. Proper program function requires that all threads run at the same speed
C. Proper program function is dependent on the execution sequence and timing of each thread
A. fflush()
B. fscanf()
C. fbuffer()
D. sscanf()
A. No, it is a 'well-defined' or reserved port.
B. Yes, it is as good as any other port number.
C. Yes, it is best ot use low numbers for port numbers.
D. No, it is best to use three or four digit port numbers.
A. Man-in-the-middle
B. Buffer overflow
C. Password cracking
D. Denial of service
A. Child process terminates before its parent process
B. Parent process terminates before its child process
C. Parent and child process terminate simultaneously
A. PHP
B. ALGOL
C. LISP
D. None of these
A. #itdef, #ifndef, and #endif
B. Bit flags and bitwise OR'ing
C. Use host-specific linkers
D. if, else if, and else blocks
A. Threads and processes exist separately
B. Each thread exists within a process
C. Each process exists within a thread
A. The function is written using block structuring
B. The function must terminate before control returns to caller
C. This function's purpose is to block unstructured calls
D. This function has the highest possible priority
A. Hard links can cross filesystems
B. Files are deleted from disk when a hard link is removed
C. Hard links are directory entries that point to the same inode as another file
A. Syntax error; the second argument should be a single integer type
B. Syntax error; the function takes only one more argument after 'filename'
C. Runtime error opening the file as the various flags and modes are in conflict
D. Opens a file descriptor, bitwise OR'ing output flags and in mode 644
A. Frequently check email and other network services
B. Sample system process information for use by the top command
C. Watch a set of file descriptors to see which are ready
A. a file descriptor
B. a file struct
C. a file function
D. a file pointer
A. Yes, because recursion is always preferable to iteration
B. No, because iteration is always preferable to recursion
C. No, because both stack depth and stack-frame size are unpredictable
D. No, because there is more than one 'long integer' type
A. Multiple threads can be executed without corrupting shared data
B. Threads don’t start until all of the resources they require are available
C. Threads can only access the data in its process
A. st_ctime
B. st_mtime
C. st_atime
A. Aggressive caching of a process
B. Prevent users from renaming or deleting files created by other users
C. Keep a process from swapping out of memory
A. STDIN_FILENO = 0, STDOUT_FILENO = 1, STDERR_FILENO = 2
B. STDOUT_FILENO = 0, STDERR_FILENO = 1, STDERR_FILENO = 2
C. STDERR_FILENO = 0, STDOUT_FILENO = 1, STDIN_FILENO = 2
D. STDIN_FILENO = 0, STDERR_FILENO = 1, STDOUT_FILENO = 2
A. The child inherits the parent’s
B. The child always has an empty set of closed descriptors
C. The child has distinct copies of the parent’s
D. The child overwrites the parent’s
A. C rand() function
B. /dev/random
A. Standard file access functions
B. Pipes
C. It depends on the device
A. #include errno.h header file
B. Properly pass parameter for Book
C. Pass both parameters by reference
D. Implement an exception handler
A. semaphore
B. named pipe
C. shared memory
D. unnamed pipe
A. line 21: if (my_sock < 0) {
B. line 20: my_sock = (int *)socket(anaddr.sin_family, SOCK_STREAM, 0);
C. line 20: my_sock = socket(SOCK_STREAM, anaddr.sin_family, 0);
D. line 10: SOCKET * my_sock;
A. Mapped memory is cached
B. Mapped memory uses prefetching
C. Mapped memory uses lazy loading
A. Removes the file from its directory
B. Sets the file’s inode count to one (1)
C. Moves the file in from one directory to another
A. Disk Drives
B. Special character devices
C. Virtual TTY lines
A. Big endian versus littlen endian
B. Text file versus binary file
C. Ignoring the parity bit
D. Not using buffered streaming
A. bind(s, &sock_struct, l);
B. bind(s, l, sock_struct);
C. bind(s, sizeof(sock_struct), l);
D. bind(sock_struct, s, l);
A. 0
B. -1
C. 2054
D. 19456
A. Listen on a port below 1024
B. Create a file in the /tmp directory
C. Open a file in the owner’s directory
D. exec() a new process
A. The present object's ultimate superclass or base class below the root object
B. The present object's superclass or base class
C. The present object's class
D. The root object
A. The thread that calls join blocks until all of the joinable threads complete
B. The system manages the shared resources for the joined threads
C. The joined threads are added to a queue and executed serially
A. wait4()
B. free()
C. close()
D. flush()
A. thread
B. daemon
C. orphan
D. zombie
A. The code will sometimes run and sometimes cause a crash
B. The code will always cause a crash
C. It isn't possible to tell without looking at my_print_func()
D. One thread will run while others will crash or abort
A. Pipes can be shared by more processes
B. Pipes connect processes on multiple machines
C. No additional work required on multiple CPU systems without cache coherence
D. Faster access time
A. sprintf()
B. strftime()
C. localtime()
D. get_datetime()
A. Defining bitwise flags
B. User-defined typing
C. Flags for file access
D. Alpha-numeric interchange
A. Man-in-the-middle
B. Password cracking
C. Denial of service
D. Buffer Overflow
A. sched_yield()
B. pthread_detach()
C. pthread_cancel()
D. pthread_setschedparam()
A. A list of files
B. A special type of inode
C. A file that contains other files
A. Call sigsetmask() to set the signal mask to be blocked
B. Create a mutex within the handler to protect shared resources
C. Call sigaction() to block the signal and set the signal mask at the same time
A. One is a true system call; the other is a library routine
B. One does some work on its own, then calls the other
C. One is for the main process; the other for forked processes
D. One flushes and closes I/O streams; the other doesn't
A. Files
B. Variables
C. Address space
D. Stack
A. string.h
B. locate.h
C. mem.h
D. stdio.h
A. enum
B. readonly
C. oneway
D. oneread
A. A new process is created
B. The process blocks waiting for another process to run
C. The process is completely overwritten
D. The process becomes executable
A. The memory buffer is destroyed when the processes end
B. The memory buffer automatically expands to meet the needs of the processes
C. The memory buffer more quickly accessed
D. The memory buffer is persistent beyond the life of the processes
A. Generate client-side stubs for interfaces
B. Dynamically link with cross-platform libs
C. Connect with proxy objects across platforms
D. Discover new objects and interfaces at runtime
A. The buffers are small
B. The buffers are large
C. The buffers may overlap
D. The buffers will not overlap
A. It's not a question of 'when' but if: compiler will 'see' it only if -FTP or -PASV is set
B. Compile will proceed with a warning of #define'ing a symbol as a string
C. Compile will fail with an error of #define'ing a symbol as a string
D. It is neither 'code' nor will the compiler 'see' it
A. Should not pass last by reference inside the while() loop
B. The syntax is wrong; it should be strtok(char *, const char *)
C. Passing NULL as the first param to strtok_r() is an error
D. Re-entrantly tokenizes on delimiter " ” to stringify something
A. To protect shared variables
B. To protect a critical section of code
C. To protect a shared memory region
A. inspect
B. attach
C. step
D. backface
A. The value of s is negative
B. sock_struct passed by reference
C. No server bound on sock_struct
D. Sercer not listening on sock_struct
A. Be connected to one or more event publishers
B. Use two-way messaging
C. Know the event name or event identifier for one or more events
D. (all of these)
A. Either 'step' or 'next'
B. Do a backtrace
C. Set a breakpoint
D. gdb has no 'jump' instruction
A. Encrypt every process’ executable
B. Limit system calls to administrators
C. Setuid important processes to the root user
D. Check all system calls for error conditions
A. The third 4KB of the file will be loaded into a 4KB memory location
B. The fourth 4KB of the file will be loaded into a 4KB memory location
C. The second 4KB of the file will be loaded into a 4KB memory location
D. The first 4KB of the file will be loaded into a 4KB memory location
A. Declares an unsigned integer and sets it to 1
B. Conducts a bitwise operation on transOK and 1
C. Identifies a bit in a byte to use as a flag
D. It sets the transOK flag to 1
A. Process 6003 terminates
B. The existence of process 6003 is checked
C. The signal 0 is sent to process 6003
D. The signal 6003 is sent to process 0
A. The ANSI-defined SOCK_ADDR * structure
B. A combination of file pointers and streams
C. Two host addresses and two port numbers
D. A specific, system-defined socket structure
A. HTTP
B. HTTPS
C. (none of these)
D. SOCKS
A. signal()
B. send()
C. call()
D. raise()
A. may use either thread-id or port number
B. must use both thread-id and port number
C. can use thread-id but not port number
D. can use port number but not thread-id
A. Access thread-specific data outside the thread
B. Enable a thread to set and use data
C. Insert key-value pairs into a thread's dictionary
D. Use a key to identify a thread
A. S_ISVTX | S_ISUID | S_IRGRP | S_IWGRP | S_IRXOTH
B. S_IRUSR | S_IRWXG | | S_IROTH | S_IXOTH
C. S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH
D. S_IRWXU | S_IWGRP | S_IXOTH | S_IRWXO
A. PTHREAD_MUTEX_NORMAL
B. PTHREAD_MUTEX_RECURSIVE
C. PTHREAD_MUTEX_ERRORCHECK
D. PTHREAD_MUTEX_DEFAULT
A. Naming Services
B. Stub and skeleton
C. CORBAfacilities
D. IDL files
A. Bitwise OR O_RDONLY with another flag
B. Do not open a file within a condition
C. Use either one of 'O_RDONLY' and '0666'
D. Replace the declaration with: int file1;
A. The parent must create a new pipe
B. The parent must close pipe_fd[0], and the child must close pipe_fd[1]
C. The child must create a new pipe
D. The parent must close pipe_fd[1], and the child must close pipe_fd[0]
A. -1
B. 0
C. 206896
D. 4066
A. It will have no effect at all
B. A lock is set using a compound condition comprising of self and a time interval
C. A lock is locked if and when self is instantiated before a specific date-time
D. Control blocks for some time on a lock on a condition that is unique to an instance
A. Executable and compiler
B. Object file and linker
C. Quads and assembler
D. Header file and preprocessor
A. The mkdir() command is privileged, and doesn’t allow any modification to permissions
B. The behavior of mkdir() is undefined if anything other than permission bits is set
C. UNIX requires that directories be created before any non-permission bits are set
A. Compiler-Dynamic Linker incompatibility
B. Shared libraries should have been updated
C. Outdated symbols in symbol table or link table
D. Debugging info flags missing in Makefile
A. A mutex is being set to be locked upon a specific condition
B. A mutex is tried to be locked within a specific time
C. A mutex is being set to be locked at a specific time
D. A mutex is tried to be locked with a specific condition
Which of the following system calls can be used to send a message via a connected socket?
A. send
B. sendto
C. sendmsg
D. write
Which of the following are true of Unix system calls?
A. System calls are executed in "User" context.
B. The routine "malloc" which is used for allocating memory is a system call.
C. A new file can be created using the "open" system call.
D. If two processes are executing the "write" system call simultaneously, they are serialized by the operating system.
E. The "read" system call will never be blocked.
Which of the following gdb commands can be used to obtain the stack trace of all the threads of a multi threaded program running on Linux?
A. bt
B. ::stack
C. $C
D. thread apply all bt
A. A pipe using the pipe system call.
B. A named pipe using the mknod system call.
C. Named sockets.
D. Signals
A. ps
B. top
C. lsof
D. vmstat
E. A.B
A. SIGHUP
B. SIGSTOP
C. SIGCONT
D. SIGINT
E. B.C
A. SHARED_LIBRARIES
B. SHLIB_PATH
C. LD_LIBRARY_PATH
D. LIBRARIES
E. B.C
A. gdb
B. ltrace
C. strace
D. ptrace
A. strace
B. gdb
C. adb
D. mdb
A. brk
B. sbrk
C. malloc
D. calloc
A. gdb
B. strace
C. gcore
D. objdump
A. adb test 123
B. gdb test 123
C. strace 123
D. strace -f -p 123
A. The process can catch the signal and drop the semaphore before terminating.
B. The process terminates without releasing the semaphore.
C. The semaphore is released if the process had specified SEM_UNDO during creation.
D. The signal is deferred until the semaphore is released.
A. cat
B. grep
C. head
D. tail
A. It creates a named pipe.
B. It creates directory nodes
C. It creates pipes
A.
True
B.
False