solution - BPSC TRE Computer science Test-2

Question : Character readers are those devices which read the characters printed on the source documents and then convert them directly into computer usable input. which of he following is not a character reader ?

Solution : OCR

Description -

Optical Character Recognition (OCR) Devices

Devices that read printed or handwritten characters and convert them into digital input for a computer are called:

  • OCR (Optical Character Recognition) devices

  • These scan printed documents, recognize the characters using pattern recognition or AI, and convert them into editable digital text.

Examples:

  • Document scanners with OCR software

  • Bank cheque readers

  • Passport/ID scanners

BPSC TRE Computer science Test-2

Question : which of the following is not a type of database ?

Solution : Transition

Description -

category or classification of a database based on how it stores, organizes, and manages data. Here are the main types of databases:


1. Relational Databases (RDBMS)

  • Structure: Tables (rows and columns)

  • Use Case: Structured data, transactional systems

  • Examples:

    • MySQL

    • PostgreSQL

    • Oracle Database

    • Microsoft SQL Server


2. NoSQL Databases

Designed for unstructured or semi-structured data. Four main subtypes:

a. Document Databases

  • Structure: JSON-like documents

  • Examples: MongoDB, CouchDB

b. Key-Value Stores

  • Structure: Key-value pairs

  • Examples: Redis, Amazon DynamoDB

c. Column-Family Stores

  • Structure: Columns grouped into families

  • Examples: Apache Cassandra, HBase

d. Graph Databases

  • Structure: Nodes and edges (for relationships)

  • Examples: Neo4j, Amazon Neptune


3. Time-Series Databases

  • Optimized for: Time-stamped or time-series data

  • Examples: InfluxDB, TimescaleDB


4. Object-Oriented Databases

  • Structure: Objects (like in OOP languages)

  • Examples: db4o, ObjectDB


5. NewSQL Databases

  • Hybrid: Combine SQL structure with NoSQL scalability

  • Examples: Google Spanner, CockroachDB


6. Hierarchical and Network Databases

  • Legacy systems: Tree (hierarchical) or graph (network) structures

  • Examples: IBM IMS (hierarchical), IDMS (network)

BPSC TRE Computer science Test-2

Question : Parameter passing to function is called :

Solution : all of the above

Description -

 

Method What is Passed Can Modify Original? Common in
Call by Value Copy of the value  No C, Java (primitives)
Call by Address Address of variable  Yes C (with pointers), C++
Call by Name Expression (unevaluated) Depends ALGOL, theoretical

BPSC TRE Computer science Test-2

Question : Assembly language is a -

Solution : Low Level Language

Description -

Assembly language is a low-level programming language. Here's what that means in more detail:

Key Characteristics of Assembly Language:

  1. Close to Hardware:
    Assembly is just one step above machine code (binary). Each assembly instruction typically corresponds directly to a single machine instruction for a specific CPU architecture.

  2. Architecture-Specific:
    Assembly is written for a specific processor (like x86, ARM, MIPS, etc.), and code written for one type won't run on another without modification.

  3. Human-Readable (to a degree):
    While it's more readable than raw binary or hex machine code, it’s still very detailed and technical. For example, instead of writing 10110000 01100001 (in binary), you might write MOV AL, 61h in assembly.

  4. Manual Control:
    Programmers have precise control over registers, memory addresses, and instruction execution, which is useful for:

    • Writing performance-critical code

    • Writing device drivers or embedded systems

    • Learning how computers work at a fundamental level

  5. No Built-in Abstractions:
    Unlike high-level languages (e.g., Python, Java), assembly has no built-in support for complex data types, error handling, or memory management—you have to handle all of that manually.

BPSC TRE Computer science Test-2

Question : Which logic gates is known as coincidence detector?

Solution : AND

Description -

The logic gate known as a coincidence detector is the AND gate.

