MCQ
Paper - II (x) — Operating Systems MCQ - Practice Questions with Answers
Solve 132 Paper - II (x) — Operating Systems questions for RAS/RPSC preparation.
Practice questions
Q1A file system uses a single-level indexed allocation scheme. One index block is reserved for a file and contains 256 direct data-block addresses. If each data block is 4 KB, and the index block itself is not counted as file data, what is the maximum file size addressable through that one index block?
Indexed allocation stores block addresses in an index block; the addressed blocks hold the file data. Here the index block has 256 direct entries and each entry points to one 4 KB data block. The maximum addressable file data is therefore 256 x 4 KB = 1024 KB, which is 1 MB. The index block is metadata and is explicitly excluded from the file-size calculation.
Q2Which shell variable commonly holds the exit status of the most recently executed command in Bourne-style shell scripting?
Bourne-style shell scripts commonly test $? after a command to check whether it succeeded. By convention, zero indicates success and a non-zero value indicates some kind of failure or exceptional condition.
Q3Which Linux file traditionally stores user account entries such as login name, UID, GID, home directory and login shell?
The passwd database is the standard account listing on Linux systems. With shadow passwords, the encrypted password data is kept separately in /etc/shadow, while /etc/passwd still records account identity and login environment fields.
Q4A system has one resource type with 12 instances. The allocation vector is (2, 4, 1, 3), the maximum-demand vector is (4, 6, 5, 5), and the currently available count is 2. Which statement is correct about the state under the banker's safety test?
For a single resource type, Need = Max - Allocation = (2, 2, 4, 2). Starting with Available=2, P1 can complete and release 2, making 4 available; P2 can then complete and release 4, making 8 available; P4 and P3 can then complete. Since at least one such sequence exists, the state is safe, not deadlocked.
Q5Which rsync option is archive mode, commonly used for backups because it preserves directories and important file attributes?
rsync -a selects archive mode, a common backup choice because it recurses through directories and preserves items such as links, permissions, owners, groups, and times. Dry-run, compression, and checksum modes address different needs.
You've seen 5 of 132 sample questions
Unlimited practice on Paper - II (x) — Operating Systems comes with the RAS Test Series + Practice pack or Gate Pass.
More questions
6In clock synchronization for distributed real-time systems, what is the main difference between internal synchronization and external synchronization?
7A system administrator wants to change the password of an existing Linux user from the command line. Which command is intended for this task?
8A distributed RTOS has several nodes but no external UTC receiver. The master periodically polls the nodes, estimates their offsets, and asks them to adjust toward an average time. Which synchronization approach does this describe?
9A 32-bit virtual address is split into a 20-bit virtual page number and a 12-bit offset. Physical memory has 256 MiB. If the system uses a conventional single-level page table entry that stores only the physical frame number plus valid and protection bits, how many bits are needed for the physical frame number?
10In a shell script, which test expression checks whether /var/log/syslog exists and is a regular file?
11Which condition is most important when using a periodic timer tick to release real-time tasks in an RTOS?
12In a system with resource types A, B, and C, the available vector is (3, 3, 2). The allocation and maximum matrices are: P0 allocation (0,1,0), maximum (7,5,3); P1 allocation (2,0,0), maximum (3,2,2); P2 allocation (3,0,2), maximum (9,0,2); P3 allocation (2,1,1), maximum (2,2,2); P4 allocation (0,0,2), maximum (4,3,3). Which safe sequence is valid under the Banker's algorithm?
13Two threads share a bounded buffer protected by a mutex and a condition variable not_empty. Which consumer-side pattern is correct for waiting until at least one item is available?
14In a preemptive real-time operating system, a periodic task set has relative deadlines equal to periods. Which statement best describes Rate Monotonic Scheduling?
15For a large file that is mostly read sequentially but occasionally requires direct access to block number k, which allocation method gives efficient direct access without requiring the file's data blocks to be contiguous?
