BPSC TRE · Topic-wise previous year questions

Computer Science Previous Year Questions (page 3)

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

Q101BPSC TRE 3.0 (2024) Computer Science Class 11-12
How many distinct binary search trees can be created out of 4 distinct keys?
  1. A8
  2. B24
  3. C14
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) 14

Explanation

The number of distinct BSTs on n keys is the Catalan number C(n) = (2n)!/((n+1)! n!). For n = 4, C(4) = 14.

Q102BPSC TRE 3.0 (2024) Computer Science Class 11-12
#include <stdio.h> int main() { int i = 5, j = 10, k = 15; printf("%d ", sizeof(k /=i+j)); printf("%d", k); return 0; } Assume size of an integer as 4 bytes. What is the output of above program?
  1. A2 1
  2. B4 1
  3. C4 15
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) 4 15

Explanation

sizeof only looks at the type of its operand and does not evaluate the expression, so k /= i+j never runs. It prints 4 (size of int), then k is still 15.

Q103BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following statements is true about Big-O notation?
  1. AIt represents the lower bound of an algorithm’s runtime.
  2. BIt represents the upper bound of an algorithm’s runtime
  3. CIt represents the average runtime of an algorithm.
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) It represents the upper bound of an algorithm’s runtime

Explanation

Big-O gives an asymptotic upper bound on the growth of an algorithm's running time, usually used for the worst case. Big-Omega gives the lower bound.

Q104BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is NOT a step in the Divide and Conquer algorithm?
  1. ACombine
  2. BConquer
  3. CDivide
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (E) None of the above

Explanation

Divide and Conquer has three steps: divide, conquer and combine. All three listed options are steps, so none of them is "NOT a step".

Q105BPSC TRE 3.0 (2024) Computer Science Class 11-12
Merge Sort is an example of which algorithm design paradigm?
  1. AGreedy
  2. BDivide and Conquer
  3. CDynamic Programming
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) Divide and Conquer

Explanation

Merge sort splits the array into halves, sorts each half recursively and merges them, which is the divide-and-conquer paradigm.

Q106BPSC TRE 3.0 (2024) Computer Science Class 11-12
How many edges does a spanning tree of a graph with N vertices have?
  1. AN
  2. BN − 1
  3. CN(N − 1)/2
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) N − 1

Explanation

A spanning tree connects all N vertices with no cycle, so it has exactly N − 1 edges.

Q107BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is NOT a graph traversal algorithm?
  1. AGreedy
  2. BDivide and Conquer
  3. CDynamic Programming
  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

Greedy, Divide and Conquer and Dynamic Programming are algorithm design paradigms, not graph traversal algorithms (BFS and DFS are), so more than one option is correct.

Q108BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is NOT an NP-Complete problem?
  1. ATraveling Salesman Problem
  2. BBoolean Satisfiability Problem
  3. CShortest Path Problem
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Shortest Path Problem

Explanation

The shortest path problem can be solved in polynomial time (for example with Dijkstra's algorithm), so it is not NP-complete. TSP (decision version) and SAT are NP-complete.

Q109BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is an advantage of using arrays?
  1. AConstant time insertion and deletion
  2. BAbility to store elements of different data types
  3. CRandom access to elements using an index
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Random access to elements using an index

Explanation

Array elements sit in contiguous memory, so any element can be accessed directly by its index in O(1). Insertion and deletion cost O(n), and the elements must all be the same type.

Q110BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is NOT a basic operation performed on a data structure?
  1. AEncryption
  2. BDeletion
  3. CInsertion
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) Encryption

Explanation

Basic data structure operations are traversal, insertion, deletion, searching, sorting and merging. Encryption is a security operation.

Q111BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is a type of operating system?
  1. AReal-time operating system
  2. BEmbedded operating system
  3. CNetwork operating system
  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

Real-time, embedded and network operating systems are all types of OS, so more than one option is correct.

Q112BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is NOT a memory management technique used by operating systems?
  1. APaging
  2. BSegmentation
  3. CFragmentation
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Fragmentation

Explanation

Paging and segmentation are memory management techniques. Fragmentation is a problem (wasted memory) they have to deal with, not a technique.

