Bhutan Civil Service Main Examination (ICT Category) study materials
Bhutan Civil Service Main Examination (ICT Category) study resources

Bhutan Civil Service Main Examination (ICT Category) practice questions

One question at a time. Build your Bhutan Civil Service Main Examination (ICT Category) understanding.

First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.

Continue in the practice tool above to load more questions, 50 at a time.

Question 1Computer Fundamentals and Operating Systems

Which component of a computer system is responsible for performing arithmetic and logical operations?

  1. The hard disk controller
  2. The random access memory modules
  3. The arithmetic logic unit inside the CPU Correct answer.
  4. The power supply unit

Explanation

The arithmetic logic unit (ALU) is the part of the central processing unit that executes integer arithmetic and Boolean logic operations on data held in registers. Other components store data, move data, or supply power, but they do not themselves compute results.

Question 2Computer Fundamentals and Operating Systems

In a system using fixed-size pages and frames, which statement describes the purpose of the page table?

  1. It stores the contents of each page while the page is swapped out
  2. It maps virtual page numbers to physical frame numbers for a process Correct answer.
  3. It records the access rights of each user of the system
  4. It holds the machine instructions currently being executed

Explanation

The page table is a per-process data structure that translates the virtual page number of an address into the physical frame number where that page currently resides. It may also carry control bits such as valid and dirty flags, but its core role is address translation.

Question 3Computer Fundamentals and Operating Systems

A process repeatedly alternates between short CPU bursts and long I/O waits. Which scheduling policy is most likely to give good overall throughput and responsiveness for such a workload?

  1. Priority scheduling with static priorities assigned at creation
  2. Shortest remaining time first
  3. Round robin with a small time quantum Correct answer.
  4. First-come first-served with no preemption

Explanation

Round robin with a small quantum lets interactive, I/O-bound processes regain the CPU quickly after each I/O completion without monopolising it, which improves responsiveness and keeps devices busy. It also prevents long-running processes from starving others.

Question 4Computer Fundamentals and Operating Systems

Which of the following best describes the function of a device driver?

  1. It encrypts files stored on the disk before they are written
  2. It provides a graphical interface for launching application programs
  3. It compiles source code into machine instructions for the processor
  4. It translates generic operating system requests into commands understood by a specific hardware device Correct answer.

Explanation

A device driver is kernel-level or loadable software that knows the register layout and command protocol of a particular device, so it converts generic operating system I/O requests into device-specific operations. This abstraction lets the rest of the kernel treat dissimilar hardware uniformly.

Question 5Computer Fundamentals and Operating Systems

A file system stores a file as a chain of disk blocks. What is the main disadvantage of this allocation method compared with contiguous allocation?

  1. It makes random access slow because reaching block n requires following links from the start Correct answer.
  2. It cannot support files larger than one disk block
  3. It wastes space because every file occupies a whole number of cylinders
  4. It requires the entire file to be moved whenever it grows

Explanation

In chained allocation each block holds a pointer to the next, so locating the nth block demands traversing n-1 links, which makes random access inefficient. Contiguous allocation, by contrast, allows direct computation of any block address.

Question 6Computer Fundamentals and Operating Systems

Which of the following is an example of a real-time operating system?

  1. A general-purpose desktop distribution used for office work
  2. A batch system that runs payroll jobs overnight
  3. A freeRTOS-based kernel controlling an embedded motor controller Correct answer.
  4. A time-sharing system serving many interactive terminals

Explanation

A real-time operating system guarantees bounded response times so that deadlines are met, which is exactly what an embedded motor controller requires. The other examples are general-purpose, batch, or time-sharing systems that optimise throughput or fairness rather than determinism.

Question 7Computer Fundamentals and Operating Systems

Which statement correctly distinguishes a process from a thread within the same process?

  1. A thread always executes in kernel mode, whereas a process always executes in user mode
  2. Threads each have a private address space, while processes share one address space
  3. A process has its own address space, while threads of that process share the address space and open files Correct answer.
  4. A process can contain only one thread at any time

Explanation

A process is the unit of resource ownership, so it owns an address space, open file descriptors, and other resources. Threads are the units of execution within a process and share those resources while keeping their own registers and stack.

