BPSC TRE · Topic-wise previous year questions

Computer Science Previous Year Questions

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

Q1BPSC TRE 2.0 (2023) Computer Class 9-10
The brain of any computer system is
  1. AALU
  2. Bmemory
  3. CCPU
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) CPU

Explanation

The CPU fetches, decodes and executes instructions and controls the other parts, so it is called the brain of the computer.

Q2BPSC TRE 2.0 (2023) Computer Class 9-10
When a key is pressed on keyboard, which standard is used for converting the keystroke into the corresponding bits?
  1. AANSI
  2. BASCII
  3. CEBCDIC
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) ANSI

Explanation

Note: the official key gives (A) ANSI; the character code most commonly named for keystroke-to-bits conversion is ASCII (B). The key is kept as printed.

Q3BPSC TRE 2.0 (2023) Computer Class 9-10
What difference do the fifth generation computers have from other generation computers?
  1. ATechnological advancement
  2. BObject-oriented programming
  3. CScientific 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

Fifth-generation computers are marked both by technological advancement (AI, parallel processing) and by object-oriented programming, so more than one option applies.

Q4BPSC TRE 2.0 (2023) Computer Class 9-10
Source code is available to view, modify and redistribute in
  1. Aopen source
  2. Blicensed
  3. Cproprietary
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) open source

Explanation

Open-source software makes its source code freely available to view, change and redistribute.

Q5BPSC TRE 2.0 (2023) Computer Class 9-10
Machine language is
  1. Amachine dependent
  2. Bdifficult to program
  3. Cerror prone
  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 language depends on the processor, is hard to write and is error prone, so all of A, B and C hold (more than one).

Q6BPSC TRE 2.0 (2023) Computer Class 9-10
An assembly language is a/an
  1. Alow-level programming language
  2. Bmiddle-level programming language
  3. CInternet-based programming language
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) low-level programming language

Explanation

Assembly language uses mnemonics close to the hardware, so it is a low-level language.

Q7BPSC TRE 2.0 (2023) Computer Class 9-10
A compiler is a translating program which
  1. Atranslates instruction of a high-level language into machine language
  2. Btranslates entire source program into machine language program
  3. CIt is not involved in program's execution
  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

A compiler translates the whole high-level source program into machine code and is not part of the execution itself, so A, B and C are all true (more than one).

Q8BPSC TRE 2.0 (2023) Computer Class 9-10
Which of the following approaches is used by C++?
  1. ALeft-right
  2. BTop-down
  3. CBottom-up
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Bottom-up

Explanation

C++ is an object-oriented language that builds a program from small objects and classes upward, which is the bottom-up approach.

Q9BPSC TRE 2.0 (2023) Computer Class 9-10
What is virtual inheritance in C++?
  1. AC++ technique to enhance multiple inheritance
  2. BC++ technique to ensure that a private member of the base class can be accessed somehow
  3. CC++ technique to avoid multiple copies of the base class into children/derived class
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) C++ technique to avoid multiple copies of the base class into children/derived class

Explanation

Virtual inheritance makes derived classes share one copy of a common base class, which avoids duplicate copies in diamond-shaped inheritance.

Q10BPSC TRE 2.0 (2023) Computer Class 9-10
What is the difference between delete and delete[ ] in C++?
  1. ADelete is syntactically correct but delete[ ] is wrong and hence will give an error if used in any case
  2. BDelete is used to delete normal objects whereas delete[ ] is used to delete pointer objects
  3. CDelete is used to delete single object whereas delete[ ] is used to delete multiple (array/pointer of) objects
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Delete is used to delete single object whereas delete[ ] is used to delete multiple (array/pointer of) objects

Explanation

delete frees a single object, while delete[] frees an array of objects (and calls each destructor).

Q11BPSC TRE 2.0 (2023) Computer Class 9-10
The C++ code which causes abnormal termination/behaviour of a program should be written under _____ block.
  1. Acatch
  2. Bthrow
  3. Ctry
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) try

Explanation

Code that may raise an exception is placed inside a try block so that a matching catch block can handle it.

Q12BPSC TRE 2.0 (2023) Computer Class 9-10
Pick the incorrect statement about inline functions in C++.
  1. AThey save overhead of a return call from a function.
  2. BThey are generally very large and complicated function.
  3. CThese functions are inserted/substituted at the point of call.
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) They are generally very large and complicated function.

Explanation

Inline functions are meant for small, simple functions; saying they are generally very large and complicated is incorrect.