Q113BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is a file system commonly used in operating systems?
  1. ANTFS
  2. BFAT32
  3. CHFS+
  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

NTFS (Windows), FAT32 (Windows and removable media) and HFS+ (macOS) are all common file systems, so more than one option is correct.

Q114BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is NOT a type of interrupt?
  1. AHardware interrupt
  2. BMemory interrupt
  3. CSoftware interrupt
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) Memory interrupt

Explanation

The interrupt types are hardware, software (traps) and internal or exception interrupts. "Memory interrupt" is not a standard type.

Q115BPSC TRE 3.0 (2024) Computer Science Class 11-12
What is a page in paging?
  1. AA fixed-size block of virtual memory
  2. BA fixed-size block of physical memory
  3. CA type of memory allocation
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) A fixed-size block of virtual memory

Explanation

A page is a fixed-size block of the logical (virtual) address space. The matching fixed-size block of physical memory is called a frame.

Q116BPSC TRE 3.0 (2024) Computer Science Class 11-12
In a system with a page size of 4 KB and a physical address space of 64 GB, what is the number of bits required for the page offset?
  1. A10 bits
  2. B12 bits
  3. C14 bits
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) 12 bits

Explanation

The offset must address every byte in a page: 4 KB = 2¹² bytes, so 12 offset bits are needed. The 64 GB physical size affects only the frame number.

Q117BPSC TRE 3.0 (2024) Computer Science Class 11-12
What is a segment base in segmentation?
  1. AThe starting address of a segment in physical memory
  2. BThe starting address of a segment in virtual memory
  3. CThe ending address of a segment in physical memory
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) The starting address of a segment in physical memory

Explanation

The segment base is the starting physical address where the segment is placed in memory, and the limit gives its length.

Q118BPSC TRE 3.0 (2024) Computer Science Class 11-12
What causes thrashing to occur?
  1. AExcessive paging activity
  2. BInsufficient disk space
  3. CHardware failures
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) Excessive paging activity

Explanation

Thrashing happens when processes do not have enough frames, so pages are swapped in and out constantly. The CPU then spends more time paging than executing.

Q119BPSC TRE 3.0 (2024) Computer Science Class 11-12
Consider a system with a total physical memory of 8 GB and total virtual memory of 16 GB. If the system is using 6 GB of physical memory and 10 GB of virtual memory, how much memory is being swapped out?
  1. A2 GB
  2. B4 GB
  3. C6 GB
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) 2 GB

Explanation

Official BPSC final answer key: (A). Note: many solutions take 10 GB used − 6 GB physical = 4 GB swapped out, option (B).

Q120BPSC TRE 3.0 (2024) Computer Science Class 11-12
How is the TLB typically organized?
  1. AAs a direct-mapped cache
  2. BAs an associative cache
  3. CAs a set-associative cache
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) As an associative cache

Explanation

A TLB is a small, fast associative memory that compares all its entries at once, so it is typically organised as an associative cache.

Q121BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is a common file operation?
  1. ACreate
  2. BDelete
  3. CRename
  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

Create, delete and rename are all standard file operations, along with open, read, write and close. More than one option is correct.

Q122BPSC TRE 3.0 (2024) Computer Science Class 11-12
Consider a disk queue with requests for I/O to blocks on cylinders. 98 183 37 122 14 124 65 67 considering FCFS (First Come First Served) scheduling, the total number of head movements is, if the disk head is initially at 53 is?
  1. A640
  2. B620
  3. C630
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) 640

Explanation

Head movements: 53→98 (45), 183 (85), 37 (146), 122 (85), 14 (108), 124 (110), 65 (59), 67 (2). The total is 640 cylinders.

Q123BPSC TRE 3.0 (2024) Computer Science Class 11-12
Thread shares with other threads belonging to the same process its
  1. Athread ID
  2. Bprogram counter
  3. Ccode section and data section
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) code section and data section

Explanation

Threads of the same process share the code section, the data section and OS resources such as open files. Each thread has its own thread ID, program counter, registers and stack.

Q124BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is NOT a type of DBMS?
  1. ARelational DBMS
  2. BObject-Oriented DBMS
  3. CSequential DBMS
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Sequential DBMS

Explanation

