solution - BPSC TRE Computer science Test-1

Question : A central computer surrounded by one or more satellite computers is called a

Solution : Star network

Description -

Network topology refers to the arrangement of devices (nodes) and connections (links) in a computer network. It defines how data flows between different network components.

Main Types of Network Topologies:

  1. Bus Topology:

    • All devices are connected to a single central cable.

    • Cheap and easy for small networks.

    • Downside: A cable failure can bring down the entire network.

  2. Star Topology:

    • All devices connect to a central hub or switch.

    • Easy to manage and troubleshoot.

    • If the hub fails, the whole network goes down.

  3. Ring Topology:

    • Devices are connected in a circular manner.

    • Data travels in one direction (or both in dual-ring).

    • One device failure can affect the entire network unless a dual ring is used.

  4. Mesh Topology:

    • Every device is connected to every other device.

    • High redundancy and reliability.

    • Expensive and complex to set up.

  5. Tree Topology:

    • A combination of star and bus topologies.

    • Hierarchical structure, ideal for large networks.

  6. Hybrid Topology:

    • Mix of two or more topologies.

    • Flexible and scalable.

 

  • Physical Topology: The actual layout of cables and devices.

  • Logical Topology: How data moves through the network, regardless of its physical design.

BPSC TRE Computer science Test-1

Question : Access control is achieved at the________________layer.

Solution : data link

Description -

The Data Link Layer is responsible for node-to-node communication and local delivery of frames on the same network segment. Access control at this layer is focused on controlling which devices can connect to or communicate within the local network.

 

Data Link Layer Access Control Matters

  • It's the first line of defense before traffic even reaches IP-layer security.

  • Prevents unauthorized physical or wireless devices from joining the network.

  • Helps reduce risk of MAC spoofing, ARP poisoning, or rogue devices.

Access control at the Data Link Layer is achieved through mechanisms like MAC filtering, 802.1X authentication, port security, and VLANs to restrict which devices can access and communicate within a local network.

BPSC TRE Computer science Test-1

Question : The Network layer is responsible for ____________ delivery of a packet.

Solution : source to destination

Description -

The Network layer (Layer 3 of the OSI model) is responsible for the delivery of packets between devices across different networks. Its main responsibilities include:

  1. Routing – Determining the best path for data to travel from source to destination across interconnected networks.

  2. Logical addressing – Assigning IP addresses to devices, ensuring each device can be uniquely identified on a network.

  3. Packet forwarding – Sending packets from the source to the destination using routers.

  4. Fragmentation and reassembly – Breaking large packets into smaller fragments (if needed) and reassembling them at the destination.

  5. Error handling and diagnostics – Using tools like ICMP (Internet Control Message Protocol) for error messages and operational queries (e.g., ping or traceroute).

Protocols commonly used at the Network layer include:

  • IP (Internet Protocol) – IPv4 and IPv6

  • ICMP (Internet Control Message Protocol)

  • ARP (Address Resolution Protocol) – Although often considered between Layers 2 and 3

BPSC TRE Computer science Test-1

Question : The function of presentation layer is to __________________

Solution : Encrypt data

Description -

The presentation layer is the 6th layer of the OSI (Open Systems Interconnection) model, and its primary function is to translate data between the application layer and the network. It ensures that the data sent from the application layer of one system can be read and understood by the application layer of another system, regardless of differences in data formats.

Main Functions of the Presentation Layer:

  1. Translation

    • Converts data from a format used by the application layer into a common format at the sender, and vice versa at the receiver.

    • Example: Converting between different character encoding systems like ASCII and EBCDIC.

  2. Encryption/Decryption

    • Ensures data security by encrypting data before transmission and decrypting it upon reception.

    • Example: SSL/TLS encryption in secure web communications.

  3. Compression/Decompression

    • Reduces the size of data to improve transmission speed and efficiency.

    • Example: Compressing image or video files before sending.

  4. Serialization

    • Converts structured data into a format suitable for transmission (e.g., JSON, XML).

BPSC TRE Computer science Test-1

Question : CPU scheduling :

Solution : all of the above

Description -

CPU Scheduling is the process used by operating systems to determine which process in the ready queue will be assigned to the CPU for execution. Since the CPU can execute only one process at a time (in a single-core system), scheduling is crucial for managing process execution efficiently.

Key Points:

  • Purpose: Maximize CPU utilization and system responsiveness while ensuring fairness among processes.

  • Types of Scheduling:

    • Preemptive: The CPU can be taken away from a running process (e.g., Round Robin, SRTF).

    • Non-preemptive: Once a process starts executing, it runs to completion or until it waits (e.g., FCFS, SJF).

  • Common Algorithms:

    • FCFS (First-Come, First-Served)

    • SJF (Shortest Job First)

    • Round Robin (RR)

    • Priority Scheduling

    • Multilevel Queue Scheduling