Q13BPSC TRE 2.0 (2023) Computer Class 9-10
What is abstract class in C++?
  1. AAny class in C++ is an abstract class/Class from which any class is derived
  2. BClass specifically used as a base class with at least one virtual function
  3. CClass specifically used as a base class with at least one pure virtual function
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Class specifically used as a base class with at least one pure virtual function

Explanation

An abstract class is a base class that has at least one pure virtual function, so it cannot be instantiated.

Q14BPSC TRE 2.0 (2023) Computer Class 9-10
Which of the following constructors is provided by the C++ compiler if not defined in a class?
  1. ACopy constructor
  2. BDefault constructor
  3. CParameterized constructor
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) Default constructor

Explanation

If a class defines no constructor at all, the compiler supplies a default constructor.

Q15BPSC TRE 2.0 (2023) Computer Class 9-10
How do structures and classes in C++ differ?
  1. AIn structures, members are private by default whereas in classes, they are public by default
  2. BIn structures, members are public by default whereas in classes, they are private by default
  3. CStructures cannot have private members whereas classes can have
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) In structures, members are public by default whereas in classes, they are private by default

Explanation

In C++ the members of a struct are public by default, while those of a class are private by default.

Q16BPSC TRE 2.0 (2023) Computer Class 9-10
The programming language that has the ability to create new data types is called
  1. Aoverloaded
  2. Bencapsulated
  3. Cextensible
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) extensible

Explanation

A language that lets the programmer define new data types is called extensible.

Q17BPSC TRE 2.0 (2023) Computer Class 9-10
Which of the following is the original creator of the C++ language?
  1. ADennis Ritchie/Brian Kernighan
  2. BKen Thompson
  3. CBjarne Stroustrup
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Bjarne Stroustrup

Explanation

C++ was created by Bjarne Stroustrup at Bell Labs.

Q18BPSC TRE 2.0 (2023) Computer Class 9-10
Which of the following is the correct syntax to read the single character to console in the C++ language?
  1. Aread ch()
  2. Bgetlinech()
  3. Cget(ch)
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (E) None of the above

Explanation

None of the listed forms is valid C++ (the correct usage is cin.get(ch)), so the answer is None of the above.

Q19BPSC TRE 2.0 (2023) Computer Class 9-10
Which of the following gives the nth element of the Array?
  1. Aarray[n];
  2. Barray[n–1];
  3. Carray[n+1];
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) array[n–1];

Explanation

Array indices start at 0, so the nth element is array[n-1].

Q20BPSC TRE 2.0 (2023) Computer Class 9-10
How many types of the array are there in the C++ programming language?
  1. AThere are three types of arrays
  2. BThere are four types of arrays
  3. CThere are two types of arrays
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) There are two types of arrays

Explanation

C++ arrays are classified as one-dimensional and multi-dimensional, i.e. two types, as the official key accepts.

Q21BPSC TRE 2.0 (2023) Computer Class 9-10
In C++, for what purpose the "rank()" is used?
  1. AIt returns the size of each dimension
  2. BIt returns the maximum number of elements that can be stored in the array
  3. CIt returns the dimension of the specified array
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) It returns the dimension of the specified array

Explanation

rank() reports the number of dimensions of an array type.

Q22BPSC TRE 2.0 (2023) Computer Class 9-10
What is the scope of the variable declared in the user-defined function?
  1. AWhole program
  2. BOnly inside the { } block
  3. CInside the main function
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) Only inside the { } block

Explanation

A variable declared inside a function is local and visible only within that function's { } block.

Q23BPSC TRE 2.0 (2023) Computer Class 9-10
Which one of the following is the correct definition of the "is_array();" function in C++?
  1. AIt checks that the specified variable is of the array or not
  2. BIt checks that the specified array is of single dimension or not
  3. CIt checks that the array specified is of multi-dimension or not
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) It checks that the specified variable is of the array or not

Explanation

is_array checks whether the given type or variable is an array.

Q24BPSC TRE 2.0 (2023) Computer Class 9-10
Which of the following statements is true about the new and malloc? I. The 'new' is a type of operator while 'malloc' is a kind of function. II. The 'new' invokes a constructor, whereas 'malloc' does not invoke the constructor. III. The 'malloc' returns void pointer and also needed to typecast whereas 'new' returns required pointer.
  1. AOnly I
  2. BBoth I and II
  3. CBoth II and III
  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 (new is an operator that calls constructors; malloc is a function returning void*), so more than one option, i.e. (D), is correct.