Relational, object-oriented, hierarchical and network are types of DBMS. "Sequential" describes a file organisation, not a DBMS model.

Q125BPSC TRE 3.0 (2024) Computer Science Class 11-12
In a relational database, what is a primary key?
  1. AA key used to uniquely identify each record in a table
  2. BA key used to establish relationships between tables
  3. CA key used to sort records in a table
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) A key used to uniquely identify each record in a table

Explanation

A primary key uniquely identifies each record (row) in a table and cannot be NULL. Linking tables is the job of a foreign key.

Q126BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which normal form ensures that every non-prime attribute in a table is fully functionally dependent on the primary key?
  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 and that every non-prime attribute depend fully on the whole primary key, with no partial dependency on part of a composite key.

Q127BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which SQL command is used to add new rows to a database table?
  1. AADD
  2. BCREATE
  3. CINSERT
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) INSERT

Explanation

INSERT INTO table VALUES (...) adds new rows. CREATE makes database objects such as tables.

Q128BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is a disadvantage of using a distributed database system?
  1. AImproved data accessibility
  2. BIncreased data security
  3. CData inconsistency
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Data inconsistency

Explanation

Copies of the same data at several sites can get out of sync, which causes data inconsistency. Better data accessibility is an advantage.

Q129BPSC TRE 3.0 (2024) Computer Science Class 11-12
What is the primary function of a router in a computer network?
  1. ATo connect devices within the same network
  2. BTo connect multiple networks together
  3. CTo filter incoming traffic based on IP addresses
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) To connect multiple networks together

Explanation

A router connects separate networks and forwards packets between them using IP addresses. Devices within one LAN are connected by a switch.

Q130BPSC TRE 3.0 (2024) Computer Science Class 11-12
In the OSI model, which layer is responsible for routing and forwarding data packets?
  1. AData Link Layer
  2. BTransport Layer
  3. CPhysical Layer
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (E) None of the above

Explanation

Routing and forwarding packets is the job of the Network Layer (Layer 3), which is not among the options.

Q131BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which device is used to connect multiple devices within the same local area network (LAN)?
  1. ARouter
  2. BSwitch
  3. CBridge
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) Switch

Explanation

A switch connects many devices within the same LAN and forwards frames to the correct port using MAC addresses. A router links different networks.

Q132BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which protocol is used to send email over the Internet?
  1. AFTP
  2. BSMTP
  3. CHTTP
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) SMTP

Explanation

SMTP (Simple Mail Transfer Protocol) sends email between servers. FTP transfers files and HTTP serves web pages.

Q133BPSC TRE 3.0 (2024) Computer Science Class 11-12
What is the purpose of a subnet mask in TCP/IP networking?
  1. ATo identify the network portion of an IP address
  2. BTo identify the host portion of an IP address
  3. CTo convert IP addresses into domain names
  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

The subnet mask separates an IP address into its network and host portions: the 1 bits mark the network part and the 0 bits mark the host part. So A and B are both correct.

Q134BPSC TRE 3.0 (2024) Computer Science Class 11-12
What is the maximum data rate of Bluetooth version 5.0?
  1. A1 Mbps
  2. B2 Mbps
  3. C5 Mbps
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) 2 Mbps

Explanation

Bluetooth 5.0 (Low Energy) supports a maximum data rate of 2 Mbps, twice the 1 Mbps of Bluetooth 4.x LE.

Q135BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is a software development life cycle model?
  1. AWaterfall model
  2. BAgile model
  3. CSpiral model
  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

Waterfall, Agile and Spiral are all SDLC models, so more than one option is correct.

Q136BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is NOT a software development requirement?
  1. AFunctional requirements
  2. BSystem requirements
  3. CPhysical requirements
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Physical requirements

Explanation

Software requirements are classified as functional, non-functional and system requirements. "Physical requirements" is not a standard category.

Q137BPSC TRE 3.0 (2024) Computer Science Class 11-12
What is the main difference between verification and validation in software testing?
  1. AVerification ensures that the software is bug-free, while validation ensures that it meets the requirements.
  2. BVerification is done before coding, while validation is done after coding.
  3. CVerification checks if the software is built right, while validation checks if the right software is built.
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Verification checks if the software is built right, while validation checks if the right software is built.