An AND gate only outputs HIGH (1) when all its inputs are HIGH (1) simultaneously. This "simultaneity" or "coincidence" of input signals is what makes it a coincidence detector.

Example:

Input A Input B Output (A AND B)
0 0 0
0 1 0
1 0 0
1 1 1

Only when A = 1 and B = 1 — a "coincidence" — does the output become 1.

BPSC TRE Computer science Test-2

Question : Encapsulation is also know as -

Solution : information hiding

Description -

Encapsulation is one of the fundamental principles of Object-Oriented Programming (OOP). It refers to the bundling of data (variables) and the methods (functions) that operate on that data into a single unit, typically a class. It also involves restricting direct access to some of an object's components, which is a way of protecting the internal state of an object from unintended or harmful changes.

Key Concepts of Encapsulation:

  1. Data Hiding:

    • Only expose what is necessary.

    • Use access modifiers (like private, protected, and public) to control access to class members.

  2. Getter and Setter Methods:

    • Use getters to retrieve data.

    • Use setters to update data, often with validation.

BPSC TRE Computer science Test-2

Question : E-Commerce refers to -

Solution : Electronic commerce

Description -

BPSC TRE Computer science Test-2

Question : In C++, by default, the members of a class are :

Solution : Private

Description - In C++, by default, the members of a class are private.

BPSC TRE Computer science Test-2

Question : Which of the following is an operating system call?

Solution : None of these

Description -

An operating system (OS) call, commonly referred to as a system call, is a way for programs to interact with the operating system. When a user application wants the OS to perform a task (like reading a file or creating a process), it makes a system call.

What System Calls Do

System calls provide an interface between:

  • User space (where applications run)

  • Kernel space (where the OS runs)

User programs cannot directly access hardware or critical OS functions, so they use system calls to request services from the OS.

 

Examples of Common System Calls

Here's a breakdown by category:

Category System Calls (Linux/UNIX examples) Description
Process Control fork(), exec(), exit() Create or end processes
File Management open(), read(), write(), close() Manage files
Device Management ioctl(), read(), write() Access I/O devices
Information Maintenance getpid(), alarm(), sleep() Get system info, set timers
Communication pipe(), shmget(), mmap() Inter-process communication (IPC)

BPSC TRE Computer science Test-2

Question : Which of the following is not used as a data structure?

Solution : Directory

Description -

List of data structure given below : 

    

Linear Data Structures

These structures store data in a sequential manner.

  1. Array

  2. Linked List

    • Singly Linked List

    • Doubly Linked List

    • Circular Linked List

  3. Stack

  4. Queue

    • Simple Queue

    • Circular Queue

    • Priority Queue

    • Deque (Double-Ended Queue)


Non-Linear Data Structures

These structures don’t store data sequentially.

  1. Tree

    • Binary Tree

    • Binary Search Tree (BST)

    • AVL Tree

    • Red-Black Tree

    • Segment Tree

    • B-Tree / B+ Tree

    • Trie (Prefix Tree)

  2. Graph

    • Directed Graph (Digraph)

    • Undirected Graph

    • Weighted Graph

    • Unweighted Graph

    • Directed Acyclic Graph (DAG)


Hash-Based Structures

Fast lookup by keys.

  1. Hash Table

  2. Hash Map

  3. Hash Set


Specialized or Advanced Data Structures

Used for specific applications or performance improvements.

  1. Heap

    • Min-Heap

    • Max-Heap

    • Fibonacci Heap

  2. Disjoint Set (Union-Find)

  3. Suffix Tree / Suffix Array

  4. Bloom Filter

  5. Skip List

  6. Fenwick Tree (Binary Indexed Tree)


Abstract Data Types (ADTs)

These define behavior rather than implementation.

  1. List

  2. Stack

  3. Queue

  4. Deque

  5. Map / Dictionary

  6. Set

  7. Graph

  8. Tree

BPSC TRE Computer science Test-2

