313 Computer Science questions asked in BPSC TRE previous year papers, each with the correct answer and explanation. Read them free on UTpaper, or attempt the full papers as timed online tests.
Q251BPSC TRE 2.0 (2023) Computer Science Class 11-12
The cost of storing a bit is minimum in
Acache
Bregister
Cmagnetic tape
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) magnetic tape
Explanation
Magnetic tape is the cheapest storage per bit, and also the slowest. Registers and cache are the fastest and most expensive, so they cost the most per bit.
Q252BPSC TRE 2.0 (2023) Computer Science Class 11-12
Tera means
A2²⁰
B2⁴⁰
C2³⁰
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) 2⁴⁰
Explanation
In binary measures, Kilo = 2¹⁰, Mega = 2²⁰, Giga = 2³⁰ and Tera = 2⁴⁰ bytes.
Q253BPSC TRE 2.0 (2023) Computer Science Class 11-12
Which of the following system softwares resides always in main memory?
ALoader
BLinker
CAssembler
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) Loader
Explanation
The loader (the bootstrap loader) always stays in main memory, because it has to load other programs into memory before they can run. The linker and assembler are loaded only when needed.
Q254BPSC TRE 2.0 (2023) Computer Science Class 11-12
The postfix expression equivalent of the prefix expression * + ab − cd is
Aab+cd−*
Babcd+−*
Cab+cd*−
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) ab+cd−*
Explanation
The prefix * + ab − cd means (a + b) * (c − d). In postfix this becomes ab+ followed by cd−, then *, which gives ab+cd−*.
Q255BPSC TRE 2.0 (2023) Computer Science Class 11-12
Which data structure is used to convert infix notation to postfix notation?
AStack
BQueue
CTree
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) Stack
Explanation
Infix-to-postfix conversion pushes operators and parentheses onto a stack. It pops them according to precedence and associativity.
Q256BPSC TRE 2.0 (2023) Computer Science Class 11-12
The data structure in which data are added at the rear and deleted from front is called
Astack
Bqueue
Clinked list
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) queue
Explanation
A queue is FIFO (first in, first out). Elements are added at the rear and removed from the front.
Q257BPSC TRE 2.0 (2023) Computer Science Class 11-12
Queue data structure uses
AFIFO
BLIFO
CLILO
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) FIFO
Explanation
A queue works on FIFO (first in, first out), so the element inserted first is removed first.
Q258BPSC TRE 2.0 (2023) Computer Science Class 11-12
Stack data structure uses
AFIFO
BLIFO
CLILO
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) LIFO
Explanation
A stack works on LIFO (last in, first out). Push and pop both happen at the top.
Q259BPSC TRE 2.0 (2023) Computer Science Class 11-12
A constructor is called whenever
Aan object is created
Ba class is created
Ca class is declared
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) an object is created
Explanation
A constructor runs automatically each time an object of the class is created, and it initialises that object. Declaring a class does not call it.
Q260BPSC TRE 2.0 (2023) Computer Science Class 11-12
All members of a structure in C++ are _____ by default.
Apublic
Bprivate
Cprotected
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) public
Explanation
In C++, members of a struct are public by default, and so is struct inheritance. This is the main difference from a class.
Q261BPSC TRE 2.0 (2023) Computer Science Class 11-12
In C++, all members of a class are _____ by default.
Apublic
Bprivate
Cprotected
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) private
Explanation
In C++, members of a class are private by default unless an access specifier says otherwise.
Q262BPSC TRE 2.0 (2023) Computer Science Class 11-12
In C++, what does a class hold?
AArray
BData
CData and functions
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) Data and functions
Explanation
A C++ class bundles data members and member functions together into one unit, which is encapsulation.
Q263BPSC TRE 2.0 (2023) Computer Science Class 11-12
The number of access specifiers in class of C++ is
A2
B3
C4
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) 3
Explanation
C++ has three access specifiers: public, private and protected.
Q264BPSC TRE 2.0 (2023) Computer Science Class 11-12
Which of the following is used to define the members of a class externally in C++?
A:
B: :
C#
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) : :
Explanation
The scope resolution operator :: defines a member function outside its class, for example void A::show() { }.
Q265BPSC TRE 2.0 (2023) Computer Science Class 11-12
Which concept of C++ is used to reuse the written code?
APolymorphism
BInheritance
CEncapsulation
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) Inheritance
Explanation
Inheritance lets a derived class reuse the data and functions of an existing base class without rewriting them.
Q266BPSC TRE 2.0 (2023) Computer Science Class 11-12
What will be the output of the following program fragment?
int i = 10;
void main( )
{ int i = 20;
{
int i = 30;
printf("%d, %d", i, ::i);
}
}
A30,10
B30,20
C20,30
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) 30,10
Explanation
The innermost i is 30. ::i is the scope resolution operator and refers to the global i, which is 10, so the output is 30,10. Note that :: is valid in C++, not C.
Q267BPSC TRE 2.0 (2023) Computer Science Class 11-12
Choose the correct statement about inline function in C++.
AIt speeds up the execution.
BIt slows down the execution.
CIt decreases the code size.
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) It speeds up the execution.
Explanation
An inline function's body is substituted at the call site, so there is no function-call overhead and execution is faster. It usually makes the code bigger, not smaller.
Q268BPSC TRE 2.0 (2023) Computer Science Class 11-12
What will be the output of the following?
int a = 5;
cout << "FIRST" << (a<<2) << "SECOND";
AFIRST 52 SECOND
BFIRST 20 SECOND
CSECOND 25 FIRST
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) FIRST 20 SECOND
Explanation
a << 2 shifts 5 (101) left by two bits, giving 10100 = 20, which is the same as 5 × 4. The output is FIRST20SECOND.
Q269BPSC TRE 2.0 (2023) Computer Science Class 11-12
cout in C++ stands for
Aclass output
Bcharacter output
Ccommon output
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) common output
Explanation
Official BPSC answer key: (C). Note: most textbooks expand cout as “character output” (B).
Q270BPSC TRE 2.0 (2023) Computer Science Class 11-12
Group of instructions that directs a computer is called
Amemory
Bstorage
Cprogram
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) program
Explanation
A program is an ordered set of instructions that tells the computer what to do. Memory and storage only hold the program.
Q271BPSC TRE 2.0 (2023) Computer Science Class 11-12
A computer program consists of
Asystem flowchart
Bprogram flowchart
Calgorithms written in computer language
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) algorithms written in computer language
Explanation
A computer program is an algorithm written in a programming language that the computer can run. A flowchart only represents the logic in a diagram.
Q272BPSC TRE 2.0 (2023) Computer Science Class 11-12
The topology with highest reliability is
Astar
Bring
Cmesh
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) mesh
Explanation
In a mesh topology, every node has a dedicated link to every other node. If one link fails, other paths still exist, so mesh is the most reliable.
Q273BPSC TRE 2.0 (2023) Computer Science Class 11-12
End-to-end connectivity is provided from host-to-host in
Anetwork layer
Btransport layer
Csession layer
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) transport layer
Explanation
The transport layer (for example TCP) provides end-to-end, process-to-process delivery between the source and destination hosts. The network layer only routes packets hop by hop.
Q274BPSC TRE 2.0 (2023) Computer Science Class 11-12
The _____ measures the number of lost or garbled messages as a fraction of the total sent in the sampling period.
Aresidual error rate
Btransfer failure probability
Cconnection release failure probability
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) residual error rate
Explanation
Residual error rate is the transport-layer QoS parameter for the fraction of messages lost or garbled out of all messages sent in the sampling period.
Q275BPSC TRE 2.0 (2023) Computer Science Class 11-12
A high-speed communication equipment typically would not be needed for
Ae-mail
Btransferring large volume of data
Csupporting communication between nodes in a LAN
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) e-mail
Explanation
E-mail sends small amounts of data and does not need to arrive instantly, so it does not need high-speed equipment. Bulk data transfer and LAN links do.
Q276BPSC TRE 2.0 (2023) Computer Science Class 11-12
A _____ topology uses a single connection to connect all devices together.
Abus
Bstar
Cring
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) bus
Explanation
A bus topology connects all devices to one shared cable called the backbone.
Q277BPSC TRE 2.0 (2023) Computer Science Class 11-12
A _____ is used to connect networking devices that are in a very close geographic area such as a floor of a building.
AWAN
BLAN
CMAN
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) LAN
Explanation
A LAN (local area network) covers a small area such as a room, a floor or a building. MAN covers a city and WAN covers large distances.
Q278BPSC TRE 2.0 (2023) Computer Science Class 11-12
In computer network, what is the size of IP address in IPv4?
A8 bits
B16 bits
C32 bits
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) 32 bits
Explanation
An IPv4 address is 32 bits long, written as four 8-bit octets (for example 192.168.1.1). An IPv6 address is 128 bits.
Q279BPSC TRE 2.0 (2023) Computer Science Class 11-12
What is the size of MAC address in computer network?
A32 bits
B16 bits
C48 bits
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) 48 bits
Explanation
A MAC address is a 48-bit (6-byte) hardware address, usually written as 12 hex digits, for example 00:1A:2B:3C:4D:5E.
Q280BPSC TRE 2.0 (2023) Computer Science Class 11-12
What is the name given to the act of gaining illegal entry to computer files through remote terminals or microcomputers?
AHacking
BDecoding
CBeating the system
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) Hacking
Explanation
Hacking means gaining unauthorised access to computer systems or files, often remotely through networks or terminals.
Q281BPSC TRE 2.0 (2023) Computer Science Class 11-12
A computer virus is a software program which has the essential ability to
Adamage data
Bdamage program
Cclone itself
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) clone itself
Explanation
The defining feature of a virus is that it replicates itself (clones itself) into other programs or files. Damaging data or programs is possible but not essential.
Q282BPSC TRE 2.0 (2023) Computer Science Class 11-12
Copying computer program/ software without the permission of its authors is called
Alarceny
Bsoftware piracy
Chighway robbery
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) software piracy
Explanation
Software piracy is copying, distributing or using software without the permission (licence) of its authors or copyright holders.
Q283BPSC TRE 2.0 (2023) Computer Science Class 11-12
A hard disk becomes totally inaccessible when a computer virus corrupts
Apartition table
Bfile allocation table
Croot directory
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) partition table
Explanation
The partition table in the MBR describes where each partition lies on the disk. If it is corrupted, the system cannot find any partition, so the whole disk becomes inaccessible.
Q284BPSC TRE 2.0 (2023) Computer Science Class 11-12
An attribute of one table matching the primary key of another table is called as
Aforeign key
Bsecondary key
Ccandidate key
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) foreign key
Explanation
A foreign key is an attribute in one table that refers to the primary key of another table. It links the two tables and enforces referential integrity.
Q285BPSC TRE 2.0 (2023) Computer Science Class 11-12
If every non-key attribute is fully dependent on the primary key, then the relation will be in
AFirst Normal Form (1NF)
BSecond Normal Form (2NF)
CThird Normal Form (3NF)
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) Second Normal Form (2NF)
Explanation
2NF requires 1NF plus full functional dependency of every non-key attribute on the whole primary key, so there are no partial dependencies.
Q286BPSC TRE 2.0 (2023) Computer Science Class 11-12
In relational database, the data type of values in each column of a table is called
Aattribute
Bdomain
Crelation
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) domain
Explanation
A domain is the set of allowed values, or data type, for an attribute (column) in a relation.
Q287BPSC TRE 2.0 (2023) Computer Science Class 11-12
In relational database, the number of attributes of a relation is called the _____ of relation.
Adomain
Bdegree
Ccardinality
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) degree
Explanation
Degree is the number of attributes (columns) in a relation. Cardinality is the number of tuples (rows).
Q288BPSC TRE 2.0 (2023) Computer Science Class 11-12
Which of the following SQL commands is used to change the attribute values of one or more rows in a table?
AUpdate
BInsert
CAlter
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) Update
Explanation
UPDATE changes the values of existing rows, for example UPDATE t SET col = val WHERE .... INSERT adds rows and ALTER changes the table structure.
Q289BPSC TRE 2.0 (2023) Computer Science Class 11-12
To retrieve information from a database, which of the following SQL commands is used?
ADisplay
BShow
CSelect
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) Select
Explanation
SELECT retrieves (queries) data from one or more tables. DISPLAY and SHOW are not standard SQL query commands.
Q290BPSC TRE 2.0 (2023) Computer Science Class 11-12
Which of the following SQL commands is used to modify the structure of a table?
AAlter
BModify
CUpdate
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) Alter
Explanation
ALTER TABLE changes a table's structure, for example to add, drop or modify columns. UPDATE changes data, not structure.
Q291BPSC TRE 2.0 (2023) Computer Science Class 11-12
Which of the following SQL keywords is used to display data from a table based on certain pattern?
AIN
BLIKE
CBETWEEN
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) LIKE
Explanation
LIKE matches patterns using the wildcards % (any sequence) and _ (one character). IN tests a list and BETWEEN tests a range.
Q292BPSC TRE 2.0 (2023) Computer Science Class 11-12
Degree and cardinality of a relation in relational database are 4 and 3 respectively. If 3 attributes and 4 tuples are added to the relation, what will be its new cardinality and degree?
A7, 6
B7, 7
C8, 6
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) 7, 7
Explanation
Degree (attributes) becomes 4 + 3 = 7 and cardinality (tuples) becomes 3 + 4 = 7, so both are 7.
Q293BPSC TRE 2.0 (2023) Computer Science Class 11-12
Which SQL command is used to remove a table from a database?
ADELETE
BDROP
CERASE
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) DROP
Explanation
DROP TABLE removes the whole table, structure and data. DELETE removes only rows, and ERASE is not an SQL command.
Q294BPSC TRE 2.0 (2023) Computer Science Class 11-12
The register that contains the address of the next instruction to be executed is called
Aprogram counter
Binstruction register
Caccumulator
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) program counter
Explanation
The program counter (PC) holds the address of the next instruction to be fetched. It is incremented after each fetch.
Q295BPSC TRE 2.0 (2023) Computer Science Class 11-12
The register that contains the instruction that is being executed is called
Aaccumulator
Bprogram counter
Cinstruction register
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) instruction register
Explanation
The instruction register (IR) holds the instruction that is currently being decoded and executed.
Q296BPSC TRE 2.0 (2023) Computer Science Class 11-12
The register which holds the address of location of memory to and from which data are to be transferred is known as
Aindex register
Bmemory address register
Cmemory buffer register
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) memory address register
Explanation
The memory address register (MAR) holds the address of the memory location being read or written. The memory buffer register (MBR) holds the data itself.
Q297BPSC TRE 2.0 (2023) Computer Science Class 11-12
A storage device used to compensate the difference in flow of data is known as
Amain memory
Bauxiliary memory
Cbuffer
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) buffer
Explanation
A buffer is temporary storage that evens out the difference in data-flow speed between two devices, such as a CPU and a printer.
Q298BPSC TRE 2.0 (2023) Computer Science Class 11-12
Memory in which any location can be reached in a fixed amount of time after specifying its address is called
ASequential Access Memory
BRandom Access Memory
CSecondary Memory
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) Random Access Memory
Explanation
In random access memory, any location can be reached in the same fixed time once its address is given. Sequential memory, such as tape, depends on position.
Q299BPSC TRE 2.0 (2023) Computer Science Class 11-12
If (X567)₈ + (2YX5)₈ = (71YX)₈, then the values of X and Y are
A4, 3
B3, 3
C4, 4
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) 4, 3
Explanation
Take X=4, Y=3 and add 4567 + 2345 in octal. 7+5 = 12 = 4 carry 1, 6+4+1 = 3 carry 1, 5+3+1 = 1 carry 1, 4+2+1 = 7. The sum is 7134 = (71YX)₈.
Q300BPSC TRE 2.0 (2023) Computer Science Class 11-12
The range of the numbers that can be represented in 8-bit using 2’s complement representation is
A–128 to +128
B–127 to +127
C–128 to +127
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) –128 to +127
Explanation
With n bits, two's complement covers −2ⁿ⁻¹ to 2ⁿ⁻¹ − 1. For 8 bits that is −128 to +127.
How to use these BPSC TRE Computer Science questions
Every question here was asked in a real BPSC TRE paper; the paper and shift are shown on the card, and the number opens the question on its own page. Try each one before tapping Show answer, then attempt the full BPSC TRE papers as timed tests to check your speed under exam conditions.