Explanation

Verification asks "are we building the product right?" (does it match the specification). Validation asks "are we building the right product?" (does it meet user needs).

Q138BPSC TRE 3.0 (2024) Computer Science Class 11-12
What is the purpose of a software prototype?
  1. ATo serve as the final version of the software
  2. BTo replace detailed documentation
  3. CTo speed up the software development process
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (E) None of the above

Explanation

A prototype is an early working model built to understand and refine user requirements through feedback. It is not the final version, does not replace documentation, and is not mainly meant to speed up development.

Q139BPSC TRE 3.0 (2024) Computer Science Class 11-12
What is the primary goal of software engineering?
  1. ATo write code efficiently
  2. BTo develop software that meets user requirements within budget and schedule constraints
  3. CTo develop software with the latest technologies
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) To develop software that meets user requirements within budget and schedule constraints

Explanation

Software engineering aims to deliver quality software that meets user requirements within budget and on schedule.

Q140BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is a pillar of OOP?
  1. AInheritance
  2. BEncapsulation
  3. CAbstraction
  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

Inheritance, encapsulation and abstraction, along with polymorphism, are the pillars of OOP, so more than one option is correct.

Q141BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which keyword is used in Java to implement inheritance?
  1. Aextends
  2. Binherits
  3. Cimplements
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) extends

Explanation

Java uses extends for class inheritance (class B extends A). implements is used with interfaces, and inherits is not a Java keyword.

Q142BPSC TRE 3.0 (2024) Computer Science Class 11-12
What is the access specifier used to make members of a class accessible only within the same package?
  1. Aprivate
  2. Bpublic
  3. Cpackage-private
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) package-private

Explanation

Java's default (package-private) access, with no modifier at all, makes a member visible only to classes in the same package.

Q143BPSC TRE 3.0 (2024) Computer Science Class 11-12
Inheritance in OOP allows a class to:
  1. AInherit properties and behavior from another class
  2. BCreate instances of another class
  3. COverride methods of another class
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) Inherit properties and behavior from another class

Explanation

Inheritance lets a class acquire the properties (fields) and behaviour (methods) of another class. Overriding is a separate feature that inheritance makes possible.

Q144BPSC TRE 3.0 (2024) Computer Science Class 11-12
What is the purpose of HTML in a web application?
  1. ATo define the structure of web pages
  2. BTo style web pages
  3. CTo add interactivity to web pages
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) To define the structure of web pages

Explanation

HTML defines the structure and content of web pages. CSS adds styling and JavaScript adds interactivity.

Q145BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is an example of a server-side scripting language commonly used in web applications?
  1. AHTML
  2. BCSS
  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

HTML and CSS are client-side markup and styling languages, and C++ is not a web scripting language. Server-side languages such as PHP, ASP or JSP are not listed.

Q146BPSC TRE 3.0 (2024) Computer Science Class 11-12
What is the computational complexity of the halting problem?
  1. AO(1)
  2. BO(n)
  3. CNot computable
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Not computable

Explanation

Turing proved the halting problem is undecidable: no algorithm can decide for every program and input whether it halts. So it has no computational complexity; it is not computable.

Q147BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is NOT a component of a Turing machine?
  1. AInput tape
  2. BOutput tape
  3. CControl unit
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) Output tape

Explanation

A standard Turing machine has an input tape (which is also its working tape), a read/write head and a finite control unit. It has no separate output tape.

Q148BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which wireless communication technology is commonly used in IoT devices for short-range communication?
  1. ABluetooth
  2. BWi-Fi
  3. C4G LTE
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) Bluetooth

Explanation

Bluetooth (including BLE) is a low-power, short-range wireless technology widely used in IoT devices. Wi-Fi and 4G cover longer ranges and use more power.

Q149BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is an example of an IoT protocol used for device communication?
  1. AHTTP
  2. BFTP
  3. CMQTT
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) MQTT

Explanation

MQTT is a lightweight publish-subscribe messaging protocol designed for IoT device communication.

Q150BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is a subfield of AI?
  1. AMachine Learning
  2. BRobotics
  3. CNatural Language Processing
  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

Machine learning, robotics and natural language processing are all subfields of AI, so more than one option is correct.

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