NTS NAT-ICS Computer Science Fundamentals MCQs Practice Set for October 26, 2026
This independent NAT-ICS-style practice set focuses on computer science fundamentals: converting between number systems, applying Boolean logic, tracing pseudocode, choosing suitable data structures, interpreting basic SQL, and understanding networking and operating-system concepts. Questions progress from direct recall to short applications, and every answer includes reasoning. This is practice material, not an official syllabus or a reproduction of a past paper; test arrangements and covered topics can vary, so consult the latest official notice for current information.
Why this NTS NAT-ICS Computer Science Fundamentals set is useful
Work through 100 original computer science MCQs for independent NTS NAT-ICS preparation. The set practises binary and Boolean operations, pseudocode, algorithms and data structures, database concepts, networking, and operating systems, with four options and an explanation for every answer. Start with this focused set, then continue with the MCQsBase question bank, online quiz practice, past papers, and the complete MCQsBase blog.
Test focus topics
| No. | Focus Area | What to Practice |
|---|---|---|
| 1 | Number systems and digital logic | Convert small binary and hexadecimal values, apply Boolean operators, and recognize basic computer hardware and data representation. |
| 2 | Programming fundamentals | Trace short pseudocode carefully, including conditions, loops, arrays, functions, recursion, and integer division. |
| 3 | Algorithms and data structures | Identify suitable structures and search or traversal methods, and interpret common time-complexity descriptions. |
| 4 | Databases and SQL | Distinguish keys, constraints, normalization, transactions, and common query clauses. |
| 5 | Networking and operating systems | Review network addressing and protocols alongside processes, memory, synchronization, and basic security. |
What this set covers
| Section | Questions | Focus |
|---|---|---|
| Set 1 | 1-20 | Core NTS NAT-ICS Computer Science Fundamentals fundamentals |
| Set 2 | 21-40 | Foundational test concepts |
| Set 3 | 41-60 | Mixed exam-style practice |
| Set 4 | 61-80 | Fast recall and elimination practice |
| Set 5 | 81-100 | Final revision and score-building |
Choose one option, then check the bold answer.
What is the decimal value of the binary number 101101?
Correct Answer
C) 45
Using place values, 101101₂ equals 1×32 + 0×16 + 1×8 + 1×4 + 0×2 + 1×1 = 45.
What is the sum of the binary numbers 11010 and 01011?
Correct Answer
A) 100101
11010₂ is 26 and 01011₂ is 11. Their sum is 37, which is 100101₂.
In 8-bit two's-complement notation, how is the decimal number −5 represented?
Correct Answer
C) 11111011
Write +5 as 00000101, invert the bits to get 11111010, then add 1. The result is 11111011.
What is the decimal value of hexadecimal 3A?
Correct Answer
C) 58
In hexadecimal, A represents 10. Thus 3A₁₆ = 3×16 + 10 = 58.
Using the binary convention that n bits represent 2ⁿ distinct patterns, how many patterns can 4 bits represent?
Correct Answer
C) 16
There are 2ⁿ possible patterns for n bits. With 4 bits, 2⁴ = 16.
For Boolean values A = 1 and B = 0, what is the value of (A AND B) OR NOT B?
Correct Answer
B) 1
A AND B is 1 AND 0, which is 0. NOT B is NOT 0, which is 1. Therefore 0 OR 1 equals 1.
What is the output of a NAND gate when both inputs are 1?
Correct Answer
A) 0
AND of two 1 inputs is 1. NAND negates that result, so its output is 0.
What is the result of 1 XOR 1?
Correct Answer
A) 0
XOR is 1 when its inputs differ. Since both inputs are 1, they do not differ and the result is 0.
Which expression is equivalent to NOT (A OR B) under De Morgan's law?
Correct Answer
B) NOT A AND NOT B
De Morgan's law states that negating an OR expression changes OR to AND and negates each input: NOT (A OR B) = NOT A AND NOT B.
How many distinct input combinations are possible for a Boolean function with three binary inputs?
Correct Answer
C) 8
Each of the three inputs has two possible values, so the total is 2×2×2 = 2³ = 8.
Under the traditional ASCII character set, how many bits are used to encode a character?
Correct Answer
B) 7
Traditional ASCII is a 7-bit character encoding and therefore defines 128 possible codes. Extended encodings that use 8 bits are not the original ASCII standard.
For this question, use the binary convention 1 KiB = 1024 bytes. How many bytes are in 3 KiB?
Correct Answer
B) 3,072
At 1024 bytes per KiB, 3 KiB contains 3×1024 = 3,072 bytes.
Which CPU component performs arithmetic calculations and logical comparisons?
Correct Answer
B) Arithmetic logic unit
The arithmetic logic unit, or ALU, performs arithmetic operations and Boolean or comparison operations. The control unit directs instruction execution.
Which type of memory normally loses its stored contents when power is removed?
Correct Answer
A) RAM
Main RAM is generally volatile, so its contents are lost when power is removed. ROM, flash memory, and optical discs retain data without continuous power.
Why is CPU cache generally useful?
Correct Answer
A) It stores frequently or recently needed data close to the CPU
Cache provides faster access than main memory for data or instructions the CPU is likely to need again. It is small and does not replace long-term storage.
A processor clock frequency of 2 GHz means approximately how many clock cycles per second?
Correct Answer
C) 2 billion
The prefix giga means 10⁹. Therefore, 2 GHz represents 2×10⁹, or 2 billion, cycles per second.
Which sequence best describes a simplified instruction cycle?
Correct Answer
B) Fetch, decode, execute
In a simplified instruction cycle, the processor fetches an instruction, decodes what it means, and executes it.
Which kind of memory is designed to retain its contents without power and is commonly used for firmware storage?
Correct Answer
C) ROM
ROM is non-volatile memory commonly used to store firmware. RAM, cache, and processor registers are generally volatile.
Which statement about a byte is correct?
Correct Answer
B) A byte is 8 bits
A byte consists of 8 bits. Larger storage units are built from bytes; they do not change the size of a byte.
Which hardware component is primarily responsible for supplying electrical power to a desktop computer's internal components?
Correct Answer
A) Power supply unit
The power supply unit converts incoming electrical power into suitable outputs for the computer's components. A heat sink dissipates heat, and a drive stores data.
Choose one option, then check the bold answer.
Assume pseudocode assignments execute in order. If x starts at 4 and then x is assigned 3 × x + 2, what is x afterward?
Correct Answer
B) 14
Substitute the starting value: 3×4 + 2 = 12 + 2 = 14.
In the following pseudocode, what is printed? x = 7; if x < 5 then print 1 else print 2.
Correct Answer
B) 2
The condition 7 < 5 is false, so execution follows the else branch and prints 2.
A loop adds each integer from 1 through 4, including both endpoints. What is the final sum?
Correct Answer
C) 10
The loop adds 1 + 2 + 3 + 4 = 10. Including both endpoints is important here.
In a zero-indexed array, what is the index of the third element?
Correct Answer
B) 2
Zero-indexing assigns index 0 to the first element, 1 to the second, and 2 to the third.
A function returns 2n + 1. What does it return when n = 6?
Correct Answer
C) 13
Substitute 6 for n: 2×6 + 1 = 13.
Assume AND is evaluated on Boolean values. When is the expression A AND B true?
Correct Answer
A) Only when A is true and B is true
Boolean AND requires both inputs to be true. The option describing at least one true input is the rule for OR.
In this pseudocode, integer division discards the fractional part. Starting with x = 16, the loop repeats while x > 1 and sets x = x / 2 each time. How many times does it repeat?
Correct Answer
B) 4
The successive values are 16, 8, 4, 2, and 1. The body runs for 16, 8, 4, and 2, so it runs four times.
Using the recursive definition factorial(1) = 1 and factorial(n) = n × factorial(n − 1), what is factorial(4)?
Correct Answer
C) 24
factorial(4) = 4×3×2×1 = 24. The base case stops the recursion at 1.
In a function call, what is a parameter?
Correct Answer
A) A value or variable named in the function definition to receive input
A parameter is named in a function definition and receives an argument when the function is called. It is not a hardware component or an error.
A conditional checks x > 3 AND x < 8. Which value of x makes the condition true?
Correct Answer
B) 5
The value must be strictly greater than 3 and strictly less than 8. Five meets both tests; the endpoints do not.
What is the value of total after this pseudocode finishes? total = 0; for i = 1 to 3 inclusive, total = total + 2 × i.
Correct Answer
C) 12
The loop adds 2×1, 2×2, and 2×3. The total is 2 + 4 + 6 = 12.
In a language where a function returns immediately when it reaches a return statement, what does this function return for n = 5? function f(n): if n > 0 return n; return 0.
Correct Answer
C) 5
Since 5 > 0, the first return statement executes and returns 5. The later return 0 is not reached.
If a loop starts with i = 0 and repeats while i < 3, increasing i by 1 after each iteration, how many iterations occur?
Correct Answer
B) 3
The loop body runs when i is 0, 1, and 2. At i = 3, the condition is false.
If the string value is 'COMPUTER', what does a zero-indexed character array return at index 2?
Correct Answer
C) M
The characters have indices C at 0, O at 1, and M at 2. Therefore, index 2 contains M.
A function call supplies the argument 9 to a parameter n. If the function returns n − 4, what value is returned?
Correct Answer
B) 5
The parameter n receives 9. The function computes 9 − 4 = 5.
Assume integer division discards the fractional part. What is the result of 17 divided by 5 using integer division?
Correct Answer
B) 3
Five fits into 17 three whole times, with a remainder of 2. Integer division returns the quotient 3 and discards the fraction.
In pseudocode, x begins at 2. The statements are: x = x + 3; x = 2 × x. What is x at the end?
Correct Answer
C) 10
Assignments happen in order. First x becomes 2 + 3 = 5; then it becomes 2×5 = 10.
If a function is called with x = 4 and returns x², what value does it return?
Correct Answer
C) 16
Squaring means multiplying the value by itself: 4² = 4×4 = 16.
In a Boolean condition, what does NOT false evaluate to?
Correct Answer
B) True
The NOT operator reverses a Boolean value. Negating false gives true.
What is the worst-case time complexity of linear search through an array of n items?
Correct Answer
C) O(n)
In the worst case, linear search examines every item before finding the target or determining it is absent. The number of checks grows in proportion to n.
Choose one option, then check the bold answer.
A binary search is performed on the sorted list [2, 5, 8, 12, 16]. Using zero-based indices and the lower middle index for each search range, how many comparisons are needed to find 12?
Correct Answer
B) 2
The first middle item is 8 at index 2, which is less than 12. The remaining range has 12 as its middle item, so the second comparison finds it.
Which data structure follows the last-in, first-out rule?
Correct Answer
B) Stack
A stack removes its most recently added item first, which is last-in, first-out. A queue instead follows first-in, first-out.
Which data structure normally follows the first-in, first-out rule?
Correct Answer
B) Queue
A standard queue removes items in their arrival order: first in, first out.
What is the worst-case time complexity of merge sort on n items?
Correct Answer
C) O(n log n)
Merge sort divides the input into about log n levels and processes about n items at each level, giving O(n log n) time.
In a binary search tree with distinct keys, which ordering rule applies at each node?
Correct Answer
A) All left-subtree keys are smaller and all right-subtree keys are larger
For the standard binary search tree rule with distinct keys, values in the left subtree are smaller than the node, and values in the right subtree are larger.
A connected, acyclic tree has n vertices. How many edges does it have?
Correct Answer
A) n − 1
A basic property of trees is that a connected tree with n vertices has exactly n − 1 edges. An extra edge would create a cycle.
Which data structure is most directly used to implement breadth-first search?
Correct Answer
A) Queue
Breadth-first search visits nodes in the order they are discovered, so a FIFO queue holds the next nodes to process.
Which method is commonly used to implement depth-first search?
Correct Answer
B) A stack or recursion
Depth-first search follows a path before backtracking. A stack, either explicit or provided by recursive function calls, supports this behavior.
What does a collision mean in a hash table?
Correct Answer
A) Two different keys produce the same hash location
A collision occurs when distinct keys map to the same table location. Hash tables use collision-handling methods such as chaining or probing.
What does it mean for a sorting algorithm to be stable?
Correct Answer
B) It preserves the relative order of equal-key items
A stable sort leaves equal-key items in the same relative order they had in the input. Stability does not specify a fixed running time.
What is the time complexity of accessing an array element by its index, assuming ordinary random-access memory?
Correct Answer
A) O(1)
An array's indexed address can be calculated directly from its base address and element size, so access takes constant time under this model.
What is the main purpose of a base case in a recursive function?
Correct Answer
A) To stop recursion when a simple condition is reached
A base case provides a condition that returns without making another recursive call. Without an appropriate stopping case, recursion may continue indefinitely.
A graph has 6 vertices and 7 edges. What is the sum of the degrees of its vertices, counting an undirected edge at both endpoints?
Correct Answer
C) 14
In an undirected graph, each edge contributes 1 to the degree of each of its two endpoints. The degree sum is therefore 2×7 = 14.
Which algorithm finds shortest paths from a source in a graph with non-negative edge weights?
Correct Answer
A) Dijkstra's algorithm
Dijkstra's algorithm finds shortest paths from a source when edge weights are non-negative. It is not generally suitable for graphs containing negative-weight edges.
What is the time complexity of checking whether an item is present in an unsorted array by examining items one at a time?
Correct Answer
C) O(n) in the worst case
If the item is at the end or absent, all n items may need to be examined. This is linear worst-case time.
Which structure is a natural choice for representing a collection where each item points to the next item?
Correct Answer
A) Linked list
In a singly linked list, each node stores data and a link to the next node. A queue describes an access rule, not necessarily this storage representation.
For a simple adjacency matrix representation of a graph with V vertices, how many matrix entries are used?
Correct Answer
C) V²
An adjacency matrix has one row and one column for each vertex, giving V×V entries.
Which statement best describes Big O notation?
Correct Answer
B) It describes how resource use grows with input size, up to constant factors
Big O describes an asymptotic growth bound for time or space as input size increases. It does not give an exact time in seconds.
Which database key is intended to identify each row uniquely and cannot contain a NULL value?
Correct Answer
A) Primary key
A primary key uniquely identifies each row and must have a value for every row. A foreign key instead refers to a key in another or the same table.
What is the main role of a foreign key in a relational database?
Correct Answer
A) To reference a key in another table and support relationships
A foreign key links rows by referring to a candidate or primary key. It can help enforce referential integrity.
Choose one option, then check the bold answer.
Which SQL clause selects rows that meet a condition?
Correct Answer
A) WHERE
WHERE filters rows according to a condition. ORDER BY sorts the result, while CREATE and ALTER define or change database objects.
Which SQL clause arranges query results by one or more columns?
Correct Answer
B) ORDER BY
ORDER BY sorts the rows returned by a query. GROUP BY instead groups rows, commonly for aggregate calculations.
What does the SQL expression COUNT(*) count in a query result group?
Correct Answer
A) The number of rows
COUNT(*) counts rows in the result group, regardless of whether particular column values are NULL. COUNT(column) has different NULL-handling behavior.
Which database design principle is associated with first normal form?
Correct Answer
A) Each field holds an atomic value rather than a repeating list of values
First normal form requires values in each field to be atomic in the context of the table and avoids repeating groups. It does not require every table to have one row.
In the ACID properties of transactions, what does atomicity mean?
Correct Answer
A) A transaction is treated as all-or-nothing
Atomicity means the transaction's operations either all take effect or none do. This prevents a partial transaction from being left as the final result.
Which SQL condition correctly tests whether a column has no value represented by NULL?
Correct Answer
B) column IS NULL
SQL uses IS NULL to test for NULL. Ordinary equality comparisons with NULL do not evaluate as a normal true-or-false equality test.
What is the purpose of a database index?
Correct Answer
A) To help locate rows more efficiently, often at the cost of extra storage and update work
An index can speed up suitable searches, but it uses storage and must be maintained when data changes. It does not guarantee constant time for every query.
Which SQL command is used to retrieve data from a table?
Correct Answer
A) SELECT
SELECT retrieves data. INSERT adds rows, DELETE removes rows, and DROP removes a database object.
What is a candidate key?
Correct Answer
A) A minimal set of attributes that uniquely identifies a row
A candidate key uniquely identifies rows, and it is minimal: removing an attribute would make it no longer uniquely identifying.
Which SQL clause groups rows so that aggregate functions can be applied to each group?
Correct Answer
A) GROUP BY
GROUP BY collects rows sharing selected values into groups, which can then be summarized with aggregate functions such as COUNT or SUM.
What does an INNER JOIN return when joining two tables on a matching condition?
Correct Answer
A) Rows with matching values in both tables
An INNER JOIN returns row combinations for which the join condition matches. An unmatched row from either side is not included.
Which protocol is primarily used to resolve a domain name such as example.test to an IP address?
Correct Answer
A) DNS
The Domain Name System resolves domain names to records such as IP addresses. SMTP is used for email transfer, while ARP has a different local-network role.
Which transport protocol provides reliable, ordered delivery through a connection-oriented service?
Correct Answer
A) TCP
TCP establishes a connection and provides mechanisms for reliable, ordered delivery. UDP is connectionless and does not provide the same delivery guarantees.
Which transport protocol is connectionless and does not itself guarantee delivery or ordering?
Correct Answer
B) UDP
UDP sends datagrams without TCP-style connection establishment, retransmission, or ordered delivery guarantees. Applications can add their own reliability mechanisms if needed.
What is the primary role of a router?
Correct Answer
A) To forward packets between networks
A router examines network-layer addressing and forwards packets toward other networks. It is not a compiler or general-purpose file-storage device.
On a typical Ethernet LAN, what does a network switch primarily use to forward frames within the local network?
Correct Answer
A) MAC addresses
A typical Ethernet switch learns MAC addresses and forwards frames within a local network based on those link-layer addresses.
Network bandwidth is commonly measured in which unit?
Correct Answer
A) Bits per second
Bandwidth for a data link is commonly expressed in bits per second, such as megabits per second. A data-transfer rate in bytes per second is a related but different unit.
How many bits are in an IPv4 address?
Correct Answer
B) 32
An IPv4 address has 32 bits, usually written as four decimal octets. IPv6 addresses have 128 bits.
Assume a conventional IPv4 /24 subnet with one network address and one broadcast address reserved. How many addresses are available for hosts?
Correct Answer
C) 254
A /24 leaves 32 − 24 = 8 host bits, giving 2⁸ = 256 total addresses. Under the stated conventional assumption, subtract the network and broadcast addresses: 256 − 2 = 254.
What does HTTPS provide for web communication that plain HTTP does not provide by itself?
Correct Answer
A) Communication protected using TLS
HTTPS is HTTP carried over TLS, which can protect data in transit and authenticate the server through certificates. It does not guarantee that a site's claims are true.
Choose one option, then check the bold answer.
Which OSI model layer is most directly associated with logical IP addressing and routing?
Correct Answer
A) Network layer
The network layer handles logical addressing and routing between networks. The physical layer concerns transmission of raw signals.
What is a network packet?
Correct Answer
A) A formatted unit of data carried across a network
Data is commonly divided and formatted into packets for transmission. A packet is not itself a physical connector or a processor-memory component.
What is an IP address primarily used for?
Correct Answer
A) Logical identification and delivery of data across IP networks
IP addresses identify network interfaces logically for packet delivery and routing. They do not describe file contents or device power.
In operating-system terminology, what is a process?
Correct Answer
A) A program in execution, along with its execution state and resources
A process is a running instance of a program, with state and resources managed by the operating system. A program file alone is not yet a running process.
What is a thread in a process?
Correct Answer
A) A unit of execution that can be scheduled within a process
A thread is an execution path within a process. Threads in one process commonly share process resources, while maintaining their own execution state.
What is the operating system's scheduler responsible for?
Correct Answer
A) Selecting which ready process or thread runs on a processor
The scheduler allocates processor time by choosing among tasks that are ready to run. It does not perform unrelated jobs such as creating hardware.
What is virtual memory?
Correct Answer
A) A memory-management technique that gives processes a virtual address space and can use storage to support it
Virtual memory separates a process's address space from physical RAM. Operating systems can use storage as backing for pages that are not currently in RAM, though this is much slower than RAM.
In a system using virtual memory, what commonly happens when a process accesses a page that is not currently in physical memory?
Correct Answer
A) A page fault occurs
A reference to a page not currently mapped in physical memory triggers a page fault. The operating system then handles the situation, potentially loading the page from storage.
Which part of an operating system is its central component for managing core system functions?
Correct Answer
A) Kernel
The kernel is the core of an operating system and manages functions such as processes, memory, and hardware access. A browser and text editor are application programs.
What is a mutex commonly used for?
Correct Answer
A) Ensuring that only one thread at a time enters a protected critical section
A mutex provides mutual exclusion, allowing one thread at a time to access a protected section or resource. It does not perform network name resolution or data sorting.
What is a race condition?
Correct Answer
A) A result that depends on the timing or ordering of concurrent operations
A race condition occurs when concurrent operations access or change shared state and the outcome depends on their execution order.
Which set lists the four classic necessary conditions commonly associated with deadlock?
Correct Answer
A) Mutual exclusion, hold and wait, no preemption, circular wait
The classic Coffman conditions are mutual exclusion, hold and wait, no preemption, and circular wait. Breaking at least one condition can prevent deadlock.
What is the main purpose of a compiler?
Correct Answer
A) To translate source code into another form, such as machine code or an intermediate representation
A compiler translates source code into a target representation. Compilation can detect some errors, but it cannot guarantee that the program's logic is correct.
What is the usual role of a linker?
Correct Answer
A) To combine object files and resolve references between program components
A linker combines compiled object files and libraries and resolves references needed to form an executable or another linked output.
Which practice is most useful for finding errors in a small, separately testable function?
Correct Answer
A) Unit testing
A unit test checks a small component, such as a function, in isolation against expected behavior. It is more direct than changing unrelated system settings.
Which security principle recommends giving a user or program only the permissions necessary for its task?
Correct Answer
A) Least privilege
Least privilege limits permissions to what is needed for a role or task. This can reduce the harm caused by mistakes or compromised accounts.
Which statement best describes encryption?
Correct Answer
A) It transforms information using a key so that authorized decryption can recover it
Encryption protects confidentiality by transforming readable data into ciphertext using a key. It does not by itself guarantee accuracy or erase all copies.
In symmetric-key encryption, how are the encryption and decryption keys related?
Correct Answer
A) The same shared secret key is used for both operations
Symmetric encryption uses the same secret key, or equivalent shared secret material, to encrypt and decrypt. The key must be protected and shared securely.
What is phishing?
Correct Answer
A) A deceptive attempt to trick people into revealing information or taking an unsafe action
Phishing uses deceptive messages or sites to manipulate people into sharing credentials, financial information, or other sensitive data.
What is ransomware designed to do?
Correct Answer
A) Restrict access to data, often by encrypting it, and demand payment
Ransomware is malicious software that commonly encrypts or otherwise blocks access to data and demands payment. Paying does not guarantee recovery.
How to revise this NTS NAT-ICS Computer Science Fundamentals set
- For binary and hexadecimal questions, write place values before converting; check the result by converting it back to decimal.
- Trace pseudocode in a small table with one row per loop iteration. Keep track of the value tested and the value updated separately.
- Do not treat Big O as an exact running time. Compare how the number of operations grows as the input size increases.
- When revising data structures, connect each structure to its defining rule: a stack is LIFO, a queue is FIFO, and a binary search tree orders values by its branches.
- For SQL, identify whether a clause filters rows, groups rows, or sorts results before choosing an answer.
- Review the explanations for options you nearly selected; a recurring confusion, such as RAM versus storage or TCP versus UDP, is a useful revision target.
Frequently Asked Questions
Are these official NAT-ICS questions?
No. They are original, independently written practice questions. They should not be treated as official questions or as a confirmed description of the current test syllabus.
How should I use the explanations while practising?
Attempt each question before looking at its answer. For calculation or tracing items, write down intermediate steps, then compare your method with the explanation and note the rule you missed.
Why do some programming questions specify pseudocode rules?
Small details such as whether a loop includes its endpoint or how integer division works can change an answer. The relevant assumptions are stated in those questions to keep the result unambiguous.
What should I do if the actual test format differs from this practice set?
Use this set to review computer science concepts, then follow the latest official notice for the current test format and arrangements. Independent practice cannot establish what will appear on a particular test.
Final Takeaway
Consistent daily MCQ practice is one of the simplest ways to improve recall, speed, and exam confidence. Bookmark this page, complete the 100 NTS NAT-ICS Computer Science Fundamentals MCQs, and continue your preparation on McqsBase.