BPSC TRE · Topic-wise previous year questions

Computer Science Previous Year Questions (page 6)

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.

  • 313 questions
  • 9 topics
  • Official answer key
  • Free

Practise by topic

Q251BPSC TRE 2.0 (2023) Computer Science Class 11-12
The cost of storing a bit is minimum in
  1. Acache
  2. Bregister
  3. Cmagnetic tape
  4. DMore than one of the above
  5. 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
  1. A2²⁰
  2. B2⁴⁰
  3. C2³⁰
  4. DMore than one of the above
  5. 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?
  1. ALoader
  2. BLinker
  3. CAssembler
  4. DMore than one of the above
  5. 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
  1. Aab+cd−*
  2. Babcd+−*
  3. Cab+cd*−
  4. DMore than one of the above
  5. 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?
  1. AStack
  2. BQueue
  3. CTree
  4. DMore than one of the above
  5. 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
  1. Astack
  2. Bqueue
  3. Clinked list
  4. DMore than one of the above
  5. 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
  1. AFIFO
  2. BLIFO
  3. CLILO
  4. DMore than one of the above
  5. 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
  1. AFIFO
  2. BLIFO
  3. CLILO
  4. DMore than one of the above
  5. 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
  1. Aan object is created
  2. Ba class is created
  3. Ca class is declared
  4. DMore than one of the above
  5. 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.
  1. Apublic
  2. Bprivate
  3. Cprotected
  4. DMore than one of the above
  5. 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.
  1. Apublic
  2. Bprivate
  3. Cprotected
  4. DMore than one of the above
  5. 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?
  1. AArray
  2. BData
  3. CData and functions
  4. DMore than one of the above
  5. 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
  1. A2
  2. B3
  3. C4
  4. DMore than one of the above
  5. 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++?
  1. A:
  2. B: :
  3. C#
  4. DMore than one of the above
  5. 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?
  1. APolymorphism
  2. BInheritance
  3. CEncapsulation
  4. DMore than one of the above
  5. 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); } }
  1. A30,10
  2. B30,20
  3. C20,30
  4. DMore than one of the above
  5. 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++.
  1. AIt speeds up the execution.
  2. BIt slows down the execution.
  3. CIt decreases the code size.
  4. DMore than one of the above
  5. 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";
  1. AFIRST 52 SECOND
  2. BFIRST 20 SECOND
  3. CSECOND 25 FIRST
  4. DMore than one of the above
  5. 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
  1. Aclass output
  2. Bcharacter output
  3. Ccommon output
  4. DMore than one of the above
  5. 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
  1. Amemory
  2. Bstorage
  3. Cprogram
  4. DMore than one of the above
  5. 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
  1. Asystem flowchart
  2. Bprogram flowchart
  3. Calgorithms written in computer language
  4. DMore than one of the above
  5. 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
  1. Astar
  2. Bring
  3. Cmesh
  4. DMore than one of the above
  5. 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
  1. Anetwork layer
  2. Btransport layer
  3. Csession layer
  4. DMore than one of the above
  5. 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.
  1. Aresidual error rate
  2. Btransfer failure probability
  3. Cconnection release failure probability
  4. DMore than one of the above
  5. 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
  1. Ae-mail
  2. Btransferring large volume of data
  3. Csupporting communication between nodes in a LAN
  4. DMore than one of the above
  5. 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.
  1. Abus
  2. Bstar
  3. Cring
  4. DMore than one of the above
  5. 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.
  1. AWAN
  2. BLAN
  3. CMAN
  4. DMore than one of the above
  5. 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?
  1. A8 bits
  2. B16 bits
  3. C32 bits
  4. DMore than one of the above
  5. 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?
  1. A32 bits
  2. B16 bits
  3. C48 bits
  4. DMore than one of the above
  5. 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?
  1. AHacking
  2. BDecoding
  3. CBeating the system
  4. DMore than one of the above
  5. 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
  1. Adamage data
  2. Bdamage program
  3. Cclone itself
  4. DMore than one of the above
  5. 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
  1. Alarceny
  2. Bsoftware piracy
  3. Chighway robbery
  4. DMore than one of the above
  5. 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
  1. Apartition table
  2. Bfile allocation table
  3. Croot directory
  4. DMore than one of the above
  5. 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
  1. Aforeign key
  2. Bsecondary key
  3. Ccandidate key
  4. DMore than one of the above
  5. 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
  1. AFirst Normal Form (1NF)
  2. BSecond Normal Form (2NF)
  3. CThird Normal Form (3NF)
  4. DMore than one of the above
  5. 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
  1. Aattribute
  2. Bdomain
  3. Crelation
  4. DMore than one of the above
  5. 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.
  1. Adomain
  2. Bdegree
  3. Ccardinality
  4. DMore than one of the above
  5. 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?
  1. AUpdate
  2. BInsert
  3. CAlter
  4. DMore than one of the above
  5. 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?
  1. ADisplay
  2. BShow
  3. CSelect
  4. DMore than one of the above
  5. 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?
  1. AAlter
  2. BModify
  3. CUpdate
  4. DMore than one of the above
  5. 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?
  1. AIN
  2. BLIKE
  3. CBETWEEN
  4. DMore than one of the above
  5. 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?
  1. A7, 6
  2. B7, 7
  3. C8, 6
  4. DMore than one of the above
  5. 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?
  1. ADELETE
  2. BDROP
  3. CERASE
  4. DMore than one of the above
  5. 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
  1. Aprogram counter
  2. Binstruction register
  3. Caccumulator
  4. DMore than one of the above
  5. 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
  1. Aaccumulator
  2. Bprogram counter
  3. Cinstruction register
  4. DMore than one of the above
  5. 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
  1. Aindex register
  2. Bmemory address register
  3. Cmemory buffer register
  4. DMore than one of the above
  5. 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
  1. Amain memory
  2. Bauxiliary memory
  3. Cbuffer
  4. DMore than one of the above
  5. 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
  1. ASequential Access Memory
  2. BRandom Access Memory
  3. CSecondary Memory
  4. DMore than one of the above
  5. 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
  1. A4, 3
  2. B3, 3
  3. C4, 4
  4. DMore than one of the above
  5. 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
  1. A–128 to +128
  2. B–127 to +127
  3. C–128 to +127
  4. DMore than one of the above
  5. 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.

More BPSC TRE subjects