Question : An encoder has 2^n input lines and ...... output lines.

Solution : n

Description -

An encoder with 2^n input lines has n output lines.

 

Explanation:

  • The encoder’s job is to encode one active input line (out of 2^n possible inputs) into an n-bit binary code.

  • Since there are 2^n input lines, the number of output lines must be enough to represent all those inputs uniquely in binary.

  • n output lines can represent 2^n unique combinations (from 0 to 2^n1).

So:

Encoder with 2n input lines has n output lines.

BPSC TRE Computer science Test-2

Question : Which of the following scheduler is in charge of handling the swapped out process?

Solution : Medium term

Description -

In an operating system (OS), the term "swapped out process" refers to a process that has been temporarily removed from main memory (RAM) and placed into secondary storage (usually a swap space or page file on disk) to free up memory for other active processes.

What Does "Swapped Out" Mean?

  • Swapping is a memory management technique.

  • When the system is low on RAM, it swaps out less active or idle processes to disk.

  • This allows more active processes to use physical memory.

  • The swapped-out process is not currently executable until it is swapped back in.

 

The medium-term scheduler is responsible for managing suspended (swapped-out) processes. It controls which of them should be swapped back into memory (RAM) to become eligible for execution.

Key Responsibilities of the Medium-Term Scheduler:

Function Description
Swapping Out Chooses a process to suspend and swap out to disk to free up memory.
Swapping In Decides when a suspended process should be brought back into RAM.
Balancing Load Helps balance CPU and memory usage by controlling the degree of multiprogramming.

BPSC TRE Computer science Test-2

Question : __________________allows you to upload web pages.

Solution : HTTP

Description -

HTTP (HyperText Transfer Protocol) is the foundational protocol used for communication on the World Wide Web. It defines how messages are formatted and transmitted, and how web servers and browsers should respond to various requests.

Key Points:

  • Protocol Type: Application layer protocol in the Internet protocol suite.

  • Purpose: Transfers data (like HTML documents, images, videos) between a client (usually a web browser) and a server.

  • Stateless: Each request is independent; the server doesn't retain any memory of previous requests.

  • Uses: Used to load web pages, send form data, retrieve APIs, etc.

Basic HTTP Operations (Methods):

  • GET: Retrieve data from the server.

  • POST: Send data to the server (e.g., form submissions).

  • PUT: Update existing data.

  • DELETE: Remove data.

BPSC TRE Computer science Test-2

Question : The maximum number of nodes on level 5 of a binary tree

Solution : 16

Description -

Maximum number of node at level 'n' in binary tree is 2^(n-1).

 if, n=5 then,

           maximum number of node is 2^(5-1) =16

      

BPSC TRE Computer science Test-2

Question : For tree, which of the following list traversing through the entire list is not necessary

Solution : Circular list

Description -

1. Circular Linked List

➤ Circular Singly Linked List (CSLL)

  • Each node points to the next node, and the last node points back to the first.

  • No NULL at the end.

  • One direction only.

 

 

Use cases: Round-robin scheduling, buffering.


➤ Circular Doubly Linked List (CDLL)

  • Each node points to both the next and the previous node.

  • Last node's next → first node, and first node's prev → last node.

 

Use cases: Multimedia playlists, complex data navigation.


 2. Singly Linked List (SLL)

  • Each node has:

    • data

    • next pointer

  • Last node’s next = NULL

  • One-way traversal only.

 

 

Pros: Simple, efficient memory usage
Cons: No backward traversal


 3. Doubly Linked List (DLL)

  • Each node has:

    • data

    • next pointer

    • prev pointer

  • Traversal in both directions

  • First node’s prev = NULL

  • Last node’s next = NULL

 

 

Pros: Easy to navigate both directions
Cons: More memory (extra pointer), slightly complex logic

BPSC TRE Computer science Test-2

Question : The ARP is a part of the ____________________layer of the TCP/IP network.