Q25BPSC TRE 2.0 (2023) Computer Class 9-10
Which of the following can be considered as the members that can be inherited but not accessible in any class?
  1. APublic
  2. BProtected
  3. CPrivate
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Private

Explanation

Private members are inherited by a derived class but cannot be accessed directly from it.

Q26BPSC TRE 2.0 (2023) Computer Class 9-10
Which of the following statements is completely true? I. In an object-oriented programming language, all the function calls are resolved at compile-time. II. In a procedure programming language, all the function calls are resolved at compile-time.
  1. AOnly II
  2. BOnly I
  3. CBoth I and II
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) Only II

Explanation

Object-oriented languages also use run-time (virtual) binding, so I is false; in procedural languages every call is resolved at compile time, so only II is true.

Q27BPSC TRE 2.0 (2023) Computer Class 9-10
What will happen if in a C++ program, a class has no name?
  1. AIt is not even allowed in C++
  2. BIt will not have the constructor
  3. CIt will not have the destructor
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) It will not have the destructor

Explanation

An unnamed class is allowed, but a destructor is declared with the class name, so such a class cannot declare a destructor; the official key is (C).

Q28BPSC TRE 2.0 (2023) Computer Class 9-10
How can one implement the compile-time polymorphism in the C++ programming language?
  1. ABy using the template
  2. BBy using the concepts of inheritance
  3. CBy using both the virtual functions and inheritance
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) By using the template

Explanation

Templates (along with overloading) are resolved at compile time, so they implement compile-time polymorphism; virtual functions give run-time polymorphism.

Q29BPSC TRE 2.0 (2023) Computer Class 9-10
Which of the following refers to the wrapping of data and its functionality into a single individual entity?
  1. AModularity
  2. BAbstraction
  3. CEncapsulation
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Encapsulation

Explanation

Bundling data and the functions that work on it into one unit is encapsulation.

Q30BPSC TRE 2.0 (2023) Computer Class 9-10
Among the following, which statement is correct about the modularity?
  1. AModularity means hiding the parts of the program.
  2. BModularity refers to dividing a program into subsequent small modules or independent parts.
  3. CIt refers to overloading the program's part.
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) Modularity refers to dividing a program into subsequent small modules or independent parts.

Explanation

Modularity means splitting a program into small independent modules.

Q31BPSC TRE 2.0 (2023) Computer Class 9-10
Which one of the following is not the application of the stack data structure?
  1. AAsynchronous data transfer
  2. BString reversal
  3. CBacktracking
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) Asynchronous data transfer

Explanation

Stacks are used for string reversal and backtracking; asynchronous data transfer is handled with queues (buffers), so it is not a stack application.

Q32BPSC TRE 2.0 (2023) Computer Class 9-10
Which of the following is the prefix form of A+B*C?
  1. A+A*BC
  2. BABC+*
  3. C+AB*C
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) +A*BC

Explanation

B*C becomes *BC, and A + (B*C) in prefix is +A*BC.

Q33BPSC TRE 2.0 (2023) Computer Class 9-10
Which data structure is required to convert the infix to prefix notation?
  1. AQueue
  2. BStack
  3. CLinked list
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) Stack

Explanation

The conversion holds operators on a stack while scanning the expression, so a stack is needed.

Q34BPSC TRE 2.0 (2023) Computer Class 9-10
Which of the following highly uses the concept of an array?
  1. ABinary search tree
  2. BScheduling of processes
  3. CSpatial locality
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Spatial locality

Explanation

Spatial locality relies on elements being stored in contiguous memory, which is exactly how arrays are laid out.

Q35BPSC TRE 2.0 (2023) Computer Class 9-10
The necessary condition to be checked before deletion from the queue is
  1. Afront value
  2. Bunderflow
  3. Coverflow
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) underflow

Explanation

Before dequeuing, one must check that the queue is not empty, i.e. underflow.

Q36BPSC TRE 2.0 (2023) Computer Class 9-10
Which one of the following is not the application of the queue data structure?
  1. AData is transferred asynchronously
  2. BResource is shared between various systems
  3. CBalancing of symbols
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Balancing of symbols

Explanation

Balancing of symbols (parentheses) is done with a stack, not a queue.

Q37BPSC TRE 2.0 (2023) Computer Class 9-10
Which one of the following techniques is not used in the binary tree?
  1. APreorder traversal
  2. BInorder traversal
  3. CPostorder traversal
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (E) None of the above