Each algorithm affects process performance in terms of waiting time, turnaround time, and throughput. The choice of algorithm can significantly impact the overall efficiency of the operating system.

BPSC TRE Computer science Test-1

Question : The......... of two sets A and B is the set of all those pairs whose first coordinate is an element of A and the second coordinate is an element of B. The set is denoted by AxB.

Solution : Cartesian product

Description -

The Cartesian product is a mathematical operation that returns all possible ordered pairs (or tuples) from two or more sets. It’s a fundamental concept in set theory, database operations, and more.

Definition:

Given two sets:

  • A={a1,a2}
  • B={b1,b2,b3}

The Cartesian product A×B  is the set of all ordered pairs (a,b) where a ∈ A and b ∈ B :

A×B={(a1,b1),(a1,b2),(a1,b3),(a2,b1),(a2,b2),(a2,b3)}

BPSC TRE Computer science Test-1

Question : The values for an attribute or a column are drawn from a set of values known as a :

Solution : Domain

Description -

1. Tuple

  • A tuple is a single row in a table.

  • It represents one record of data in a relation.

  • A tuple is made up of values, one for each attribute.

Example:

If you have a table Employee:

ID Name Salary
1 Alice 50000

Then:
→ The row (1, Alice, 50000) is a tuple.


 2. Attribute

  • An attribute is a column in a table.

  • It represents a field or a property of the entity.

  • Each attribute has a name and is associated with a domain (set of allowed values).

Example:

In the Employee table above:

  • ID, Name, and Salary are attributes.


 3. Domain

  • A domain is the set of valid values that an attribute can take.

  • Each attribute in a relation is defined on a domain.

Example:

For the Salary attribute:

  • The domain might be: all positive integers (e.g., 30000 to 200000).

For the Name attribute:

  • The domain might be: all strings of text up to 50 characters.


 Putting It All Together