Question 8Computer Fundamentals and Operating Systems

A system uses demand paging. A page fault occurs when a running process references a page that is not currently in main memory. Which sequence of actions does the operating system typically perform?

  1. Increase the process priority and continue without loading the page
  2. Terminate the process immediately and report an error to the user
  3. Copy the entire process image into memory and resume execution from the beginning
  4. Locate a free frame, load the page from backing store, update the page table, and restart the faulting instruction Correct answer.

Explanation

Handling a page fault means finding a free or victim frame, reading the required page from backing store, updating the page table entry to point at the frame, and then re-executing the instruction that faulted. Terminating the process would defeat the purpose of demand paging.

Question 9Computer Fundamentals and Operating Systems

Which of the following conditions is necessary for a deadlock to occur among a set of processes?

  1. Every process requests all its resources before starting execution
  2. Processes release all held resources before requesting new ones
  3. The system has more resources than the total number requested
  4. Each process holds a resource while waiting for another resource held by another process Correct answer.

Explanation

Circular wait combined with hold-and-wait is one of the four Coffman conditions required for deadlock, and it captures the situation where each process keeps what it has while waiting for something another holds. If resources are requested all at once or released before new requests, the cycle cannot form.

Question 10Computer Fundamentals and Operating Systems

What is the primary purpose of the boot loader in a computer system?

  1. To load the operating system kernel into memory and transfer control to it Correct answer.
  2. To manage free space on the disk during normal operation
  3. To provide a command interpreter for interactive users
  4. To schedule processes after the kernel has started

Explanation

The boot loader runs from firmware or a boot sector and is responsible for locating, loading, and starting the operating system kernel. Once the kernel is running, the loader's job is complete.

Question 11Computer Fundamentals and Operating Systems

In the context of interprocess communication, what does a message queue provide that a shared memory segment does not?

  1. A structured, kernel-managed buffer that decouples sender and receiver timing Correct answer.
  2. Automatic elimination of all race conditions in the programs
  3. Guaranteed encryption of messages between processes
  4. Faster data transfer because no copying is involved

Explanation

A message queue is maintained by the kernel and holds discrete messages until a receiver retrieves them, so sender and receiver need not be synchronised in time. Shared memory is faster because it avoids copying but requires the processes to coordinate access themselves.

Question 12Computer Fundamentals and Operating Systems

Which of the following statements about the translation lookaside buffer is correct?

  1. It replaces the page table entirely once the system has started
  2. It holds the process control blocks of all running processes
  3. It stores the contents of recently written files
  4. It caches recently used virtual-to-physical address translations Correct answer.

Explanation

The translation lookaside buffer is a small, fast associative cache inside the memory management unit that holds recent page table entries. A hit avoids a memory access to the page table, reducing the cost of address translation.

Question 13Computer Fundamentals and Operating Systems

A disk has a seek time of 5 ms, a rotational latency of 3 ms, and a transfer time of 1 ms per block. What is the approximate time to read a single randomly located block?

  1. 15 ms
  2. 1 ms
  3. 9 ms Correct answer.
  4. 4 ms

Explanation

The access time for a random block is the sum of seek time, rotational latency, and transfer time, giving 5 + 3 + 1 = 9 ms. All three components occur before the data transfer completes.

Question 14Computer Fundamentals and Operating Systems

Which statement about the operating system kernel is accurate?

  1. It is responsible only for displaying the graphical user interface
  2. It is loaded only after all application programs have terminated
  3. It runs entirely in user mode to protect the system from programming errors
  4. It executes in a privileged mode that allows access to hardware and protected instructions Correct answer.

Explanation

The kernel executes in a privileged processor mode so that it can execute protected instructions, access hardware registers, and manage memory safely. User programs run in unprivileged mode and must request kernel services through system calls.

Question 15Computer Fundamentals and Operating Systems

In a file system that uses indexed allocation with a single-level index block, what limits the maximum size of a file?

  1. The total number of users who may open the file
  2. The speed of the disk's rotation
  3. The number of directories in which the file appears
  4. The number of blocks that the index block can address Correct answer.

Explanation

