Question bank · 39 min read
Computer Science: Unit-wise Objective Question Bank
Group A of the Computer Science paper is worth nine marks out of fifty. That is eighteen per cent of the written paper, and it is the only part of the paper where a candidate who knows the fact gets the mark instantly and a candidate who does not gets nothing at all. There is no partial credit in Group A. There is also no thinking time to spare: nine marks at the paper's own rate of 2.4 minutes per mark is about twenty-two minutes, and most good candidates finish Group A in eight to ten minutes so that the time banks forward into Group C.
This chapter is a bank of 162 multiple-choice questions, arranged in the order of the seven units of the NEB Grade 12 Computer Science syllabus. Every question has a worked answer key that gives the reason in one line — because a reason you can restate is a fact you will still own in Chait, and a bare letter is not.
Three papers could be verified for this book: the NEB 2080 (2023) Computer
Science paper, subject code 4281; the NEB 2079 Grade 12 Computer paper; and the
NEB Grade 12 Computer model question issued for the new course. Between them
they contain 27 Group A items, and 26 of those 27 are reproduced here —
25 word for word, and one in corrected form because the original offered the
same answer twice. (The twenty-seventh depended on a printed program listing
that could not be recovered.) Reproduced items carry a tag such as
(NEB 2080). Everything untagged is written to the same pattern and difficulty
but is not claimed to be a past question.
14.1 How the nine Group A marks are spread
Before the bank itself, one piece of evidence worth more than any study tip. Across the three verified papers there are 27 Group A items in total. Sorting each item into the syllabus unit it tests gives the picture below.
Read that carefully, because it contradicts what most candidates do. Web
Technology II carries twelve teaching hours, fewer than Networking's
fifteen, yet it produced eight of the 27 MCQs — nearly one in three. The
reason is structural, not accidental: Web Technology II is full of exact,
checkable, one-line facts. The $ sign in jQuery. mysqli_connect(). The tag
that makes a hyperlink. The syntax for an external script. An examiner writing a
one-mark item needs a question with exactly one defensible answer, and web
syntax hands that over free. Networking, by contrast, is full of comparisons and
diagrams, which make excellent five- and eight-mark questions and awkward MCQs.
If you are revising Group A specifically, revise syntax — web syntax, SQL keyword categories, C declarations. Those are where the one-mark questions live. Revise topologies and the OSI model for Group B and C, not for Group A.
14.2 Unit 1: Database Management System
Twelve teaching hours; five of the 27 verified MCQs. The examiner's favourite targets here are the keyword categories of SQL (which statements are DDL, which are DML), the key vocabulary (primary, candidate, foreign, super), and the normal forms.
Set A — data, the relational model and keys
- A field that is used to uniquely define a particular record in a table is called [1]aprimary keybentitycrelationshipdconstraints (NEB 2079)
- In relational terminology, a row of a table is called a [1]atuplebattributecdomainddegree
- The number of attributes in a relation is called its [1]acardinalitybdegreecdomaindarity of the key
- A candidate key that has been chosen by the designer becomes the [1]aforeign keybsuper keycprimary keydalternate key
- An attribute in one table that refers to the primary key of another table is a [1]acomposite keybforeign keyccandidate keydsecondary key
- The set of permitted values for an attribute is its [1]adomainbtuplecschemadinstance
- Which of the following is not an advantage of a DBMS over a file system? [1]acontrolled redundancybdata consistencyclower initial costddata sharing
- The ability to change the internal storage structure without changing the application programs is called [1]alogical data independencebphysical data independencecdata integrityddata abstraction
- Who is responsible for granting and revoking access rights on a database? [1]aend userbapplication programmercdatabase administratordsystem analyst
Answers — Set A
1. (a) — a primary key is by definition the attribute that identifies one record uniquely.
2. (a) — row = tuple = record; column = attribute = field.
3. (b) — degree counts columns; cardinality counts rows.
4. (c) — a relation may have several candidate keys but only one is made primary.
5. (b) — that is the definition of a foreign key; it enforces referential integrity.
6. (a) — the domain is the pool of legal values, e.g. gender over {M, F}.
7. (c) — a DBMS costs more to set up; the other three are genuine advantages.
8. (b) — physical independence insulates programs from the storage layer.
9. (c) — GRANT and REVOKE are DCL statements, and the DBA owns them.
Set B — SQL
- Which of the statements are used in DDL? [1]acreate, alter and dropbcreate, insert and selectcinsert, update and deleteddelete, alter and drop (NEB model question)
- Which of the following is a DML statement? [1]acreatebselectccreate viewddrop (NEB 2080)
- Which SQL statement is used to delete rows from a database table? [1]aDELETEbREMOVEcDROPdCLEAR (NEB 2079)
- With SQL, how do you select all the records from a table named
Personswhere the value of the columnFirstNameends with ana? [1]aWHERE FirstName='a'bWHERE FirstName LIKE 'a%'cWHERE FirstName LIKE '%a'dWHERE FirstName='%a%'(NEB model question) - Which clause filters rows after they have been grouped? [1]aWHEREbHAVINGcORDER BYdGROUP BY
SELECT COUNT(*) FROM student_info;returns [1]athe number of columnsbthe number of rowscthe number of non-null namesdan error- Which SQL keyword removes duplicate rows from the result of a query? [1]aUNIQUEbDISTINCTcSINGLEdONLY
GRANTandREVOKEbelong to which category of SQL? [1]aDDLbDMLcDCLdTCL- Which statement removes the whole table together with its structure? [1]a
DELETE FROM student_info;bTRUNCATE TABLE student_info;cDROP TABLE student_info;dALTER TABLE student_info;
Answers — Set B
1. (a) — DDL defines structure: CREATE, ALTER, DROP (and TRUNCATE).
2. (b) — DML manipulates data; SELECT, INSERT, UPDATE, DELETE are DML.
3. (a) — DELETE removes rows and leaves the table; DROP removes the table itself.
4. (c) — % is the wildcard, so '%a' means "anything, then a final a".
5. (b) — WHERE filters rows before grouping, HAVING filters the groups.
6. (b) — COUNT(*) counts rows, including rows with nulls.
7. (b) — SELECT DISTINCT class_id FROM student_info;
8. (c) — Data Control Language governs privileges.
9. (c) — DROP destroys structure and data; DELETE/TRUNCATE keep the structure.
The model question asked how to select all records from Persons where
FirstName ends with an a. Suppose the column holds Asha, Bina,
Amrita and Rajesh. The answer must return Asha, Bina and Amrita, and reject
Rajesh.
WHERE FirstName='a'returns only a name that is literally the single lettera. It returns nothing. Dead.WHERE FirstName LIKE 'a%'means "ana, then anything" — it matches names that begin witha. That would return Asha and Amrita, and wrongly drop Bina. Dead.WHERE FirstName LIKE '%a'means "anything, then a finala". Asha ✓, Bina ✓, Amrita ✓, Rajesh ✗. Correct.WHERE FirstName='%a%'uses=instead ofLIKE, so%is not a wildcard at all — it looks for the literal string%a%. Dead.
Answer (c). The rule to memorise is positional: the % goes where the
unknown text is. Unknown text before the a means '%a'.
Set C — normalisation, integrity and database architecture
- A relation is in 1NF if [1]aevery attribute is atomicbthere is no partial dependencycthere is no transitive dependencydevery determinant is a candidate key
- Removing partial dependency on a composite primary key takes a relation to [1]a1NFb2NFc3NFdBCNF
- A relation in 2NF becomes 3NF when we remove [1]amulti-valued attributesbpartial dependencyctransitive dependencydforeign keys
- The main purpose of normalisation is to [1]aincrease redundancybreduce redundancy and update anomaliescspeed up every querydreduce the number of users
- Which constraint guarantees that a foreign-key value always matches an existing primary-key value? [1]aentity integritybdomain integritycreferential integritydkey integrity
- In the schema of the figure above, inserting a
student_inforow withclass_id = 99when no suchclass_inforow exists violates [1]aentity integritybreferential integritycdomain integritydnothing at all - In an E-R diagram, an ellipse represents a [1]aentitybrelationshipcattributedweak entity
- In a distributed database system, the data is [1]astored on one machine at one sitebsplit across several sites but appears as one databasecnever shareddstored only in main memory
- Which property of a transaction guarantees that it either completes entirely or has no effect at all? [1]aatomicitybconsistencycisolationddurability
Answers — Set C
1. (a) — 1NF forbids repeating groups and multi-valued cells.
2. (b) — 2NF = 1NF plus full functional dependence on the whole key.
3. (c) — a transitive dependency is a non-key attribute determining another non-key attribute.
4. (b) — normalisation trades a little join cost for a lot of integrity.
5. (c) — referential integrity is exactly the foreign-key rule.
6. (b) — the referenced class_info.class_id does not exist.
7. (c) — rectangle = entity, diamond = relationship, ellipse = attribute.
8. (b) — fragments sit at several sites; the user sees a single logical database.
9. (a) — atomicity is the "all or nothing" property of ACID.
14.3 Unit 2: Data Communication and Networking
Fifteen teaching hours, the largest unit in the syllabus, but only four of the 27 verified MCQs. Most of this unit's marks are collected in Group B and Group C. For Group A, concentrate on the numbers — address lengths, port counts, address classes — and on which device works at which layer.
Set A — media, modes and topology
- Coaxial cable is an example of [1]acommunication softwarebguided transmission mediacunguided transmission mediadall of them (NEB 2080)
- Which of the following statements is true about a star network topology? [1]aeach device is connected to a switch or hubbeach device is connected to every other deviceceach device is connected in a trunkdeach device is connected to a terminal (NEB model question)
- In the figure above, which panel shows a mesh topology? [1]aAbBcCdD
- In the figure above, which panel shows the topology in which a break in the backbone brings down the whole network? [1]aAbBcCdD
- A fully connected mesh of n nodes needs how many duplex links? [1]anbn-1cn(n-1)/2dn^2
- A walkie-talkie communicates in which mode? [1]asimplexbhalf duplexcfull duplexdmultiplex
- Which medium is completely immune to electromagnetic interference? [1]aunshielded twisted pairbcoaxial cablecoptical fibredshielded twisted pair
- The loss of signal strength as it travels down a medium is called [1]adistortionbattenuationccrosstalkdjitter
- Bandwidth of a digital channel is measured in [1]ahertzbbits per secondcbytesdwatts
Answers — Set A
1. (b) — coaxial is a physical cable, therefore guided (bounded) media.
2. (a) — every host in a star hangs off one central hub or switch.
3. (d) — panel D joins every node to every other node.
4. (a) — panel A is a bus; the single backbone is a single point of failure.
5. (c) — each of n nodes links to n-1 others, and each link is counted twice.
6. (b) — both ends can transmit, but only one at a time.
7. (c) — fibre carries light, so no electrical noise couples into it.
8. (b) — attenuation is loss of energy; a repeater or amplifier undoes it.
9. (b) — analogue bandwidth is in hertz, digital capacity in bits per second.
A five-port Ethernet switch of the kind a school computer lab actually uses is shown below. Almost every star-topology question in this bank describes exactly this device.