Solution : Network

Description -

ARP (Address Resolution Protocol) is a part of the Link layer (also known as the Network Interface layer) of the TCP/IP network model.

Explanation:

  • In the TCP/IP model, the Link layer is the lowest layer and is responsible for interactions with the physical network hardware.

  • ARP operates at this layer to map IP addresses (Network layer addresses) to MAC addresses (Link layer addresses), allowing devices to communicate on a local network.

BPSC TRE Computer science Test-2

Question : A linear list of elements in which deletion can be done from one end and insertion can take place only at the other end (rear) is known as :

Solution : Queues

Description -

In Data Structures (DS), a queue is a linear data structure that follows the FIFO principle — First In, First Out.

Definition:

A queue is a collection of elements where:

  • Insertion (enqueue) happens at the rear (end).

  • Deletion (dequeue) happens at the front (beginning).

 

Real-life Examples:

  • A line at a ticket counter.

  • Print jobs in a printer queue.

  • Task scheduling in operating systems.

BPSC TRE Computer science Test-2

Question : To change the ciphertext into plain text is known as-

Solution : Decryption

Description -

Encryption / Decryption

Term Purpose Input Output Key Required? Use Case
Encryption Protect data by making it unreadable to unauthorized users Plaintext Ciphertext ✅ Yes Secure communication, file protection
Decryption Revert encrypted data back to its original form Ciphertext Plaintext ✅ Yes Reading encrypted emails, unlocking files

 

Encoding / Decoding

Term Purpose Input Output Key Required? Use Case
Encoding Convert data into a specific format for transmission or storage Data (text, binary, etc.) Encoded format (ASCII, Base64) ❌ No Data transmission, compatibility
Decoding Revert encoded data back to original format Encoded data Original data ❌ No Reading encoded messages or files

 

 

BPSC TRE Computer science Test-2

Question : In OSI network architecture, the routing is performed by:

Solution : network layer

Description -

The Network Layer is the third layer in the OSI (Open Systems Interconnection) model of computer networking. It is responsible for routing, addressing, and delivering data packets from the source host to the destination host across multiple networks.

 

Key Functions of the Network Layer:

  1. Logical Addressing

    • Assigns IP addresses to devices.

    • Ensures each device on a network can be uniquely identified.

  2. Routing

    • Determines the best path for data to travel across interconnected networks.

    • Uses routing algorithms and protocols (like OSPF, BGP).

  3. Packet Forwarding

    • Forwards data packets from one network to another based on destination IP.

  4. Fragmentation & Reassembly

    • Breaks packets into smaller fragments to accommodate different network technologies, and reassembles them at the destination.

  5. Error Handling and Diagnostics

    • Supports diagnostics tools like ICMP (e.g., ping, traceroute).

BPSC TRE Computer science Test-2

Question : Segmentation

Solution : All of the above

Description -

In operating systems, segmentation is a memory management technique that divides a process’s memory into different segments based on the logical divisions of a program. Each segment represents a different type of information, such as code, data, stack, heap, etc. This is different from paging, where memory is divided into fixed-size blocks.

Components of Segmentation

  1. Logical Address:

    • Composed of two parts:
      (Segment Number, Offset)
      Example: (2, 50) → 50th byte in segment 2.

  2. Segment Table:

    • OS uses a segment table for each process.

    • Each entry has:

      • Base: Starting address of the segment in physical memory.

      • Limit: Length of the segment.

    • Helps convert logical address → physical address.

  3. Address Translation:

     Valid if: Offset < Limit
     Invalid if: Offset ≥ Limit (causes segmentation fault)

Advantages of Segmentation

 -Reflects the logical view of a program
 -Supports modular programming
 -Allows independent segment protection
 -Segments can grow/shrink independently


 Disadvantages

-Can cause external fragmentation
-More complex than paging
-Slower address translation compared to paging

BPSC TRE Computer science Test-2