With single-level indexed allocation the index block holds one pointer per data block, so the file cannot contain more blocks than there are pointer slots. Multi-level or combined schemes are used to support larger files.

Question 16Computer Fundamentals and Operating Systems

Which of the following is the main advantage of using a microkernel architecture?

  1. It places most services outside the kernel, improving isolation and making the system easier to extend Correct answer.
  2. It removes the need for interprocess communication entirely
  3. It eliminates the need for context switches between processes
  4. It guarantees faster performance than a monolithic kernel for all workloads

Explanation

A microkernel keeps only essential mechanisms such as address-space management and interprocess communication in privileged mode, running other services as user-level servers. This improves fault isolation and modularity, though the extra message passing can cost performance.

Question 17Computer Fundamentals and Operating Systems

Which statement correctly describes the role of the program counter and the instruction register during the fetch-decode-execute cycle?

  1. Both registers hold identical values throughout the cycle
  2. The program counter holds the next instruction to fetch, while the instruction register holds the instruction currently being decoded Correct answer.
  3. The program counter stores the contents of memory, while the instruction register stores the contents of the disk
  4. The program counter holds the result of the last arithmetic operation, while the instruction register holds the address of the stack

Explanation

During fetch, the address in the program counter is used to read the next instruction, which is placed in the instruction register for decoding; the program counter is then advanced. The two registers therefore serve distinct purposes at different points of the cycle.

Question 18Computer Fundamentals and Operating Systems

A system has four processes with burst times 8, 4, 2, and 1 ms, all arriving at time 0. Using shortest job first, what is the average waiting time?

  1. 5.0 ms
  2. 3.5 ms
  3. 4.25 ms
  4. 2.75 ms Correct answer.

Explanation

Shortest job first runs the processes in the order 1, 2, 4, 8. Waiting times are 0, 1, 3, and 7 ms, which sum to 11 ms and give an average of 2.75 ms.

Question 19Computer Fundamentals and Operating Systems

What does the term thrashing describe in a virtual memory system?

  1. The disk controller retries failed read operations repeatedly
  2. A single process monopolises the processor for a long period
  3. The system spends most of its time swapping pages rather than executing useful work Correct answer.
  4. The processor executes instructions faster than memory can supply them

Explanation

Thrashing occurs when the sum of the processes' working sets exceeds available frames, so nearly every reference faults and the system spends its time paging. The remedy is to reduce the degree of multiprogramming or allocate more memory.

Question 20Computer Fundamentals and Operating Systems

Which of the following best explains why the operating system maintains separate user mode and kernel mode?

  1. To ensure that every process receives an equal share of the processor
  2. To allow application programs to execute privileged instructions directly
  3. To reduce the amount of main memory required by the kernel
  4. To prevent user programs from executing privileged instructions that could compromise the system Correct answer.

Explanation

Dual-mode operation creates a hardware-enforced boundary so that only trusted kernel code can execute privileged instructions such as those that modify page tables or disable interrupts. User programs must request such operations through controlled system calls.

Question 21Programming and Data Structures

In C, which header must be included to use the malloc and free functions?

  1. stdlib.h Correct answer.
  2. string.h
  3. stdio.h
  4. math.h

Explanation

The functions malloc, calloc, realloc and free are declared in the standard library header stdlib.h, so any program that allocates heap memory dynamically must include it. Without this declaration the compiler may assume an incorrect return type and produce undefined behaviour.

Question 22Programming and Data Structures

What is the time complexity of searching for a value in a balanced binary search tree with n nodes?

  1. O(n)
  2. O(log n) Correct answer.
  3. O(n log n)
  4. O(1)

Explanation

In a balanced binary search tree the height is proportional to log n, and a search follows one root-to-leaf path, so it performs O(log n) comparisons. The worst case degrades to O(n) only when the tree becomes a skewed chain.

Question 23Programming and Data Structures

Which data structure follows the Last-In-First-Out principle?

  1. Queue
  2. Stack Correct answer.
  3. Heap
  4. Linked list

Explanation

A stack inserts and removes elements at the same end, called the top, so the most recently pushed element is the first one popped. This Last-In-First-Out behaviour underlies function call management and expression evaluation.

Question 24Programming and Data Structures