In a table:

  • The relation is the whole table (e.g., Employee).

  • Each attribute is a column (e.g., Name).

  • The domain is the allowed values for that column (e.g., valid names).

  • Each tuple is a row (e.g., one employee's data).

BPSC TRE Computer science Test-1

Question : Which one is true for FCFS scheduling :

Solution : All of above

Description -

The First-Come, First-Served (FCFS) scheduling algorithm is one of the simplest types of CPU scheduling algorithms used in Operating Systems (OS). It works on the principle that the process that arrives first gets executed first, without any preemption.


How FCFS Works

  • Processes are placed in a queue in the order of their arrival.

  • The CPU is allocated to the process at the front of the queue.

  • Once a process starts executing, it runs until completion.

  • It’s non-preemptive, meaning a running process cannot be interrupted.


Key Terms

  • Burst Time (BT): Time required by a process for execution.

  • Arrival Time (AT): Time when a process arrives in the queue.

  • Completion Time (CT): Time when a process finishes execution.

  • Turnaround Time (TAT): CT - AT

  • Waiting Time (WT): TAT - BT


Example

Process Arrival Time (AT) Burst Time (BT)
P1 0 5
P2 1 3
P3 2 8

 FCFS Scheduling Order: P1 → P2 → P3

Calculations:

Process AT BT CT TAT = CT - AT WT = TAT - BT
P1 0 5 5 5 0
P2 1 3 8 7 4
P3 2 8 16 14 6

Advantages

  • Simple and easy to implement.

  • Fair in the sense that processes are executed in the order they arrive.


Disadvantages

  • Long waiting times for processes with short burst times (convoy effect).

  • Not ideal for time-sharing systems.

  • Poor average waiting time in many cases.

BPSC TRE Computer science Test-1

Question : Round Robin scheduling algorithm falls under the category of-

Solution : Preemptive scheduling

Description -

Round Robin scheduling algorithm assigns a fixed time quantum (or time slice) to each process in the ready queue in a circular (round-robin) order.

Each process:

  1. Gets the CPU for a maximum of one time quantum.

  2. If it finishes before the time is up — it's done.

  3. If not, it's preempted and placed at the end of the queue.

 

The Round Robin (RR) scheduling algorithm falls under the category of:

Preemptive scheduling algorithms

Explanation:

  • Round Robin is designed for time-sharing systems, where each process is assigned a fixed time quantum or slice.

  • After a process uses its time quantum, it is preempted (interrupted) and placed at the back of the ready queue, even if it's not finished.

  • This ensures fairness and equal CPU time for all processes.

So, Round Robin is a preemptive and fair scheduling algorithm typically used in real-time and interactive systems.

BPSC TRE Computer science Test-1

Question : Which of the following is not a Routing Algorithm?

Solution : Traffic shaping

Description -

A routing algorithm is a method used in computer networks to determine the best path for data packets to travel from a source to a destination across a network.

Key Concepts:

  • Routing is the process of selecting a path for traffic in a network.

  • Routing algorithms determine which route or path data should take.

  • These algorithms operate in routers, which are network devices that forward data between computer networks.

A Broadcast Routing Algorithm is used to send data from one source to all nodes in a network. Unlike unicast (one-to-one) or multicast (one-to-many), broadcast means sending a message to everyone.

 

A Link State Routing Algorithm is a type of dynamic routing algorithm used by routers to calculate the shortest and most efficient path to every other node in a network.

Unlike distance vector algorithms (which share routing tables with neighbors), link state algorithms build a complete map of the network and calculate optimal paths using algorithms like Dijkstra's algorithm.

 

A Distance Vector Routing Algorithm is a type of dynamic routing algorithm where each router shares information about the distance (cost) to other routers in the network with its immediate neighbors.

The name comes from:

  • Distance = How far a destination is (usually in number of hops or cost).

  • Vector = The direction (i.e., which neighbor to go through to reach that destination).

BPSC TRE Computer science Test-1

Question : Error detection at data link layer is achieved by

Solution : Cyclic redundancy codes

Description -

Error detection at the Data Link Layer is a crucial function to ensure that data is transmitted accurately over a communication channel. It involves techniques used to detect any errors that might have occurred during the transmission of data frames between two nodes in a network.

 

Common Error Detection Techniques at the Data Link Layer

  1. Parity Check

    • Single-bit parity (even/odd): A parity bit is added to the data to make the number of 1s either even or odd.

    • Example: For 1010001, an even parity bit added makes it 10100011.

    • Limitation: Can only detect odd numbers of bit errors, not multiple-bit errors.

  2. Checksum

    • The sender adds up all the data in fixed-size blocks and sends the sum (checksum) along with the data.

    • The receiver performs the same operation and compares the result.

    • Common in TCP/IP and other protocols.

    • Limitation: Not very reliable for complex or burst errors.

  3. Cyclic Redundancy Check (CRC)

    • Most powerful and widely used method.

    • Treats the data as a binary number and divides it by a generator polynomial.

    • Appends the remainder (CRC bits) to the data.

    • The receiver repeats the division. If the remainder is not zero, an error is detected.

    • Used in Ethernet, HDLC, and many other protocols.

    • Can detect burst errors, multiple-bit errors, and all single-bit errors.

BPSC TRE Computer science Test-1

Question : Banker's algorithm for resource allocation deals with

Solution : Dead lock avoidance

Description -

The Banker's Algorithm is a classic deadlock avoidance algorithm used in operating systems. It ensures that a system allocates resources to processes in a way that avoids entering an unsafe or deadlocked state.

Key Concepts:

  1. Processes: Programs that need resources (like CPU, memory, files) to execute.

  2. Resources: Units like printers, files, memory, etc.

  3. Safe State: A state where there exists a sequence of all processes such that each process can complete with the currently available resources and the resources held by previously completed processes.

  4. Unsafe State: Not necessarily deadlocked, but a state that could lead to deadlock.

  5. Deadlock: A condition where no process can proceed because each is waiting for resources held by others.

 

BPSC TRE Computer science Test-1

Question : ACID properties of transaction is

Solution : All of the above

Description -

In DBMS (Database Management System), ACID is a set of properties that ensure reliable processing of database transactions. The acronym ACID stands for:

1. Atomicity

  • Meaning: A transaction is an indivisible unit of work. Either all the operations within the transaction are executed, or none of them are.

  • Goal: Prevent partial updates to the database.

  • Example: If you're transferring ₹1000 from Account A to B, both debit and credit must occur. If the debit succeeds but the credit fails, the whole transaction must roll back.


2. Consistency

  • Meaning: The database must remain in a valid state before and after the transaction.

  • Goal: Ensure all rules, constraints, triggers, and relationships are preserved.

  • Example: If a transaction violates a constraint like “account balance can’t be negative,” it is not allowed to commit.


3. Isolation

  • Meaning: Transactions must not interfere with each other. One transaction should not see intermediate results of another.

  • Goal: Avoid concurrency issues like dirty reads, lost updates, etc.

  • Example: If two people are booking the last seat in a theater at the same time, isolation ensures only one succeeds.


4. Durability

  • Meaning: Once a transaction is committed, the changes are permanent, even in the case of a crash or power failure.

  • Goal: Ensure committed data is safely stored.

  • Example: After money is transferred and the transaction is confirmed, a crash should not reverse the transfer.

BPSC TRE Computer science Test-1

Question : A compiler which runs on one machine and generates a code for another machine-

Solution : Cross-compiler

Description -

 

A cross-compiler is a type of compiler that runs on one platform (host system) but produces executable code for a different platform (target system).

  • Host system: The OS and architecture where the compiler runs.

  • Target system: The OS and architecture for which the compiled code is intended.

-----------------------------------------------------------------------------

Bootstrap (or bootstrapping) in an operating system is the process of starting up a computer and loading the OS into memory so it can begin running.

In simpler terms:

  • Bootstrap is the initial code and procedure that runs when you power on your computer.

  • It “boots” the system — hence the name bootstrapping or booting.

-----------------------------------------------------------------------------

A Lexical Analyzer (also called a lexer or scanner) is the first phase of a compiler or interpreter. Its job is to read source code and convert it into tokens, which are meaningful elements like keywords, identifiers, literals, and symbols.

 

 

BPSC TRE Computer science Test-1

Question : Primary key

Solution : All of the above

Description -

A primary key in a Database Management System (DBMS) is a column or a set of columns in a table that uniquely identifies each record in that table. It ensures that no two rows have the same primary key value, making each row unique.

Key features of a primary key:

  • Unique: Each value in the primary key column(s) is unique.

  • Not Null: It cannot contain NULL values.

  • Immutable: The value should not change over time.

  • Single or Composite: It can be a single column or multiple columns combined.

Example:

In a table of employees, the EmployeeID can be the primary key because it uniquely identifies each employee.

BPSC TRE Computer science Test-1

Question : The relational database environment has all of the following components except

Solution : Separate file

Description -

The relational database environment has all of the following components :

  • users
  • Database
  • Database administrator
  • Tables
  • Schema
  • Keys : - primary & foreign
  • Indexes
  • Transactions and Concurrency Control
  • ETC.

BPSC TRE Computer science Test-1

Question : The process of converting analog signals into digital signals so they can be processed by a receiving computer is referred to as:

Solution : digitizing

Description -

Modulation is the process of varying a carrier signal (usually a high-frequency wave) to encode information for transmission over a communication medium (like wired cables, radio waves, or fiber optics). In networking, modulation allows digital data to be transmitted over analog channels.

Demodulation is the reverse process of modulation. It extracts the original information (data) from the modulated carrier signal received over the communication channel.

Synchronization in networking means coordinating the timing of data transmission and reception between devices so that they can communicate effectively without errors.

Digitizing is the process of converting analog signals (like sound, images, or other continuous data) into digital format (binary data: 0s and 1s) so that they can be processed, transmitted, and stored by digital communication systems.

BPSC TRE Computer science Test-1

Question : Thrashing

Solution : Can be caused by poor paging algorithm

Description -

Definition:
Thrashing occurs in an operating system when a process spends more time swapping pages in and out of memory than executing actual instructions. It leads to a severe drop in system performance.

[NOTE :-

pagging - When a page fault occurs and there is no free frame available in physical memory, the OS must replace a page already in memory with the new page. This decision is made using page replacement algorithms.

Common Page Replacement Algorithms:

FIFO

LRU

Optimal Page Replacement

Clock (Second Chance)

 

]

BPSC TRE Computer science Test-1

Question : When the result of a computation depends on the sequence or timing the processes involved there is said to be :

Solution : Race condition

Description -

A race condition in an operating system (OS) refers to a situation where the behavior or outcome of a system depends on the timing or sequence of uncontrollable events such as thread or process execution. This usually occurs when multiple processes or threads access shared resources concurrently, and the final result depends on the order in which the accesses occur.

 

 

BPSC TRE Computer science Test-1

Question : Graphs can be implemented using : (a) Arrays (b) Linked list (c) Stack (d) Queue

Solution : a and b

Description -

In Data Structures (DS), a graph is a non-linear data structure consisting of nodes (also called vertices) and edges that connect pairs of nodes.

 

Graphs can be implemented using:

1. Arrays

  • Used in Adjacency Matrix representation.

  • A 2D array stores information about edges between vertices.

2. Linked Lists

  • Used in Adjacency List representation.

  • Each vertex stores a list (linked list) of its adjacent vertices.

Implementation Type Data Structure
Adjacency Matrix Array (2D)
Adjacency List Linked List / Dynamic Array / Map
Edge List Array of Tuples / Pairs

BPSC TRE Computer science Test-1