BPSC TRE · Topic-wise previous year questions

Computer Science Previous Year Questions (page 4)

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

Q151BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is a supervised learning algorithm?
  1. ADecision Tree
  2. BK-means Clustering
  3. CReinforcement Learning
  4. DMore than one of the above
  5. 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?
  1. ABusiness-to-Consumer (B2C)
  2. BConsumer-to-Business (C2B)
  3. CConsumer-to-Consumer (C2C)
  4. DMore than one of the above
  5. 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?
  1. AAlibaba
  2. BAmazon
  3. CGoogle
  4. DMore than one of the above
  5. 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?
  1. AMicrosoft Word
  2. BAdobe Photoshop
  3. CAdobe Flash
  4. DMore than one of the above
  5. 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?
  1. AUser Environment
  2. BBatch Environment
  3. CTime Sharing
  4. DMore than one of the above
  5. 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?
  1. APASCAL
  2. BFORTRAN
  3. CBASIC
  4. DMore than one of the above
  5. 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?
  1. AMachine code
  2. BAssembly language
  3. CC++
  4. DMore than one of the above
  5. 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.
  1. AThe input of the compiler is source program.
  2. BIt translates the source code into object code as a whole.
  3. CThe output of the compiler is object code.
  4. DMore than one of the above
  5. 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.
  1. AFragmentation
  2. BCompaction
  3. CExternal Fragmentation
  4. DMore than one of the above
  5. 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?
  1. AmyVariable
  2. B123Variable
  3. C_myVariable
  4. DMore than one of the above
  5. 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?
  1. APhysical
  2. BLogical
  3. CStructural
  4. DMore than one of the above
  5. 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++?
  1. ASemicolon missing
  2. BStatement missing
  3. CError in statements
  4. DMore than one of the above
  5. 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
  1. AGraphics package
  2. BFormatting package
  3. CAnimation package
  4. DMore than one of the above
  5. 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++?
  1. AAlt+F9
  2. BAlt+F5
  3. CCtrl+F9
  4. DMore than one of the above
  5. 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?
  1. ATiming signals
  2. BCommand signals
  3. CControl signals
  4. DMore than one of the above
  5. 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++?
  1. Ahg
  2. Bcpp
  3. Ch
  4. DMore than one of the above
  5. 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
  1. Adirect
  2. Bindirect
  3. Cimmediate
  4. DMore than one of the above
  5. 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;
  1. AThe program is not semantically correct
  2. BThe program is compiled and executed successfully
  3. CThe program gives a compile-time error
  4. DMore than one of the above
  5. 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.
  1. Amultiple buses
  2. Bbuffer registers
  3. Cspeed-enhancing circuitries
  4. DMore than one of the above
  5. 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?
  1. APCI bus
  2. BMultiple bus
  3. CSCSI bus
  4. DMore than one of the above
  5. 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
  1. Athe I/O devices and the memory share the same address space
  2. Bthe I/O devices have a separate address space
  3. Cthe memory and I/O devices have an associated address space
  4. DMore than one of the above
  5. 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?
  1. AIndirect
  2. BIndex
  3. CAbsolute
  4. DMore than one of the above
  5. 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++?
  1. Aarray{10};
  2. Bint array;
  3. Cint array[10];
  4. DMore than one of the above
  5. 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
  1. Asimple tables
  2. Bvirtual tables
  3. Ccomplex tables
  4. DMore than one of the above
  5. 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?
  1. AOnly 1
  2. BOnly 2
  3. CDepends on number of columns
  4. DMore than one of the above
  5. 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; }
  1. AHello
  2. BWorld
  3. CError
  4. DMore than one of the above
  5. 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?
  1. APrimary key
  2. BNot null
  3. CUnion
  4. DMore than one of the above
  5. 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?
  1. ACOUNT
  2. BCOMPUTE
  3. CSUM
  4. DMore than one of the above
  5. 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?
  1. AJames Gosling
  2. BCharles Babbage
  3. CDennis Ritchie
  4. DMore than one of the above
  5. 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?
  1. ADESC
  2. BASC
  3. CThere is no default value
  4. DMore than one of the above
  5. 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?
  1. ATF
  2. BIOPL
  3. CIF
  4. DMore than one of the above
  5. 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?
  1. ASimilar to the WHERE clause but is used for columns rather than groups
  2. BSimilar to WHERE clause but is used for rows rather than columns
  3. CSimilar to WHERE clause but is used for groups rather than rows
  4. DMore than one of the above
  5. 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
  1. Aprogram-controlled I/O
  2. Bmemory-mapped I/O
  3. CI/O-mapped I/O
  4. DMore than one of the above
  5. 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.
  1. AWITH
  2. BFROM
  3. CWHERE
  4. DMore than one of the above
  5. 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
  1. A70
  2. Bgarbage
  3. C726
  4. DMore than one of the above
  5. 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
  1. Atotal number of zero elements > (m × n)/2
  2. Btotal number of zero elements = m + n
  3. Ctotal number of zero elements = m / n
  4. DMore than one of the above
  5. 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.
  1. AROLLBACK
  2. BCOMMIT
  3. CTRUNCATE
  4. DMore than one of the above
  5. 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?
  1. AUnion JOIN
  2. BNatural JOIN
  3. CSubqueries
  4. DMore than one of the above
  5. 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?
  1. AO(N log N)
  2. BO(N²)
  3. CO(N)
  4. DMore than one of the above
  5. 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?
  1. AElements of mixed data types can be stored
  2. BEasier to access the elements in an array
  3. CIndex of the first element starts from 1
  4. DMore than one of the above
  5. 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?
  1. AQueue
  2. BStack
  3. CBinary tree
  4. DMore than one of the above
  5. 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)
  1. Aabc*+de*+
  2. Babc+*de*+
  3. Ca+bc*de+*
  4. DMore than one of the above
  5. 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?
  1. ALinear queue
  2. BCircular queue
  3. CDouble-ended queue
  4. DMore than one of the above
  5. 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
  1. Aoverflow
  2. Bunderflow
  3. Crear value
  4. DMore than one of the above
  5. 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( );
  1. A10 30 10 15
  2. B20 30 40 15
  3. C10 30 40 15
  4. DMore than one of the above
  5. 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
  1. Aqueue
  2. Bcircular queue
  3. Cdeque
  4. DMore than one of the above
  5. 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?
  1. AFront = rear = −1
  2. BFront = rear = 0
  3. CFront = rear + 1
  4. DMore than one of the above
  5. 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?
  1. ARandomized traversal
  2. BPreorder traversal
  3. CPostorder traversal
  4. DMore than one of the above
  5. 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?
  1. AMinimum duplication and redundancy of data
  2. BHigh-level of security
  3. CSingle-user access only
  4. DMore than one of the above
  5. 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?
  1. AWe can traverse in both the directions.
  2. BIt requires extra space.
  3. CImplementation of doubly linked list is easier than the singly linked list.
  4. DMore than one of the above
  5. 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.

More BPSC TRE subjects