A recursive function lacks a proper base case. What is the most likely consequence at run time?

  1. The loop counter resets to zero
  2. The recursion terminates with a wrong value
  3. The call stack overflows Correct answer.
  4. The compiler rejects the program

Explanation

Each recursive call consumes a new stack frame, and without a base case the calls never stop, so the stack space is exhausted and the program typically crashes with a stack overflow. Many compilers accept such code because the missing base case is a logical rather than a syntactic error.

Question 25Programming and Data Structures

Which of the following is a primitive data type in most programming languages?

  1. Integer Correct answer.
  2. Structure
  3. Stack
  4. Array

Explanation

Primitive types such as integer, character, boolean and floating-point are provided directly by the language and hold a single value. Arrays, structures and stacks are composite or abstract types built from primitives.

Question 26Programming and Data Structures

What does the expression 17 % 5 evaluate to in languages such as C and Java?

  1. 2 Correct answer.
  2. 3
  3. 0
  4. 3.4

Explanation

The modulo operator returns the remainder after integer division. Since 17 divided by 5 gives 3 with remainder 2, the result is 2.

Question 27Programming and Data Structures

Which traversal of a binary search tree visits nodes in ascending sorted order?

  1. Postorder
  2. Inorder Correct answer.
  3. Preorder
  4. Level order

Explanation

An inorder traversal processes the left subtree, then the node, then the right subtree. Because a binary search tree keeps smaller keys on the left and larger keys on the right, this sequence yields keys in ascending order.

Question 28Programming and Data Structures

A singly linked list stores only a head pointer. What is the complexity of inserting a new node at the front?

  1. O(n log n)
  2. O(n)
  3. O(log n)
  4. O(1) Correct answer.

Explanation

Inserting at the head requires only creating a node and redirecting its next pointer to the current head, then updating the head pointer. No traversal is needed, so the operation takes constant time regardless of list length.

Question 29Programming and Data Structures

What is the worst-case time complexity of quicksort when the pivot is always the smallest or largest element?

  1. O(n log n)
  2. O(n^2) Correct answer.
  3. O(n)
  4. O(log n)

Explanation

If every pivot splits the array into one empty part and one part of size n-1, the recursion depth becomes n and the total work is the sum 1+2+...+(n-1), which is O(n^2). Randomised or median-of-three pivot selection reduces the likelihood of this pattern.

Question 30Programming and Data Structures

A circular queue is implemented in an array of size 8 with front and rear indices. Which expression correctly computes the next rear position?

  1. (rear % 8) + 1
  2. 8 - rear
  3. (rear + 1) % 8 Correct answer.
  4. rear + 1

Explanation

Modulo arithmetic wraps the index back to zero after reaching the last slot, so (rear + 1) % 8 keeps the index within the valid range 0 to 7. This wrapping is what makes the queue circular and reuses freed space.

Question 31Programming and Data Structures

Which statement about a hash table with chaining is accurate when the load factor grows large?

  1. Average search time stays constant
  2. Average search time approaches linear Correct answer.
  3. Keys are stored in sorted order
  4. Collisions become impossible

Explanation

With chaining, each bucket holds a list of entries, and as the load factor rises the lists lengthen. The average number of comparisons per lookup therefore grows toward O(n), which is why implementations resize and rehash when the load factor exceeds a threshold.

Question 32Programming and Data Structures

In C, what does passing an argument by value to a function mean?

  1. The function can modify the caller's variable directly
  2. The function receives a copy of the argument Correct answer.
  3. The argument is evaluated only if used
  4. The function receives the address of the argument

Explanation

Pass by value copies the argument into the parameter, so changes made inside the function affect only the copy and leave the caller's variable unchanged. To let a function modify the original, C programmers pass a pointer explicitly.

Question 33Programming and Data Structures

A postfix expression evaluates to 9 when the tokens 5 4 + 3 * are processed. Which infix expression does this postfix form represent?

  1. (5 + 4) * 3 Correct answer.
  2. 5 + (4 * 3)
  3. 5 + 4 * 3
  4. 5 * 4 + 3

Explanation

Postfix evaluates left to right with a stack: 5 and 4 are pushed, the plus pops both and pushes 9, then 3 is pushed, and the multiply combines 9 and 3 to give 27. The structure therefore corresponds to (5 + 4) * 3, where the addition happens before the multiplication.

