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 Science
Which number system uses only the digits 0 and 1 and is the natural representation for binary digital circuits?
- Decimal number system
- Binary number system Correct answer.
- Octal number system
- Hexadecimal number system
Explanation
The binary system has base 2, so each digit position can hold only 0 or 1. This matches the two stable states (off/on) of digital logic circuits, which is why computers store data in binary.
Question 2Computer Science
What is the decimal value of the binary number 1011?
- 13
- 11 Correct answer.
- 9
- 15
Explanation
Evaluate place values from the right: 1x1 + 1x2 + 0x4 + 1x8 = 11. The zero in the fours position contributes nothing, so the total is 11.
Question 3Computer Science
In Boolean algebra, which gate produces a HIGH output only when all of its inputs are HIGH?
- NOR gate
- AND gate Correct answer.
- XOR gate
- OR gate
Explanation
The AND gate implements logical multiplication, so its output is 1 only when every input is 1. If any single input is 0, the output becomes 0.
Question 4Computer Science
Which of the following is an example of system software rather than application software?
- Operating system Correct answer.
- Spreadsheet program
- Photo editor
- Web browser
Explanation
System software manages hardware and provides a platform for other programs; an operating system is the classic example. Spreadsheets, browsers and photo editors are application software that serve specific user tasks.
Question 5Computer Science
Which generation of computers used integrated circuits as its main electronic component?
- First generation
- Second generation
- Fourth generation
- Third generation Correct answer.
Explanation
Third-generation computers replaced individual transistors with integrated circuits, which packed many components onto a single chip. First generation used vacuum tubes, second used discrete transistors, and fourth used microprocessors.
Question 6Computer Science
What is the primary function of the ALU inside a CPU?
- To perform arithmetic and logical operations Correct answer.
- To manage network addresses
- To convert analog signals to digital form
- To store programs permanently
Explanation
The Arithmetic Logic Unit carries out operations such as addition, subtraction and comparisons on data held in registers. Control and storage duties belong to other CPU sections and memory.
Question 7Computer Science
In a computer network, what does the acronym LAN stand for?
- Large Area Network
- Long Access Node
- Linked Access Network
- Local Area Network Correct answer.
Explanation
A LAN is a Local Area Network, a network confined to a small area such as a school lab or an office building. It contrasts with WAN, which spans large geographic distances.
Question 8Computer Science
Which HTML tag is used to create the largest heading on a web page?
- <head>
- <h1> Correct answer.
- <title>
- <h6>
Explanation
HTML provides heading tags h1 through h6, where h1 is the highest-level and largest heading. The <head> and <title> elements describe the document rather than displaying a heading.
Question 9Computer Science
A student converts the decimal number 25 into binary. Which result is correct?
- 10011
- 10101
- 11001 Correct answer.
- 11011
Explanation
Repeated division by 2 gives remainders 1,0,0,1,1 read upward, producing 11001. Checking place values: 16+8+1 = 25, which confirms the answer.
Question 10Computer Science
What is the hexadecimal equivalent of the binary number 1111 1010?
- FA Correct answer.
- F5
- 1A
- AF
Explanation
Split the binary number into 4-bit groups: 1111 = F and 1010 = A, so the hexadecimal form is FA. Each hex digit maps to exactly four binary bits.
Question 11Computer Science
Which of these is a valid IPv4 address?
- 192.168.1
- 256.100.10.1
- 192.168.1.1 Correct answer.
- 192.168.1.1.5
Explanation
An IPv4 address has exactly four octets, each in the range 0 to 255, separated by dots. Only 192.168.1.1 satisfies both the count and range rules.
Question 12Computer Science
Which protocol is responsible for reliably transferring web pages between a web server and a browser?
- DNS
- SMTP
- HTTP Correct answer.
- FTP
Explanation
HTTP (HyperText Transfer Protocol) is the application-layer protocol used to request and deliver web pages. It typically runs over TCP, which supplies the reliable transport.
Question 13Computer Science
In a relational database, what is a primary key?
- A field that uniquely identifies each record in a table Correct answer.
- A field that may contain duplicate values
- A field that stores only numeric data
- A field that links two unrelated tables
Explanation
A primary key uniquely identifies every row in a table and cannot contain duplicate or null values. This uniqueness is what allows records to be referenced reliably from other tables.
Question 14Computer Science
Which SQL clause is used to filter rows returned by a SELECT statement?
- GROUP BY
- WHERE Correct answer.
- HAVING
- ORDER BY
Explanation
The WHERE clause applies a condition to individual rows before they are returned, keeping only matching rows. ORDER BY sorts results and GROUP BY aggregates them.
Question 15Computer Science
What does the term 'algorithm' mean in computer science?
- A type of programming language
- A hardware device for storing data
- A finite step-by-step procedure for solving a problem Correct answer.
- A physical component of the CPU
Explanation
An algorithm is a finite, ordered set of unambiguous steps that transforms input into a desired output. It is a logical procedure, independent of any particular programming language or hardware.
Question 16Computer Science
Which flowchart symbol is used to represent a decision or condition?
- Parallelogram
- Rectangle
- Diamond Correct answer.
- Oval
Explanation
A diamond (rhombus) marks a decision point with one input and two or more outputs, such as Yes and No branches. Rectangles show processes and parallelograms show input or output.
Question 17Computer Science
Which of the following is a valid variable name in most high-level programming languages such as C?
- total marks
- int
- total_marks Correct answer.
- 2ndMark
Explanation
An identifier must begin with a letter or underscore and may then contain letters, digits and underscores, and it cannot be a reserved keyword. 'total_marks' follows all these rules.
Question 18Computer Science
In C, what is the value of the expression 7 % 2?
- 0
- 3.5
- 1 Correct answer.
- 3
Explanation
The modulus operator % returns the remainder after integer division. Since 7 divided by 2 is 3 with remainder 1, the result is 1.
Question 19Computer Science
Which logic gate is known as the universal gate because any other logic gate can be built from it alone?
- NAND gate Correct answer.
- XOR gate
- AND gate
- Buffer
Explanation
NAND (and NOR) are called universal gates because combinations of them can implement AND, OR and NOT. This makes them sufficient to construct any digital circuit.
Question 20Computer Science
Which memory type loses its stored contents when the computer is switched off?
- ROM
- Hard disk
- Flash drive
- RAM Correct answer.
Explanation
RAM is volatile memory, meaning it requires continuous power to retain data and is cleared on shutdown. ROM, hard disks and flash drives are non-volatile and keep their contents without power.
Question 21Computer Science
A school wants to connect two buildings 3 km apart with a fast dedicated cable link. Which transmission medium is most suitable?
- Twisted pair cable
- Coaxial cable
- Infrared
- Optical fibre Correct answer.
Explanation
Optical fibre carries data as light, offering high bandwidth and low signal loss over long distances, which suits a 3 km link between buildings. Infrared requires line of sight and short range, while copper cables attenuate more over that distance.
Question 22Computer Science
Consider the Boolean expression Y = A·B + A·B'. Which simplified form of Y is correct?
- A + B
- A Correct answer.
- B
- A'
Explanation
Factor out A to get A·(B + B'). Since B + B' = 1, the expression reduces to A·1 = A. This is a direct application of the distributive and complement laws.
Question 23Computer Science
A program reads a list of 100 numbers and must find the largest value by examining each element once. What is the time complexity of this approach?
- O(log n)
- O(n) Correct answer.
- O(1)
- O(n^2)
Explanation
The algorithm performs one comparison per element, so the number of operations grows linearly with the input size n. That gives O(n) time, since each element is visited a constant number of times.
Question 24Computer Science
A table of student records is in second normal form but contains a non-key field that depends on another non-key field. Which normal form should be applied next to remove this transitive dependency?
- Boyce-Codd normal form
- Fourth normal form
- First normal form
- Third normal form Correct answer.
Explanation
Third normal form removes transitive dependencies, where a non-key attribute depends on another non-key attribute rather than on the primary key. Since the relation is already in 2NF, moving to 3NF is the correct next step.
Question 25Computer Science
A recursive function has no base case. What is the most likely consequence when it is executed?
- It returns the correct result faster
- It compiles with a syntax error
- It causes a stack overflow through infinite recursion Correct answer.
- It automatically converts into a loop
Explanation
Without a base case, each call makes another call and no condition stops the chain. The call stack keeps growing until memory is exhausted, producing a stack overflow at run time.
Question 26Computer Science
Which number system uses only the digits 0 and 1 and is the natural representation of data inside a digital computer?
- Hexadecimal
- Octal
- Binary Correct answer.
- Decimal
Explanation
Digital circuits have two stable voltage states, so data is stored and processed using base-2 (binary) notation with the symbols 0 and 1. Decimal, octal and hexadecimal are alternative notations but are not the direct internal representation.
Question 27Computer Science
A shopkeeper stores the price of an item as 149.75. Which data type in a language such as C is designed to hold this value with a fractional part?
- char
- float Correct answer.
- void
- int
Explanation
A floating-point type such as float is intended for values that contain a decimal fraction, so 149.75 fits it. Integer types hold whole numbers only, char holds a single character code, and void denotes absence of a value.
Question 28Computer Science
In a spreadsheet used by a school to record marks, the cell reference D7 identifies which location?
- The cell in row D and column 7
- The range of cells from D to 7
- The seventh cell of the fourth worksheet
- The cell in column D and row 7 Correct answer.
Explanation
A spreadsheet cell address is written as a column letter followed by a row number, so D7 means column D, row 7. The letter always names the column and the number always names the row.
Question 29Computer Science
Which of the following is an example of an operating system?
- Microsoft Word
- Linux Correct answer.
- Adobe Photoshop
- Mozilla Firefox
Explanation
An operating system manages hardware, files and processes and provides services to application programs; Linux is such a system. The other options are application software that runs on top of an operating system.
Question 30Computer Science
What is the primary purpose of a database management system such as MySQL?
- To draw charts from spreadsheet data
- To compile source code into machine code
- To route packets between networks
- To create, store, retrieve and control access to organised data Correct answer.
Explanation
A DBMS provides facilities to define, store, query, update and secure data in a database. Compilation and packet routing belong to other kinds of software.
Question 31Computer Science
In a computer network, which device forwards data packets between two different networks and chooses the best path for them?
- Repeater
- Hub
- Router Correct answer.
- Switch
Explanation
A router works at the network layer, examines destination addresses and forwards packets between separate networks along suitable paths. Hubs, switches and repeaters operate within a single local network segment.
Question 32Computer Science
Which of the following is an example of open-source application software?
- macOS
- Adobe Acrobat Pro
- LibreOffice Writer Correct answer.
- Microsoft Windows
Explanation
Open-source software makes its source code available for anyone to study, modify and redistribute, and LibreOffice Writer is released under such a licence. Windows and macOS are proprietary operating systems, and Acrobat Pro is proprietary application software.
Question 33Computer Science
A programmer writes the C statement int total = 5 + 3 * 4; What value is stored in total?
- 32
- 17 Correct answer.
- 20
- 23
Explanation
Multiplication has higher precedence than addition, so 3 * 4 is evaluated first to give 12, and then 5 + 12 gives 17. Parentheses would be needed to force the addition to run first.
Question 34Computer Science
A loop is written to add the numbers 1 to 10. What is the value of the sum after the loop finishes?
- 50
- 45
- 10
- 55 Correct answer.
Explanation
The sum of the first n natural numbers is n(n+1)/2, so for n = 10 the result is 10 × 11 / 2 = 55. Adding only 1 to 9 would give 45, which is a common slip.
Question 35Computer Science
Which Boolean expression is equivalent to the NAND operation on inputs A and B?
- (A · B)' Correct answer.
- (A + B)'
- A' · B'
- A' + B
Explanation
NAND means the complement of the AND result, so it is written as (A · B)'. By De Morgan's law this also equals A' + B'.
Question 36Computer Science
A student needs to store the marks of 40 students under one subject name in a program. Which data structure is most suitable?
- A single integer variable
- One character variable
- An array of 40 elements Correct answer.
- A single float constant
Explanation
An array holds many values of the same type under one name and allows access by index, so 40 marks can be stored and processed with a loop. A single variable or constant can hold only one value.
Question 37Computer Science
Which SQL command permanently removes a table, including its structure, from a database?
- DELETE
- SELECT
- DROP TABLE Correct answer.
- UPDATE
Explanation
The DROP TABLE statement removes both the data and the definition of a table. DELETE removes rows but keeps the table structure, while SELECT and UPDATE do not remove tables at all.
Question 38Computer Science
In a relational table, a column that refers to the primary key of another table is known as what?
- A composite key
- A candidate key
- A super key
- A foreign key Correct answer.
Explanation
A foreign key is a column whose values must match values of a primary key in another table, which enforces referential integrity between the tables. Candidate, composite and super keys describe ways of identifying rows within one table.
Question 39Computer Science
Which of the following is a characteristic of a star topology in a local area network?
- All devices connect to a central hub or switch Correct answer.
- Devices share a single backbone cable
- Devices are connected in one closed ring
- Every device connects directly to every other device
Explanation
In a star topology each node has its own link to a central device, so a fault on one cable affects only that node. Full interconnection describes a mesh, a closed loop describes a ring, and a shared backbone describes a bus.
Question 40Computer Science
A student wants to place a small photograph on a web page. Which HTML tag is appropriate for this purpose?
- <br>
- <img> Correct answer.
- <table>
- <a>
Explanation
The <img> tag embeds an image and uses the src attribute to give the image file location. The other tags create a hyperlink, a table and a line break respectively.
Question 41Computer Science
Which of the following is a valid octal number?
- 752 Correct answer.
- 1082
- 81.5
- 9A3
Explanation
Octal uses only the digits 0 to 7, so 752 is a valid octal numeral. Any digit 8 or 9, or a letter, makes a numeral invalid in base 8.
Question 42Computer Science
What is the decimal value of the binary number 10110?
- 22 Correct answer.
- 18
- 20
- 26
Explanation
The bits have place values 16, 8, 4, 2 and 1, so 10110 equals 16 + 0 + 4 + 2 + 0 = 22. Each set bit contributes its place value to the total.
Question 43Computer Science
A program contains the condition if (marks >= 40 && marks <= 100). Which set of marks makes this condition true?
- 35
- 105
- 120
- 40 Correct answer.
Explanation
The logical AND requires both comparisons to be true at the same time, and 40 satisfies marks >= 40 and marks <= 100. Any value below 40 or above 100 fails at least one comparison.
Question 44Computer Science
A student converts the decimal fraction 0.5 into binary. Which result is correct?
- 0.101
- 0.11
- 0.01
- 0.1 Correct answer.
Explanation
To convert a fraction, multiply repeatedly by 2 and record the integer parts: 0.5 × 2 = 1.0, so the first binary digit after the point is 1 and the remainder is zero, giving 0.1. This corresponds to the place value 2⁻¹ = 0.5.
Question 45Computer Science
Which statement best describes the difference between a compiler and an interpreter?
- A compiler translates the whole program before execution, while an interpreter translates and runs it line by line Correct answer.
- A compiler runs source code directly, while an interpreter produces an executable file
- A compiler is used only for web pages, while an interpreter is used only for databases
- A compiler removes syntax errors automatically, while an interpreter cannot detect them
Explanation
A compiler converts the entire source program into object code before it runs, whereas an interpreter translates one statement at a time and executes it immediately. Both tools detect syntax errors, but at different stages.
Question 46Computer Science
A table stores student data with StudentID as the primary key and also holds a column TeacherName that depends only on the teacher's own identifier, not on StudentID. Which normal form does the table violate?
- Second normal form
- Fourth normal form
- Third normal form Correct answer.
- First normal form
Explanation
Third normal form forbids a non-key column from depending on another non-key column (a transitive dependency). Since TeacherName depends on the teacher identifier rather than on StudentID, the table is not in 3NF and should be split.
Question 47Computer Science
A binary search is performed on a sorted array of 1000 elements. Approximately how many comparisons are needed in the worst case?
- 500
- 100
- 1000
- 10 Correct answer.
Explanation
Binary search halves the search space at each step, so the worst case is about log₂(1000), which is close to 10 comparisons. Linear scanning would need up to 1000 comparisons.
Question 48Computer Science
Which pair of logic gates forms a complete set, meaning that any Boolean function can be built using only gates from that pair?
- AND and OR
- XOR and XNOR
- AND and NOT Correct answer.
- OR and XOR
Explanation
AND together with NOT can produce NAND, and NAND alone is functionally complete, so AND and NOT can build any Boolean function. The other pairs cannot express inversion or the missing basic operation on their own.
Question 49Computer Science
A recursive function is written without a base case. What is the most likely result when it is called?
- It returns zero immediately
- It executes exactly once and stops
- It automatically converts itself into a loop
- It runs until the call stack overflows and the program terminates abnormally Correct answer.
Explanation
Every recursive call adds a new frame to the call stack, and without a base case the recursion never terminates, so the stack space is exhausted and a stack overflow occurs. A base case is what eventually stops the chain of calls.
Question 50Computer Science
A company needs a network link that carries data over long distance with very high bandwidth and is immune to electromagnetic interference. Which medium best meets these requirements?
- Unshielded twisted pair cable
- Optical fibre cable Correct answer.
- Coaxial cable
- Infrared wireless link
Explanation
Optical fibre carries data as light pulses inside a glass core, giving very high bandwidth and immunity to electromagnetic interference over long distances. Copper cables suffer attenuation and interference, and infrared requires a short line of sight.