Set B — addressing and devices
- What does "MAC" stand for in MAC address? [1]amandatory access controlbmedia access controlcmicro access controldmedia access certificate (NEB 2079)
- Which of the following IPv4 addresses is valid? [1]a192.168.1.1bEEE.000.33.000c257.2.5.1d202.70.71.262 (NEB 2080)
- A MAC address is how many bits long? [1]a32b48c64d128
- The address 192.168.10.25 belongs to which class? [1]aclass Abclass Bcclass Cdclass D
- The default subnet mask of a class B address is [1]a255.0.0.0b255.255.0.0c255.255.255.0d255.255.255.255
- How many usable host addresses does one default class C network provide? [1]a254b255c256d65534
- Which device forwards a frame only to the port on which the destination host sits? [1]ahubbswitchcrepeaterdmodem
- A router operates at which layer of the OSI model? [1]adata linkbnetworkctransportdsession
- Which device converts digital signals to analogue and back for a telephone line? [1]agatewaybbridgecmodemdrepeater
Answers — Set B
1. (b) — media access control; the address is burnt into the NIC.
2. (a) — each octet must be 0–255 and numeric, which rules out (b), (c) and (d).
3. (b) — 48 bits, written as twelve hexadecimal digits.
4. (c) — the first octet 192 lies in the class C range 192–223.
5. (b) — class B uses the first two octets for the network part.
6. (a) — 2^{8}-2 = 254, after removing the network and broadcast addresses.
7. (b) — a switch learns MAC addresses; a hub floods every port.
8. (b) — routers read IP addresses, which live at layer 3.
9. (c) — modulator–demodulator.
The NEB 2080 paper offered 192.168.1.1, EEE.000.33.000, 257.2.5.1 and
202.70.71.262. Do not look for the right one; kill the wrong ones.
An IPv4 address is four decimal numbers, separated by dots, each in the range 0–255. That single sentence is the whole test. Apply it in order:
EEE.000.33.000— the first group is letters, not a decimal number. Dead.257.2.5.1— 257 is greater than 255. Dead.202.70.71.262— 262 is greater than 255. Dead.192.168.1.1— four groups, all between 0 and 255. Survives.
Answer (a). Notice that two of the three distractors were built from the same trick, the out-of-range octet, placed once at the front and once at the back so that a candidate scanning quickly catches one and misses the other. Check every octet, not the first.
Set C — models, protocols and network types
- How many layers does the OSI reference model have? [1]a4b5c7d9
- Which OSI layer is responsible for end-to-end error recovery and flow control? [1]anetworkbtransportcsessiondpresentation
- Encryption and data compression are carried out at which OSI layer? [1]aapplicationbsessioncpresentationddata link
- Which protocol guarantees delivery by using acknowledgements and retransmission? [1]aUDPbTCPcIPdICMP
- Which protocol translates a domain name into an IP address? [1]aDHCPbDNScFTPdSMTP
- Which protocol assigns an IP address to a host automatically when it joins the network? [1]aDNSbARPcDHCPdSNMP
- HTTP normally uses which port number? [1]a21b25c80d443
- A network spread over a single building or campus is a [1]aPANbLANcMANdWAN
- In a peer-to-peer network [1]aone machine holds all the databevery machine can act as both client and servercno machine can share filesda dedicated server is compulsory
Answers — Set C
1. (c) — physical, data link, network, transport, session, presentation, application.
2. (b) — the transport layer owns end-to-end reliability; the network layer only routes.
3. (c) — the presentation layer handles translation, encryption and compression.
4. (b) — TCP is connection-oriented and reliable; UDP is neither.
5. (b) — the Domain Name System is the Internet's directory.
6. (c) — Dynamic Host Configuration Protocol leases addresses.
7. (c) — port 80 for HTTP, 443 for HTTPS, 21 for FTP, 25 for SMTP.
8. (b) — a LAN is limited to one building or campus.
9. (b) — peers are equals; there is no dedicated server.
14.4 Unit 3: Web Technology II
Twelve teaching hours and eight of the 27 verified MCQs — more than any other unit. If you have one hour left before the paper and you want marks in Group A, spend it here. The questions are almost always about exact syntax, so learn the syntax by typing it, not by reading it.
Set A — HTML, CSS and the web
- A collection of hyperlinked documents on the Internet is called [1]aHTMLbwebpagecwwwdemail system (NEB 2080)
- What is the use of the
<a>tag? [1]ato insert an imagebto create a hyperlinkcto create a tabledto create a list (adapted from the NEB model question) - Which attribute of the
<a>tag holds the destination address? [1]asrcbhrefclinkdurl - Which HTML tag creates the largest heading? [1]a
<h1>b<h6>c<head>d<heading> - Which tag inserts an image into a web page? [1]a
<image>b<img>c<pic>d<src> - Which of these is an empty (self-closing) HTML element? [1]a
<p>b<div>c<br>d<span> - Which tag is used to create an ordered list? [1]a
<ul>b<ol>c<li>d<dl> - An external style sheet is attached to a page with [1]a
<style>b<link>c<css>d<script> - In CSS, a selector beginning with
#selects by [1]aclassbidctag namedattribute
Answers — Set A
1. (c) — the World Wide Web is the hyperlinked document collection; HTML is only its language.
2. (b) — the anchor tag makes a link; note that the original model question listed "create a link" and "create a hyperlink" as two options, which is a flaw in that paper.
3. (b) — <a href="page.html">; src belongs to <img> and <script>.
4. (a) — <h1> is largest, <h6> smallest.
5. (b) — <img src="photo.jpg" alt="...">.
6. (c) — <br> has no closing tag and no content.
7. (b) — <ol> numbers the items, <ul> bullets them.
8. (b) — <link rel="stylesheet" href="style.css"> goes in the head.
9. (b) — #header selects id="header"; .header would select the class.
Set B — JavaScript and jQuery
- What is the correct syntax for referring to an external JavaScript script? [1]a
<script src="myscript.js"></script>b<script href="myscript.js"></script>c<js href="myscript.js"></js>d<js src="myscript.js"></js>(NEB 2079) - Which of the following is the correct syntax to display "Stay Safe" in an
alert box using JavaScript? [1]a
alert-box("Stay Safe");bconfirm("Stay Safe");cmsgbox("Stay Safe");dalert("Stay Safe");(NEB model question) - Which of the given signs is used as a shortcut for jQuery? [1]athe
%signbthe&signcthe$signdthe@sign (NEB 2080) - Which jQuery method is used to hide selected elements? [1]a
hide()bhide(on)cinvisible()ddisplay(none)(NEB 2080) - Which keyword declares a block-scoped variable in modern JavaScript? [1]a
varbletcdimdint - JavaScript is which kind of scripting language? [1]aserver-side onlybclient-sideccompileddmarkup
- Which operator in JavaScript tests value and type? [1]a
=b==c===d!= - Which jQuery statement runs code only after the page has loaded? [1]a
$(document).ready(function(){ ... });b$(window).load;c$.start();d$(page).begin(); - Which method writes text directly into the HTML document? [1]a
document.write()bwindow.print()cconsole.log()ddocument.getElementById()
Answers — Set B
1. (a) — <script> takes src, exactly like <img>.
2. (d) — alert() is the built-in dialog; confirm() asks OK/Cancel instead.
3. (c) — $ is an alias for the jQuery function.
4. (a) — $("p").hide();
5. (b) — let (and const) are block-scoped; var is function-scoped.
6. (b) — it runs inside the browser; PHP runs on the server.
7. (c) — === is strict equality, so "5" === 5 is false.
8. (a) — the ready handler waits for the DOM.
9. (a) — console.log() writes to the console, not the page.
Set C — PHP, MySQL connectivity and XML
- Which of the following is the correct way of defining a variable in PHP? [1]a
$variable name = value;b$variable_name = value;c$variable_name = valued$variable name as value;(NEB 2079) - Which function is used to connect to a MySQL database? [1]a
mysqli_open()bmysqli_connect()cvar mysqli_query()d$mysqli_con()(NEB 2080) - Every PHP statement must end with [1]aa full stopba semicolonca colondnothing
- PHP code is enclosed in [1]a
<php> ... </php>b<?php ... ?>c<script> ... </script>d{{ ... }} - Which PHP function runs an SQL query on an open connection? [1]a
mysqli_query()bmysqli_fetch()cmysqli_run()dmysqli_exec() - Which superglobal array carries data submitted by a form using the POST
method? [1]a
$_GETb$_POSTc$_FORMd$_REQUESTED - PHP is executed [1]ain the browserbon the web servercin the database enginedin the operating system kernel
- XML differs from HTML mainly because XML [1]adisplays databdescribes and carries data with user-defined tagschas a fixed tag setdcannot be nested
- Which protocol transfers web pages securely between browser and server? [1]aHTTPbHTTPScFTPdSMTP
Answers — Set C
1. (b) — a PHP variable name starts with $, cannot contain a space, and the statement needs its semicolon.
2. (b) — mysqli_connect($server, $user, $pass, $db);
3. (b) — the semicolon is the statement terminator.
4. (b) — the short opening tag <?php and closing ?>.
5. (a) — mysqli_query($conn, $sql);
6. (b) — $_POST['name'] reads a posted field.
7. (b) — PHP is server-side; the browser only ever sees its output.
8. (b) — XML tags are invented by the author and carry meaning, not layout.
9. (b) — HTTPS is HTTP inside TLS.
14.5 Unit 4: Programming in C
Twelve teaching hours and three of the 27 verified MCQs — but Group C almost
always carries a C program worth five to eight marks, so the objective questions
here are also revision for the biggest single answer on the paper. Every output
shown in the answer keys below was obtained by compiling and running the code
with gcc.
Set A — data types, operators and control flow
- Which of the following is a valid C identifier? [1]a
2sumbtotal_marksctotal marksdint - On a typical 64-bit compiler,
sizeof(int)evaluates to [1]a1b2c4d8 - What does
10 % 3evaluate to in C? [1]a3b1c3.33d0 - Which operator has the highest precedence among these? [1]a
+b*c=d&& int x = 5; printf("%d", x++);prints [1]a4b5c6dnothing- Which loop is guaranteed to execute its body at least once? [1]a
forbwhilecdo...whilednestedfor - Which statement skips the rest of the current iteration and starts the next? [1]a
breakbcontinuecgotodreturn - The
switchexpression in standard C may be of which type? [1]afloatbdoublecintorchardany type - Which format specifier prints a
floatvalue? [1]a%db%cc%fd%s
Answers — Set A
1. (b) — an identifier may not start with a digit, contain a space, or be a keyword.
2. (c) — verified: printf("%d", (int)sizeof(int)); printed 4.
3. (b) — % gives the remainder, 10/3 gives the quotient 3.
4. (b) — multiplicative operators bind tighter than additive, logical or assignment.
5. (b) — verified: the post-increment prints the old value 5, then x becomes 6.
6. (c) — do...while tests its condition after the body.
7. (b) — break leaves the loop, continue only ends the current pass.
8. (c) — switch needs an integral expression.
9. (c) — %f for float and double, %d for int, %c for char.
Set B — functions, arrays and strings
- In C, the execution of a program always begins from [1]athe first function definedbthe
main()functioncthe last functiondany function - Passing a variable to a function so that changes inside the function affect the caller's variable is called [1]acall by valuebcall by referenceccall by namedcall by result
- The valid index range of
int a[5];is [1]a1 to 5b0 to 5c0 to 4d1 to 4 - For
int arr[5] = {1,2,3,4,5};the value ofarr[2]is [1]a2b3c4dundefined - For
char str[] = "NEB";the value ofsizeof(str)is [1]a3b4c5d8 - Which function returns the number of characters in a string, not counting the
terminator? [1]a
strlen()bstrcpy()cstrcat()dstrcmp() - Which header file must be included to use
strlen()? [1]astdio.hbstring.hcconio.hdstdlib.h - A function that calls itself is called [1]ainlinebnestedcrecursivedstatic
float area(float r);written beforemain()is a [1]afunction definitionbfunction prototypecfunction calldmacro
Answers — Set B
1. (b) — main() is the entry point wherever it is written in the file.
2. (b) — call by reference passes the address, so the function edits the original.
3. (c) — C array indices start at 0, so the last is n-1.
4. (b) — verified: printing arr[2] gave 3.
5. (b) — verified: sizeof gave 4 (three letters plus '\0') while strlen gave 3.
6. (a) — strlen("NEB") is 3.
7. (b) — all the str... functions are declared in string.h.
8. (c) — recursion needs a base case or it never stops.
9. (b) — a prototype declares the return type and parameters, and ends with a semicolon.
Set C — pointers, structures and files
- Which of the following is true about
FILE *fpt;? [1](a)FILEis a keyword in C for representing files andfptis a variable ofFILEtype(b)FILEis a buffered stream(c)FILEis a stream(d)FILEis a structure andfptis a pointer to the structure ofFILEtype (NEB 2080) - What is the output of
void main(){ int b=25; int *p; p=&b; printf("%d %d", &b, p); }? [1]a25 25bthe same address printed twicec25then an addressdan address then25(NEB 2079) - The operator that returns the address of a variable is [1]a
*b&c->d. - If
int a[5] = {2,4,6,8,10};andint *q = a;, then*(q+3)is [1]a4b6c8d10 - A member of a structure is accessed through a structure pointer using [1]a
.b->c::d* - Which keyword defines a user-defined data type that groups different types
together? [1]a
arraybstructcenumdtypedef - In a
union, all the members [1]ahave separate memorybshare the same memory locationcmust be of the same typedcannot be accessed - Which mode opens a file for writing and erases any existing contents? [1]a
"r"b"w"c"a"d"r+" - Which function closes an open file? [1]a
fclose()bfend()cclose()dfstop()
Answers — Set C
1. (d) — FILE is a typedef for a structure, so fpt is a pointer to that structure.
2. (b) — verified: &b and p hold the same address, so both fields print identically. (Strictly, %d on a pointer is wrong; %p is correct.)
3. (b) — &b is "address of b", *p is "value at p".
4. (c) — verified: *(q+3) printed 8, the fourth element.
5. (b) — sp->roll is shorthand for (*sp).roll.
6. (b) — a struct bundles members of different types under one name.
7. (b) — a union is exactly as large as its biggest member.
8. (b) — "w" truncates; "a" appends; "r" fails if the file is absent.
9. (a) — fclose(fp); flushes the buffer and releases the handle.
14.6 Unit 5: Object-Oriented Programming
Ten teaching hours and two of the 27 verified MCQs. Both were about the four pillars — and in fact every OOP objective question the papers have asked so far can be answered by someone who can say, in one sentence each, what encapsulation, inheritance, polymorphism and abstraction mean.
Set A — the four pillars
- Which feature of OOP illustrates code reusability? [1]apolymorphismbabstractioncencapsulationdinheritance (NEB 2079)
- Where is a class derived in inheritance? [1]asuperclassbsubclasscsubset classdrelative class (NEB model question)
- Wrapping data and the functions that operate on it into a single unit is [1]ainheritancebencapsulationcpolymorphismdoverloading
- Showing only the essential features and hiding the internal detail is [1]aabstractionbencapsulationcinheritancedinstantiation
- "One interface, many implementations" describes [1]aencapsulationbabstractioncpolymorphismdmodularity
- Two functions in the same class with the same name but different parameter lists is an example of [1]afunction overridingbfunction overloadingcrecursiondinheritance
- A class is best described as [1]aan object in memoryba blueprint from which objects are createdca functionda variable
- Which access specifier makes a member visible to derived classes but not to
the outside world? [1]a
publicbprivatecprotecteddstatic - Which of the following is not a feature of object-oriented programming? [1]ainheritancebpolymorphismcgoto statementddata hiding
Answers — Set A
1. (d) — a derived class reuses the code of its base class without rewriting it.
2. (b) — the derived class is the subclass; the class it derives from is the superclass.
3. (b) — encapsulation binds data with its methods and hides the data behind them.
4. (a) — abstraction is about the interface; encapsulation is about the wrapping.
5. (c) — polymorphism lets the same call behave differently by object type.
6. (b) — overloading is compile-time; overriding needs inheritance and is run-time.
7. (b) — the class is the template, the object is the instance.
8. (c) — protected is visible inside the class and its descendants.
9. (c) — goto is an unstructured jump and belongs to no OOP principle.
Set B — objects, constructors and paradigms
- Creating an object from a class is called [1]adeclarationbinstantiationcinheritancedcompilation
- A special member function that runs automatically when an object is created is a [1]adestructorbconstructorcfriend functiondvirtual function
- A constructor has which return type? [1]a
voidbintcthe class typednone at all - In procedural programming, a program is divided into [1]aobjectsbfunctionscclassesdpackages
- Which of these is a purely object-oriented way of protecting data? [1]aglobal variablesbmaking members
privateand exposingpublicmethodscusinggotodusing macros - Inheriting from more than one base class is called [1]asingle inheritancebmultilevel inheritancecmultiple inheritancedhierarchical inheritance
- A function that is declared in the base class and redefined in the derived class with the same signature demonstrates [1]aoverloadingboverridingchidingdnesting
- Which of the following is an object-oriented language? [1]aCbCOBOLcJavadFORTRAN 77
- Data hiding in OOP mainly improves [1]aexecution speedbsecurity and maintainabilitycfile sizednetwork bandwidth
Answers — Set B
1. (b) — Student s; instantiates the class Student.
2. (b) — the constructor initialises the object's data members.
3. (d) — a constructor declares no return type, not even void.
4. (b) — procedural code is a set of functions acting on shared data.
5. (b) — private data plus public accessors is the standard idiom.
6. (c) — multiple inheritance takes from two or more bases at once.
7. (b) — same name, same parameters, different class level = overriding.
8. (c) — C, COBOL and FORTRAN 77 are procedural.
9. (b) — hidden data cannot be corrupted from outside the class.
14.7 Unit 6: Software Process Model
Ten teaching hours and three of the 27 verified MCQs — one in every paper this book could verify. The examiner keeps returning to the same two things: the order of the SDLC phases, and which phase does what.
Set A — the SDLC and its phases
- Which of these is the correct order of the SDLC? [1]aanalysis, design, coding, testing, implementationbanalysis, design, testing, implementation, codingcimplementation, coding, analysis, design, testingddesign, testing, implementation, coding, analysis (NEB model question)
- Which SDLC phase is used to ensure quality software? [1]aimplementationbmaintenancectestingdsystem study (NEB 2080)
- Which activity discovers the requirements from the user during requirement collection? [1]afeasibility studybrequirement elicitationcrequirement specificationdrequirement validation (NEB 2079)
- Which is normally the longest and most expensive phase over the whole life of a system? [1]aanalysisbdesignccodingdmaintenance
- A study that asks whether the organisation can afford the proposed system is [1]atechnical feasibilitybeconomic feasibilitycoperational feasibilitydlegal feasibility
- The document that records exactly what the system must do is the [1]aDFDbSRScERDduser manual
- Converting the design into actual program code happens in which phase? [1]aanalysisbdesignccodingdtesting
- Running the old and the new system side by side for a period is which changeover method? [1]adirectbparallelcphaseddpilot
- A data flow diagram is produced mainly during [1]asystem analysisbcodingcmaintenancedtesting
Answers — Set A
1. (a) — you cannot test code that has not been written, nor implement what has not been tested.
2. (c) — testing is the quality gate before release.
3. (b) — elicitation is the gathering; specification writes it down; validation checks it.
4. (d) — maintenance typically consumes more than half the whole-life cost.
5. (b) — economic feasibility is the cost-benefit question.
6. (b) — Software Requirement Specification.
7. (c) — coding, sometimes called implementation of the design.
8. (b) — parallel running is the safest but the most expensive changeover.
9. (a) — a DFD models the flow of data through the existing and proposed system.
Set B — process models
- Which model completes each phase fully before the next begins and does not easily allow going back? [1]awaterfallbspiralcprototypedagile
- Which model is driven by risk analysis at the start of every cycle? [1]awaterfallbspiralcV-modeldbig-bang
- Which model builds a quick working mock-up so that the user can refine the requirements? [1]awaterfallbprototypingcV-modeldincremental
- The waterfall model is most suitable when [1]arequirements are unclear and change oftenbrequirements are well understood and stablecthe project is very large and riskydthe user is unavailable
- Which model delivers the software in successive usable builds? [1]aincrementalbwaterfallcV-modeldbuild-and-fix
- Testing the system as a whole against the requirements is [1]aunit testingbintegration testingcsystem testingdregression testing
- Testing carried out by the customer at the customer's own site before acceptance is [1]aalpha testingbbeta testingcunit testingdstress testing
- Testing an individual function or module in isolation is [1]aunit testingbsystem testingcacceptance testingdload testing
- The main disadvantage of the waterfall model is that [1]ait has no documentationba requirement error found late is very costly to fixcit cannot be planneddit needs no testing
Answers — Set B
1. (a) — the waterfall flows one way, which is its strength and its weakness.
2. (b) — each spiral loop is plan, risk-analyse, engineer, evaluate.
3. (b) — the prototype is thrown away or evolved once requirements are agreed.
4. (b) — stable, well-understood requirements are exactly what the waterfall needs.
5. (a) — the incremental model ships a working subset, then adds to it.
6. (c) — system testing checks the integrated whole against the SRS.
7. (b) — alpha testing is at the developer's site, beta at the customer's.
8. (a) — unit testing is the smallest testable piece.
9. (b) — the cost of correcting a requirement grows with the phase it is found in.
14.8 Unit 7: Recent Trends in Technology
Nine teaching hours, the shortest unit, and two of the 27 verified MCQs. It is also the easiest unit in which to score, because the questions are definitional. Both verified items — sensors in IoT, and why cloud computing is popular — could be answered from the first sentence of the definition.
Set A — cloud, AI and IoT
- Why is cloud computing popular nowadays? [1]acost-sharing and easily accessiblebmodern technology and costlycaccessible and freely availabledaffordable to all (NEB model question)
- What devices detect and respond to changes in an environment, are embedded in smart phones, and are an integral part of the Internet of Things? [1]aWi-FibbarcodecRFIDdsensors (NEB 2079)
- Renting a virtual machine on which you install your own operating system is which cloud service model? [1]aSaaSbPaaScIaaSdDaaS
- Gmail and Google Docs are examples of [1]aIaaSbPaaScSaaSda private cloud
- A cloud used exclusively by a single organisation is a [1]apublic cloudbprivate cloudchybrid clouddcommunity cloud
- The branch of AI in which a system improves its performance from data without being explicitly programmed is [1]amachine learningbroboticscexpert systemsdcomputer vision
- A program that answers customer questions in natural language is an application of [1]anatural language processingbdata miningcvirtual realitydcryptography
- In the Internet of Things, the component that gives every object a unique identity on the network is its [1]asensorbactuatorcIP addressdbattery
- An actuator in an IoT system [1]ameasures a physical quantitybconverts a control signal into a physical actioncstores data in the clouddencrypts the data
Answers — Set A
1. (a) — many users share one pool of resources, so the cost per user falls and the service is reachable from anywhere.
2. (d) — sensors are the input organs of IoT; RFID only identifies, it does not sense change.
3. (c) — Infrastructure as a Service hands you raw compute and storage.
4. (c) — Software as a Service: the finished application, in the browser.
5. (b) — a private cloud is single-tenant, on or off premises.
6. (a) — machine learning generalises from examples.
7. (a) — NLP covers chatbots, translation and sentiment analysis.
8. (c) — without an address the "thing" cannot be reached over the Internet.
9. (b) — sensors read the world, actuators change it (a motor, a valve, a relay).
Set B — mobile computing, big data, virtual reality and e-commerce
- Which generation of mobile technology first made high-speed mobile broadband ordinary? [1]a1Gb2Gc3Gd4G
- Computing that lets a user access data and services while moving is [1]agrid computingbmobile computingcparallel computingdbatch processing
- The three classic "V"s of big data are [1]avolume, velocity, varietybvolume, value, visioncvariety, virtue, velocitydvolume, virtual, verified
- A computer-generated environment that a user can move inside and interact with is [1]aaugmented realitybvirtual realitycsimulation modellingdteleconferencing
- Overlaying digital information on a view of the real world is [1]avirtual realitybaugmented realitycholographydanimation
- Buying and selling goods over the Internet is [1]ae-governancebe-commercece-learningde-mail
- An online store selling directly to individual shoppers is which e-commerce model? [1]aB2BbB2CcC2CdG2C
- A distributed, tamper-evident ledger shared across many computers is [1]aa data warehousebblockchainca relational databaseda spreadsheet
- Which of the following is the best example of an embedded system? [1]aa desktop PCbthe controller inside a washing machineca web browserda spreadsheet package
Answers — Set B
1. (c) — 3G introduced mobile broadband; 4G made it fast enough for video everywhere.
2. (b) — mobile computing is computing without a fixed physical link.
3. (a) — volume (how much), velocity (how fast), variety (how many forms).
4. (b) — VR replaces the world; AR adds to it.
5. (b) — a phone camera view with directions drawn on it is AR.
6. (b) — electronic commerce.
7. (b) — business to consumer.
8. (b) — each block carries the hash of the previous one, so tampering shows.
9. (b) — an embedded system is a computer dedicated to one task inside a larger device.
14.9 Distractor analysis: how the wrong options are built
An examiner writing a one-mark item does not invent three random wrong answers. The wrong options — the distractors — are chosen so that each one catches a particular misunderstanding. Once you can name the trick, the item stops being a guess. Across the 27 verified questions in this bank, five patterns account for almost every distractor.
1. The neighbouring term. The distractor is the concept one shelf along.
DELETE/DROP. Alpha/beta testing. Subclass/superclass. Elicitation /
specification / validation. Encapsulation / abstraction. These are the most
dangerous distractors, because you half-know them.
Defence: for every pair of terms you meet, write one sentence that names the
difference, not two sentences that define each separately. "DELETE removes
rows and keeps the table; DROP removes the table."
2. The plausible-looking syntax. hide(on), invisible(),
display(none), mysqli_open(), alert-box("..."), <js src="...">. Every one
of these reads like something that might exist. None does.
Defence: type the real syntax at least once. A distractor only works on a candidate who has read the syntax and never written it.
3. The off-by-one or out-of-range number. 257.2.5.1 and 202.70.71.262 in
the IPv4 item; 255 instead of 254 usable hosts; index 0 to 5 instead of 0 to 4;
sizeof("NEB") as 3 instead of 4.
Defence: when a number appears in the options, check the boundary before you check the value. Is it in range? Does it count from zero? Does it include the terminator, the network address, the broadcast address?
4. The true-but-irrelevant statement. In the FILE *fpt item, options (b)
and (c) — "FILE is a buffered stream", "FILE is a stream" — are things a
textbook does say. They are simply not what the declaration means.
Defence: re-read the stem. The question asked what FILE *fpt is, not what a
file is. Underline the actual subject of the question before scanning the
options.
The NEB 2080 paper asked what is true about FILE *fpt;. Three of the four
options are sentences that a textbook really does contain:
- "
FILEis a keyword in C for representing files andfptis a variable ofFILEtype" - "
FILEis a buffered stream" - "
FILEis a stream" - "
FILEis a structure andfptis a pointer to the structure ofFILEtype"
The stem is not asking what a file is, or what a stream is. It is asking what the
declaration FILE *fpt; means. Take it apart:
FILEis not a C keyword. C has 32 keywords andFILEis not among them; it is atypedefname defined insidestdio.h. That kills the first option, and it also kills the idea thatfptis "a variable ofFILEtype".- The
*in the declaration meansfptis a pointer, not aFILE. - Whether a stream is buffered is true of the stream, not of the declaration.
Only the last option describes the declaration: FILE is a structure type and
fpt points to it. Answer (d).
The transferable habit: underline the exact grammatical subject of the stem — here, the declaration — before your eye reaches the options. Half of Group A's difficulty is options answering a question that was not asked.
5. The over-general option. "All of them", "any type", "affordable to all". In the verified coaxial-cable item, "all of them" is offered and is wrong.
Some coaching notes teach that "all of the above" is usually right. In the verified NEB papers it was offered once and was wrong. Judge it on the content, not on folklore.
Do Group A twice. On the first pass answer only the items you are certain of, and put a light pencil dot beside the rest. On the second pass — after Group B, when your memory of the syllabus has been warmed up by writing about it — come back to the dotted ones. Candidates regularly recover a mark or two this way, because a term that would not come in minute four comes easily in minute seventy.
Chapter summary
- Group A is 9 marks of 50 — 18% of the written paper — with no partial credit and no second chance.
- Across the three verified papers, Web Technology II supplied 8 of 27 MCQs, more than any other unit, although it is not the largest unit by teaching hours. Syntax makes good one-mark questions.
- DBMS supplied 5, Networking 4, Programming in C 3, Software Process Model 3, OOP 2 and Recent Trends 2.
- The whole of Software Process Model's MCQ history is about the order of the SDLC phases and which phase does what.
- Distractors are built to catch five specific errors: the neighbouring term, invented syntax, an out-of-range number, a true-but-irrelevant statement, and the over-general option.
- Never leave a Group A item blank. There is no negative marking in the NEB scheme, so an eliminated guess between two options is worth half a mark on average and a blank is worth nothing.
- NEB 2080 (2023), Computer Science, Sub. Code 4281, "New course", 2 hrs, Full Marks 50 — the original scanned question paper, read page by page. All nine Group A items in this chapter tagged (NEB 2080) are transcribed from it.
- NEB 2079 Grade 12 Computer examination paper, published with worked
solutions at nepalieducate.com. The nine items tagged (NEB 2079) come from
it. Note that the published solution to the
DELETE/DROPitem is wrong; the answer given in this chapter is the correct one. - NEB Grade 12 Computer model question for the new course (Group A 9×1, Group B 5×5, Group C 2×8), same source. Items tagged (NEB model question) come from it.
- NEB Grade 12 Computer Science curriculum, units and teaching hours, as used throughout this book.
- Could not be verified: the 2078 and 2081 Computer Science papers were not
reachable, and neb.gov.np's model-question repository did not respond. No
question in this chapter is tagged with either of those years. One item in the
model question (the
<A>tag) listed "create a link" and "create a hyperlink" as separate options; it is reproduced here in corrected form and marked as adapted. One model-question item depended on a program image that could not be recovered, and is not reproduced.