Question 34Programming and Data Structures

Which property must every node of a max-heap satisfy?

  1. The left child is always smaller than the right child
  2. Every leaf is at the same depth
  3. Each parent is greater than or equal to its children Correct answer.
  4. Nodes are stored in sorted array order

Explanation

The heap property for a max-heap requires that each node's key be at least as large as the keys of its children, which guarantees that the maximum resides at the root. It imposes no ordering between siblings and no requirement that the tree be perfectly filled at the leaf level.

Question 35Programming and Data Structures

What is the primary advantage of a doubly linked list over a singly linked list?

  1. It uses less memory per node
  2. It allows backward traversal and faster deletion given a node pointer Correct answer.
  3. It cannot contain duplicate values
  4. It supports constant-time random access

Explanation

Each node in a doubly linked list stores both next and previous pointers, so traversal can proceed in either direction and a node can be unlinked without scanning from the head. The cost is the extra pointer stored in every node.

Question 36Programming and Data Structures

A binary tree has 31 nodes and is a perfect binary tree. What is its height if a single node has height 0?

  1. 5
  2. 31
  3. 4 Correct answer.
  4. 6

Explanation

A perfect binary tree of height h contains 2^(h+1) - 1 nodes. Setting 2^(h+1) - 1 equal to 31 gives 2^(h+1) = 32, so h+1 = 5 and the height is 4.

Question 37Programming and Data Structures

Which algorithm design technique does merge sort primarily use?

  1. Greedy selection
  2. Dynamic programming
  3. Divide and conquer Correct answer.
  4. Backtracking

Explanation

Merge sort divides the array into halves, recursively sorts each half, and merges the sorted results. This split-solve-combine pattern is the defining characteristic of the divide-and-conquer technique.

Question 38Programming and Data Structures

In a binary search on a sorted array of 1000 elements, approximately how many comparisons are needed in the worst case?

  1. 10 Correct answer.
  2. 100
  3. 1000
  4. 500

Explanation

Binary search halves the search interval each step, so the number of comparisons is about log2(1000), which is just under 10. Each comparison therefore eliminates roughly half of the remaining candidates.

Question 39Programming and Data Structures

A function is defined as f(0) = 1 and f(n) = n * f(n-1) for n > 0. What does f compute?

  1. The factorial of n Correct answer.
  2. The nth power of two
  3. The sum of the first n integers
  4. The nth Fibonacci number

Explanation

The recurrence multiplies n by the result for n-1 and stops at 1, which is exactly the product n * (n-1) * ... * 1, the factorial. The base case f(0) = 1 corresponds to the conventional value 0! = 1.

Question 40Programming and Data Structures

A program declares an array of 10 integers and writes to index 10. What kind of error is this?

  1. Linker error
  2. Type mismatch error
  3. Syntax error
  4. Off-by-one out-of-bounds access Correct answer.

Explanation

Valid indices run from 0 to 9, so index 10 lies one position past the end of the array. This is the classic off-by-one out-of-bounds error, which in C produces undefined behaviour rather than a guaranteed diagnostic.

Question 41Programming and Data Structures

Which of the following correctly describes a stable sorting algorithm?

  1. It works only on integers
  2. It never uses extra memory
  3. It always runs in linear time
  4. It preserves the relative order of equal elements Correct answer.

Explanation

Stability means that two records with equal keys retain their original relative order after sorting, which matters when sorting by multiple fields in succession. Merge sort and insertion sort are stable, while quicksort and heapsort are generally not.

Question 42Programming and Data Structures

An algorithm's running time satisfies T(n) = 2T(n/2) + n with T(1) = 1. What is its asymptotic complexity?

  1. O(n)
  2. O(n^2)
  3. O(log n)
  4. O(n log n) Correct answer.

Explanation

The recurrence splits the problem into two halves and spends linear time combining them, which the master theorem resolves to O(n log n). This is precisely the recurrence for merge sort.

Question 43Programming and Data Structures