Explanation

Preorder, inorder and postorder are all binary-tree traversals, so none of A-C is the odd one out.

Q38BPSC TRE 2.0 (2023) Computer Class 9-10
How can we describe an array in the best possible way?
  1. AArrays are immutable
  2. BContainer that stores the elements of similar types
  3. CThe array is not a data structure
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) Container that stores the elements of similar types

Explanation

An array is a container that stores elements of the same type.

Q39BPSC TRE 2.0 (2023) Computer Class 9-10
What is another name for the circular queue among the following options?
  1. ARectangle buffer
  2. BSquare buffer
  3. CRing buffer
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Ring buffer

Explanation

A circular queue is also called a ring buffer.

Q40BPSC TRE 2.0 (2023) Computer Class 9-10
Which of the following determines the need for the circular queue?
  1. AAccess the queue using priority
  2. BAvoid wastage of memory
  3. CFollow the FIFO principle
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) Avoid wastage of memory

Explanation

A circular queue reuses the freed slots at the front, which avoids wasting memory.

Q41BPSC TRE 2.0 (2023) Computer Class 9-10
Which data structure is the best for implementing a priority queue?
  1. ALinked list
  2. BArray
  3. CBinary heap
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Binary heap

Explanation

A binary heap gives O(log n) insertion and removal of the highest-priority item, better than a list or array.

Q42BPSC TRE 2.0 (2023) Computer Class 9-10
Which of the following data structures finds its use in recursion?
  1. AStack
  2. BLinked list
  3. CArray
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) Stack

Explanation

Recursive calls are kept in the call stack, so the stack is used.

Q43BPSC TRE 2.0 (2023) Computer Class 9-10
Which of the following satisfies the property of the red-black tree?
  1. ABlack, if the new node is a root node
  2. BRed, if the new node is not a root node
  3. CBlack, if the new node is not a root node
  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

In a red-black tree the root is black and a newly inserted non-root node is coloured red, so both A and B hold (more than one).

Q44BPSC TRE 2.0 (2023) Computer Class 9-10
In the deque implementation, using singly linked list, what would be the time complexity of deleting an element from the rear end?
  1. AO(1)
  2. BO(N log N)
  3. CO(N)
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) O(N)

Explanation

In a singly linked list the node before the tail must be found by traversing the whole list, so deleting from the rear takes O(N).

Q45BPSC TRE 2.0 (2023) Computer Class 9-10
Which one of the following is the overflow condition if linear queue is implemented using an array with a size MAX_SIZE?
  1. Arear = MAX_SIZE–1
  2. Brear = MAX_SIZE
  3. Crear = front+1
  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

Depending on whether rear points at the last used slot or one past it, both rear = MAX_SIZE-1 and rear = MAX_SIZE are accepted overflow conditions, so more than one is correct.

Q46BPSC TRE 2.0 (2023) Computer Class 9-10
Which of the following is a divide-and-conquer algorithm?
  1. AMerge sort
  2. BHeap sort
  3. CBubble sort
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (A) Merge sort

Explanation

Merge sort splits the list in halves, sorts them and merges, which is divide and conquer.

Q47BPSC TRE 2.0 (2023) Computer Class 9-10
What is a database?
  1. AOrganized collection of information that cannot be accessed, updated and managed
  2. BOrganized collection of data or information that can be accessed, updated and managed
  3. COrganized collection of data that cannot be updated
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) Organized collection of data or information that can be accessed, updated and managed

Explanation

A database is an organised collection of data that can be accessed, updated and managed.

Q48BPSC TRE 2.0 (2023) Computer Class 9-10
Which type of data can be stored in the database?
  1. AImage-oriented data
  2. BText, files containing data
  3. CData in the form of audio or video
  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

A database can hold images, text/files and audio or video data, so more than one option is correct.

Q49BPSC TRE 2.0 (2023) Computer Class 9-10
Which of the following is not a type of database?
  1. ANetwork
  2. BDistributed
  3. CDecentralized
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Decentralized

Explanation

Network and distributed are standard database types; 'decentralized' is not a classical database type.

Q50BPSC TRE 2.0 (2023) Computer Class 9-10
Which of the following is not an example of DBMS?
  1. AMicrosoft access
  2. BIBM Db2
  3. CGoogle
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Google

Explanation

Microsoft Access and IBM Db2 are DBMS products; Google is a search engine company, not a DBMS.

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