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.
Q151BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is a supervised learning algorithm?
ADecision Tree
BK-means Clustering
CReinforcement Learning
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) Decision Tree
Explanation
A decision tree learns from labelled training data, so it is supervised learning. K-means is unsupervised, and reinforcement learning is a separate paradigm.
Q152BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is NOT a common type of E-Commerce model?
ABusiness-to-Consumer (B2C)
BConsumer-to-Business (C2B)
CConsumer-to-Consumer (C2C)
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (E) None of the above
Explanation
B2C, C2B and C2C are all common e-commerce models, so none of them is the odd one out.
Q153BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is an example of a B2C E-Commerce website?
AAlibaba
BAmazon
CGoogle
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) Amazon
Explanation
Amazon sells products directly to individual consumers, making it B2C. Alibaba is mainly B2B, and Google is a search engine.
Q154BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is a multimedia authoring tool?
AMicrosoft Word
BAdobe Photoshop
CAdobe Flash
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) Adobe Flash
Explanation
Adobe Flash was used to create interactive multimedia (animation, audio, video), so it is an authoring tool. Word is a word processor and Photoshop is an image editor.
Q155BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which of the following is a technique that marks the beginning of computer communications?
AUser Environment
BBatch Environment
CTime Sharing
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) Time Sharing
Explanation
Time sharing let many users at remote terminals use one computer interactively at the same time, which is seen as the start of computer communications.
Q156BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which language is better for writing structured code?
APASCAL
BFORTRAN
CBASIC
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) PASCAL
Explanation
Pascal was designed by Niklaus Wirth to teach structured programming. It has block structure and control structures, so it is better suited to structured code than FORTRAN or BASIC.
Q157BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which language does a browser use to display information from the World Wide Web?
AMachine code
BAssembly language
CC++
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (E) None of the above
Explanation
Browsers display web pages written in HTML (with CSS and JavaScript). None of the options is HTML: machine code, assembly language and C++ are not used to describe web pages.
Q158BPSC TRE 1.0 (2023) Computer Science Class 11-12
Select the true statement for compiler.
AThe input of the compiler is source program.
BIt translates the source code into object code as a whole.
CThe output of the compiler is object code.
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (D) More than one of the above
Explanation
All three statements are true: a compiler takes the source program as input, translates the whole of it at once, and produces object code as output.
Q159BPSC TRE 1.0 (2023) Computer Science Class 11-12
_____ is used to shift processes so they are contiguous, and all free memory is in one block.
AFragmentation
BCompaction
CExternal Fragmentation
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) Compaction
Explanation
Compaction moves the processes in memory so they sit next to each other, which gathers all free memory into one block and removes external fragmentation.
Q160BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which of the following is not a valid variable name in most programming languages?
AmyVariable
B123Variable
C_myVariable
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) 123Variable
Explanation
In most languages, identifiers cannot begin with a digit, so 123Variable is invalid. myVariable and _myVariable are valid.
Q161BPSC TRE 1.0 (2023) Computer Science Class 11-12
Secondary memory is the longterm store for programs and data while main memory holds program and data currently in use. What kind of an organization is this?
APhysical
BLogical
CStructural
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) Physical
Explanation
This describes the physical organisation of memory: secondary storage keeps programs and data long-term, while main memory holds what is currently in use.
Q162BPSC TRE 1.0 (2023) Computer Science Class 11-12
If a semicolon is not used at the end of the statement, what message will be displayed by C++?
ASemicolon missing
BStatement missing
CError in statements
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (E) None of the above
Explanation
Turbo C++ reports "Statement missing ;" and modern compilers say "expected ';'". None of the listed messages matches exactly.
Q163BPSC TRE 1.0 (2023) Computer Science Class 11-12
A set of libraries that provides programmatically access to some kind of graphics 2D functions is
AGraphics package
BFormatting package
CAnimation package
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) Graphics package
Explanation
A graphics package is a set of libraries, such as graphics.h, that gives programs functions for drawing 2D graphics.
Q164BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which shortcut key is used to compile and run the program in C++?
AAlt+F9
BAlt+F5
CCtrl+F9
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) Ctrl+F9
Explanation
In Turbo C++, Ctrl+F9 compiles and runs the program. Alt+F9 only compiles, and Alt+F5 shows the output screen.
Q165BPSC TRE 1.0 (2023) Computer Science Class 11-12
What does the control unit generate to control other units?
ATiming signals
BCommand signals
CControl signals
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) Control signals
Explanation
The control unit sends control signals (timing and control pulses) to the ALU, memory and I/O to direct how they work.
Q166BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which of the following is userdefined header file extension used in C++?
Ahg
Bcpp
Ch
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) h
Explanation
User-defined header files in C++ use the .h extension, for example #include "myfile.h". .cpp is used for source files.
Q167BPSC TRE 1.0 (2023) Computer Science Class 11-12
The most common addressing technique employed by a CPU is
Adirect
Bindirect
Cimmediate
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (D) More than one of the above
Explanation
Direct, indirect and immediate addressing are all commonly used by CPUs, so more than one option applies.
Q168BPSC TRE 1.0 (2023) Computer Science Class 11-12
What will happen if the following C++ statement is compiled and executed?
int *ptr = NULL;
delete ptr;
AThe program is not semantically correct
BThe program is compiled and executed successfully
CThe program gives a compile-time error
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) The program is compiled and executed successfully
Explanation
Deleting a null pointer is a no-op that the C++ standard guarantees to be safe. The code compiles and runs normally.
Q169BPSC TRE 1.0 (2023) Computer Science Class 11-12
In various devices, _____ are used to overcome the difference in data transfer speed.
Amultiple buses
Bbuffer registers
Cspeed-enhancing circuitries
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) buffer registers
Explanation
Buffer registers temporarily hold data so that fast and slow devices, which transfer data at different speeds, can work together.
Q170BPSC TRE 1.0 (2023) Computer Science Class 11-12
What do we use to extend the connectivity of the processor bus?
APCI bus
BMultiple bus
CSCSI bus
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) PCI bus
Explanation
A PCI bus, connected through a bridge, extends the processor bus so that more devices can be attached.
Q171BPSC TRE 1.0 (2023) Computer Science Class 11-12
In memory mapped I/O
Athe I/O devices and the memory share the same address space
Bthe I/O devices have a separate address space
Cthe memory and I/O devices have an associated address space
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) the I/O devices and the memory share the same address space
Explanation
In memory-mapped I/O, I/O device registers are given addresses in the same address space as memory. The same load and store instructions then access both.
Q172BPSC TRE 1.0 (2023) Computer Science Class 11-12
What is the addressing called that is used in an instruction of the form ADD X Y?
AIndirect
BIndex
CAbsolute
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) Absolute
Explanation
In ADD X Y the operands are given by their memory addresses X and Y, which is absolute (direct) addressing.
Q173BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which of the following correctly declares an array in C++?
Aarray{10};
Bint array;
Cint array[10];
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) int array[10];
Explanation
int array[10]; declares an array of 10 integers by giving the type, the name and the size in square brackets.
Q174BPSC TRE 1.0 (2023) Computer Science Class 11-12
SQL views are also known as
Asimple tables
Bvirtual tables
Ccomplex tables
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) virtual tables
Explanation
A view is a virtual table, the stored result of a query. It does not hold its own data and is built from the base tables when used.
Q175BPSC TRE 1.0 (2023) Computer Science Class 11-12
How many primary keys can be there in a table?
AOnly 1
BOnly 2
CDepends on number of columns
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) Only 1
Explanation
A table can have only one primary key, although that key may be made of several columns (a composite key).
Q176BPSC TRE 1.0 (2023) Computer Science Class 11-12
What will be the output of the following C++ code?
#include<iostream>
#include<string>
using namespace std;
int main(int argc, char const *argv[ ])
{
char s1[6]="Hello";
char s2[6]="World";
char s3[12]=s1+" "+s2;
cout<<s3;
return 0;
}
AHello
BWorld
CError
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) Error
Explanation
Char arrays cannot be joined with +. s1 + " " tries to add two pointers, which is invalid, and an array cannot be initialised from such an expression, so the code gives a compile error.
Q177BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which of the following is not constraint in SQL?
APrimary key
BNot null
CUnion
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) Union
Explanation
UNION is a set operator that combines the results of queries. PRIMARY KEY and NOT NULL are constraints.
Q178BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which of the following is not a valid aggregate function?
ACOUNT
BCOMPUTE
CSUM
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) COMPUTE
Explanation
COUNT, SUM, AVG, MIN and MAX are aggregate functions. COMPUTE is not a standard SQL aggregate function.
Q179BPSC TRE 1.0 (2023) Computer Science Class 11-12
Who is the father of computer?
AJames Gosling
BCharles Babbage
CDennis Ritchie
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) Charles Babbage
Explanation
Charles Babbage designed the Difference Engine and the Analytical Engine, so he is called the father of the computer. Gosling created Java and Ritchie created C.
Q180BPSC TRE 1.0 (2023) Computer Science Class 11-12
If we have not specified ASC or DESC after an SQL ORDER BY clause, which of the following is used by default?
ADESC
BASC
CThere is no default value
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) ASC
Explanation
ORDER BY sorts in ascending (ASC) order by default.
Q181BPSC TRE 1.0 (2023) Computer Science Class 11-12
In IA-32 architecture along with the general flags, which of the following conditional flags is provided?
ATF
BIOPL
CIF
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (D) More than one of the above
Explanation
Besides the condition flags (CF, ZF, SF, OF), the IA-32 EFLAGS register also provides TF (trap), IF (interrupt enable) and IOPL (I/O privilege level), so more than one option is correct.
Q182BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which of the following is true about the HAVING clause?
ASimilar to the WHERE clause but is used for columns rather than groups
BSimilar to WHERE clause but is used for rows rather than columns
CSimilar to WHERE clause but is used for groups rather than rows
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) Similar to WHERE clause but is used for groups rather than rows
Explanation
HAVING filters groups made by GROUP BY, while WHERE filters individual rows before they are grouped.
Q183BPSC TRE 1.0 (2023) Computer Science Class 11-12
The method of accessing the I/O devices by repeatedly checking the status flags is
Aprogram-controlled I/O
Bmemory-mapped I/O
CI/O-mapped I/O
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) program-controlled I/O
Explanation
In program-controlled I/O (polling), the CPU keeps checking a device's status flag until the device is ready.
Q184BPSC TRE 1.0 (2023) Computer Science Class 11-12
_____ clause creates temporary relation for the query on which it is defined.
AWITH
BFROM
CWHERE
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) WITH
Explanation
The WITH clause (a common table expression) defines a temporary named relation that exists only for that query.
Q185BPSC TRE 1.0 (2023) Computer Science Class 11-12
The SQL statement SELECT ROUND (65.726, -1) FROM DUAL; prints
A70
Bgarbage
C726
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) 70
Explanation
ROUND(65.726, −1) rounds to the nearest ten, because a negative position counts left of the decimal point, so 65.726 becomes 70.
Q186BPSC TRE 1.0 (2023) Computer Science Class 11-12
The matrix contains m rows and n columns. The matrix is called Sparse Matrix if
Atotal number of zero elements > (m × n)/2
Btotal number of zero elements = m + n
Ctotal number of zero elements = m / n
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) total number of zero elements > (m × n)/2
Explanation
A matrix is sparse when most of its elements are zero, meaning more than half of the m × n elements.
Q187BPSC TRE 1.0 (2023) Computer Science Class 11-12
_____ command makes the updates performed by the transaction permanent in the database.
AROLLBACK
BCOMMIT
CTRUNCATE
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) COMMIT
Explanation
COMMIT makes the changes made by a transaction permanent. ROLLBACK undoes them, and TRUNCATE removes all rows from a table.
Q188BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which of the following is the basic approach for joining tables?
AUnion JOIN
BNatural JOIN
CSubqueries
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (D) More than one of the above
Explanation
Tables can be joined with join operations such as natural join and union join, or by using subqueries, so more than one option applies.
Q189BPSC TRE 1.0 (2023) Computer Science Class 11-12
What is the time complexity of an infix to postfix conversion algorithm?
AO(N log N)
BO(N²)
CO(N)
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) O(N²)
Explanation
Note: the answer key gives (B), but infix-to-postfix conversion scans each symbol once and pushes and pops each operator at most once on the stack, so it takes O(N) time.
Q190BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which of the following is the advantage of the array data structure?
AElements of mixed data types can be stored
BEasier to access the elements in an array
CIndex of the first element starts from 1
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) Easier to access the elements in an array
Explanation
Array elements are stored next to each other, so any element can be reached directly by its index in O(1) time. Arrays hold only one data type, and indexing starts at 0.
Q191BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which data structure is mainly used for implementing the recursive algorithm?
AQueue
BStack
CBinary tree
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) Stack
Explanation
Recursion uses a stack. Each call pushes an activation record, and the record is popped when the call returns.
Q192BPSC TRE 1.0 (2023) Computer Science Class 11-12
What is the postfix expression for the corresponding infix expression?
a + b * c + (d * e)
Aabc*+de*+
Babc+*de*+
Ca+bc*de+*
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) abc*+de*+
Explanation
For a + (b*c) + (d*e): bc* is added to a to give abc*+, then de* is added to give abc*+de*+.
Q193BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which one of the following is not the type of queue?
ALinear queue
BCircular queue
CDouble-ended queue
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (E) None of the above
Explanation
Linear, circular and double-ended queues (deques) are all real types of queue, so none of the options is wrong.
Q194BPSC TRE 1.0 (2023) Computer Science Class 11-12
The necessary condition to be checked before deletion from the queue is
Aoverflow
Bunderflow
Crear value
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (B) underflow
Explanation
Before deleting, check for underflow (an empty queue). Overflow is checked before inserting.
Q195BPSC TRE 1.0 (2023) Computer Science Class 11-12
After performing following set of operations, what does the final list look contain?
InsertFront(10);
InsertFront(20);
InsertRear(30);
DeleteFront( );
InsertRear(40);
InsertRear(10);
DeleteRear( );
InsertRear(15);
display( );
A10 30 10 15
B20 30 40 15
C10 30 40 15
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) 10 30 40 15
Explanation
After the steps the deque is: 10; 20 10; 20 10 30; 10 30; 10 30 40; 10 30 40 10; 10 30 40; then 10 30 40 15.
Q196BPSC TRE 1.0 (2023) Computer Science Class 11-12
A linear data structure in which insertion and deletion operations can be performed from both the ends is
Aqueue
Bcircular queue
Cdeque
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) deque
Explanation
A deque (double-ended queue) allows insertion and deletion at both the front and the rear.
Q197BPSC TRE 1.0 (2023) Computer Science Class 11-12
If circular queue is implemented using array having size MAX_SIZE in which array index starts with 0, front points to the first element in the queue, and rear points to the last element in the queue. Which one of the following conditions is used to specify that the circular queue is empty?
AFront = rear = −1
BFront = rear = 0
CFront = rear + 1
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) Front = rear = −1
Explanation
With this convention, front and rear start at −1. Front = rear = −1 means the queue is empty, and front = rear ≥ 0 means it holds one element.
Q198BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which one of the following techniques is not used in the binary tree?
ARandomized traversal
BPreorder traversal
CPostorder traversal
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (A) Randomized traversal
Explanation
Binary trees are traversed in preorder, inorder, postorder or level order. Randomized traversal is not a standard binary tree technique.
Q199BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which of the following is not a feature of DBMS?
AMinimum duplication and redundancy of data
BHigh-level of security
CSingle-user access only
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) Single-user access only
Explanation
A DBMS supports access by many users at once (concurrency control). Single-user-only access is not a DBMS feature.
Q200BPSC TRE 1.0 (2023) Computer Science Class 11-12
Which of the following statements is not true about the doubly linked list?
AWe can traverse in both the directions.
BIt requires extra space.
CImplementation of doubly linked list is easier than the singly linked list.
DMore than one of the above
ENone of the above
Show answerHide answer
Correct answer: (C) Implementation of doubly linked list is easier than the singly linked list.
Explanation
A doubly linked list allows traversal in both directions but needs extra space for the previous pointer. It is harder to implement than a singly linked list, not easier.
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.