Which condition causes a deadlock among processes competing for resources?

  1. Starvation of a low-priority process
  2. Priority inversion without circular wait
  3. Circular wait with no preemption and mutual exclusion Correct answer.
  4. Preemption of resources by the scheduler

Explanation

Deadlock requires all four Coffman conditions: mutual exclusion, hold and wait, no preemption, and circular wait. Removing any one of them, for example by allowing preemption, prevents the deadlock from occurring.

Question 44Programming and Data Structures

A hash function maps keys to 10 buckets, and 100 keys are inserted with uniform hashing. What is the expected average chain length?

  1. 0.1
  2. 100
  3. 1
  4. 10 Correct answer.

Explanation

The load factor equals the number of keys divided by the number of buckets, so 100 divided by 10 gives an expected chain length of 10. This illustrates why resizing keeps the load factor near a small constant.

Question 45Database Management Systems

In relational theory, which property must hold for a relation (table) to be in first normal form (1NF)?

  1. There are no transitive dependencies among non-key attributes
  2. Every attribute contains only atomic, indivisible values Correct answer.
  3. Every determinant is a candidate key
  4. Every non-key attribute is fully functionally dependent on the whole primary key

Explanation

First normal form requires that each cell of a relation hold a single atomic value, so repeating groups and multi-valued attributes are eliminated by placing them in separate relations. The other properties describe higher normal forms: full functional dependency relates to 2NF, no transitive dependency to 3NF, and every determinant being a candidate key to BCNF.

Question 46Database Management Systems

A table has a composite primary key (StudentID, CourseID) and a non-key column StudentName that depends only on StudentID. Which normal form does this table violate?

  1. Domain-key normal form
  2. Second normal form Correct answer.
  3. Fourth normal form
  4. Third normal form

Explanation

Second normal form forbids partial dependencies, where a non-key attribute depends on only part of a composite key. Because StudentName depends on StudentID alone rather than on the full key (StudentID, CourseID), the relation violates 2NF.

Question 47Database Management Systems

Which SQL clause is used to filter groups produced by GROUP BY, as opposed to filtering individual rows?

  1. ORDER BY
  2. WHERE
  3. DISTINCT
  4. HAVING Correct answer.

Explanation

HAVING is evaluated after grouping and can reference aggregate results such as COUNT(*) or SUM(amount), so it filters whole groups. WHERE filters individual rows before grouping and therefore cannot test aggregate values.

Question 48Database Management Systems

Given tables Employee(emp_id, name, dept_id) and Department(dept_id, dept_name), which query lists every department even when it has no employees?

  1. SELECT d.dept_name FROM Department d LEFT JOIN Employee e ON d.dept_id = e.dept_id Correct answer.
  2. SELECT d.dept_name FROM Employee e RIGHT JOIN Department d ON e.dept_id = d.dept_id WHERE e.emp_id IS NULL
  3. SELECT d.dept_name FROM Department d JOIN Employee e ON d.dept_id = e.dept_id
  4. SELECT d.dept_name FROM Department d CROSS JOIN Employee e

Explanation

A LEFT JOIN preserves all rows of the left table (Department) regardless of matches, filling unmatched employee columns with NULL, so every department appears. An inner join would drop departments without employees, and a cross join multiplies rows instead of preserving them once.

Question 49Database Management Systems

Which statement about a candidate key is correct?

  1. A relation can have at most one candidate key
  2. A candidate key may contain duplicate values as long as they are not all NULL
  3. A candidate key must be a foreign key in another relation
  4. A relation may have several candidate keys, and each uniquely determines every tuple Correct answer.

Explanation

A candidate key is a minimal set of attributes that uniquely identifies each tuple, and a relation can have more than one such set; the designer then chooses one as the primary key. Uniqueness is mandatory, so duplicate values are not allowed.

Question 50Database Management Systems

In a table, the column dept_id references Department(dept_id) and a value of 99 is inserted that does not exist in Department. Which constraint rejects the insert?

  1. A CHECK constraint
  2. A UNIQUE constraint
  3. A NOT NULL constraint
  4. A foreign key constraint Correct answer.

Explanation

A foreign key constraint enforces referential integrity: every value in the referencing column must match an existing value in the referenced table or be NULL. Inserting 99 with no matching department therefore violates the constraint.