Notifications
Clear all

CSS Computer Science Paper 2025

(@zarnishayat)
Member Moderator

FEDERAL PUBLIC SERVICE COMMISSION
COMPETITIVE EXAMINATION FOR RECRUITMENT TO POSTS
IN BPS-17 UNDER THE FEDERAL GOVERNMENT, 2025

COMPUTER SCIENCE, PAPER-I

TIME ALLOWED: THREE HOURS

PART-I (MCQS): MAXIMUM 30 MINUTES
PART-I (MCQS) MAXIMUM MARKS: 20
PART-II MAXIMUM MARKS: 80

PART-I — MCQs

Q. 1. Select the best option/answer. (20 × 1 = 20)

  1. What is the degree of a leaf node in a tree?
  2. What is the main goal of Capability Maturity Model Integration (CMMI)?
  3. Which type of software testing confirms whether software meets the customer's requirements?
  4. Which unit is commonly used to measure the performance of supercomputers?
  5. Which software-development model uses iterative cycles and continuous development?
  6. Identify the false statement concerning the static keyword in C.
  7. Which programming language uses the concept of a friend function?
  8. What is meant by refactoring code in the Software Development Life Cycle?
  9. What is the primary purpose of using Trojans?
  10. Which data structure is appropriate for implementing the Huffman algorithm?
  11. Which asymptotic notation gives the strict upper bound for a function?
  12. Which structure provides the fastest search for a given key among the listed choices?
  13. What is the role of a parser?
  14. Which optimization technique minimizes the number of memory accesses in a program?
  15. Determine the output of the C++ code involving an integer, pointer and reference:
 
 
int main() {
int a = 40;
int* ptr = &a;
int& ref = *ptr;
ref = 60;
cout << a;
}
 
  1. What is the process of deleting an element from an empty stack called?
  2. How is the head node deleted in a doubly circular linked list?
  3. Which technique selects the locally optimal choice at every step?
  4. What is the average time complexity for searching an element in a hash table?
  5. Which compiler phase is responsible for generating an Abstract Syntax Tree (AST)?

PART-II

NOTE

Attempt ONLY FOUR questions, selecting TWO questions from EACH SECTION. All questions carry equal marks.

SECTION-A

Q. 2

(a) Discuss the impact of Generative AI on society. Explain its benefits and challenges and support your discussion with examples. (6)

(b) Compare different data-storage devices with respect to:

  • Speed
  • Storage capacity
  • Access time
  • Cost

(6)

(c) Explain Two's Complement numbers. Describe how they work with suitable examples and discuss practical situations in which they are used. (8)

Q. 3

(a) Explain the difference between shallow copy and deep copy when creating objects in C++. Discuss situations in which each type of copy should be used and provide examples. (6)

(b) Differentiate between the const and static keywords in C++. Illustrate both with suitable examples. (6)

(c) Explain the role of pure virtual functions in implementing abstract classes in C++. Differentiate them from ordinary virtual functions and provide an example containing both. (8)

Q. 4

(a) Write a C++ program to display the arithmetic series of n terms using:

Sₙ = n/2 [2a + (n − 1)d]

Use:

a = 5
d = 3
n = 6

where a is the first term, d is the common difference, and n is the number of terms. (6)

(b) Write a C++ program to calculate and display the product of two 2 × 2 matrices. The program should ask the user to enter the values of both matrices. (6)

(c) Using a C++ structure, write a program to represent two complex numbers. Use a function to calculate their sum and display the result in the form:

(a + bi)

where a and b represent the real and imaginary parts, respectively, and i = √−1. (8)

SECTION-B

Q. 5

(a) Demonstrate the use of stream insertion (<<) and extraction (>>) operators for creating custom objects. Provide suitable code showing their functional difference. (10)

(b) Implement a Book Management System using three classes:

Book

The Book class should contain:

  • Book name
  • ISBN number
  • Publication year

Author

The Author class should contain:

  • Author name
  • Author email

Publisher

The Publisher class should contain:

  • Publisher name
  • Publisher email
  • Publisher address

Each book should have an author and a publisher. The author and publisher should be created and destroyed along with the book. When a book is deleted, its associated author and publisher should also be deleted.

Write the C++ code and explain how the composition relationship is implemented. (10)

Q. 6

(a) What are self-balancing Binary Search Trees? Under what circumstances are they preferred over ordinary Binary Search Trees? (6)

(b) Write pseudocode for calculating the Fibonacci sequence recursively. Determine the time complexity of the recursive approach and explain how that complexity is calculated. (6)

(c) A manufacturing company needs to sort the weights of ten parcels during a sale season. The parcel weights, in kilograms, are:

[30, 45, 10, 20, 75, 15, 85, 40, 05, 65]

Use the Quick Sort algorithm to arrange them in ascending order.

Clearly identify the choice of pivot, explain why it was selected, and provide a graphical representation of the sorting process at each stage. (8)

Q. 7

(a) Discuss the different planning phases of software development projects and list the specific tasks performed during each phase. (6)

(b) Explain the difference between software verification and software validation testing. Give examples and explain when each technique should be used. (6)

(c) What is the Software Process Improvement (SPI) framework? Explain:

  • The major steps of SPI
  • Key elements involved
  • Models used within SPI
  • How to identify projects for which SPI should be applied

(8)

Q. 8

(a) Create a regular expression for a language in which every string starts with "baa". Draw the corresponding Deterministic Finite Automaton (DFA) and explain its construction. (6)

(b) What is Instruction Scheduling? Explain its role during the code-generation process. (6)

(c) What is a parse tree? Explain how a parse tree can be used to determine whether a particular string belongs to a language. Give a suitable example. (8)

COMPUTER SCIENCE — PAPER-II
FEDERAL PUBLIC SERVICE COMMISSION
COMPETITIVE EXAMINATION — 2025
COMPUTER SCIENCE, PAPER-II

TIME ALLOWED: THREE HOURS

PART-I (MCQS): MAXIMUM 30 MINUTES
PART-I (MCQS) MAXIMUM MARKS: 20
PART-II MAXIMUM MARKS: 80

PART-I — MCQs

Q. 1

  1. A stack is defined as which type of data structure/storage mechanism?
  2. When do data hazards occur in a pipeline?
  3. If Computer A executes a program in 10 seconds and Computer B executes the same program in 15 seconds, how much faster is A than B?
  4. A processor with a clock cycle of 0.25 ns has what clock rate?
  5. Which of the listed areas is an application of image blurring?
  6. For a continuous image f(x,y), what does quantization mean?
  7. Which technique generates a processed image having a specified histogram?
  8. In a database table, which element represents a relationship among a set of values?
  9. Which normal forms are based on the concept of functional dependency?
  10. If a system shuts down during a transaction before the transaction is committed, which operation is automatically performed?
  11. At which levels can process synchronization be performed?
  12. Which module gives the CPU to the process selected by the short-term scheduler?
  13. What does a negative semaphore value indicate?
  14. Given the reference string:

7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1

with three page frames, how many page faults are produced by the LRU page-replacement algorithm?

  1. What is the DOM (Document Object Model)?
  2. Which error is generated when the SQL transaction callback does not execute?
  3. Which CSS property defines labels for a list of items?
  4. What is ICMP primarily used for?
  5. Which multiplexing technique is used for transmitting digital signals?
  6. What does DHCP provide to a client?

PART-II
SECTION-A

Q. 2

(a) An instruction requires five sequential stages:

Stage Time
Instruction Fetch 30 ns
Instruction Decode 9 ns
Instruction Execute 20 ns
Memory Access 35 ns
Store Results 10 ns

Determine the minimum asynchronous time required for a single instruction to complete. (3)

(b) Consider a single-level cache with:

  • Access time = 2.5 ns
  • Line size = 64 bytes
  • Hit ratio = 0.95
  • First-word main-memory access = 50 ns
  • Subsequent word access = 5 ns

Determine:

(i) Access time when there is a cache miss, assuming the cache waits until the complete line has been fetched and then re-executes for a hit.

(ii) If increasing the line size to 128 bytes raises the hit ratio to 0.97, determine whether the average memory access time is reduced.

(3 + 4)

(c)

(i) Compare the addressing modes of RISC and CISC machines. Give one example of an addressing mode used by each.

(5)

(ii) Explain parallel processing and draw the pipeline processing for:

Aᵢ × Bᵢ + Cᵢ

(5)

Q. 3

(a) Answer the following:

(i) Can an organization's Web server and mail server have exactly the same hostname alias, such as foo.com? Identify the type of DNS resource record that contains the hostname of the mail server. (2)

(ii) Draw the structure of the Internet in terms of ISPs, showing the concepts of edge networks and core networks. (3)

(iii) A packet switch receives a packet for transmission. One packet is halfway through transmission on the outgoing link and four additional packets are waiting in FIFO order. Each packet is 1,500 bytes and the link rate is 2 Mbps.

Calculate the queuing delay for the arriving packet. (3)

(iv) Why do HTTP, FTP, SMTP and POP3 operate over TCP rather than UDP? (2)

(b)

(i) Explain why conditional GET is needed when a regular GET request is available. What is the difference between conditional GET and GET? (4)

(ii) Consider web caching with:

  • Average object size = 100 Kbits
  • Average request rate = 15 requests/sec
  • RTT from institutional router to origin server = 2 sec
  • LAN speed = 100 Mbps
  • Access-link speed = 1.54 Mbps
  • Cache hit rate = 50%

Calculate the resulting total delay. (6)

Q. 4

(a) A benchmark program runs on a 40 MHz processor. It executes 100,000 instructions with the following instruction mix:

Instruction Type Instruction Count Cycles/Instruction
Integer arithmetic 45,000 1
Data transfer 32,000 2
Floating point 15,000 2
Control transfer 8,000 2

Determine:

  • Effective CPI
  • MIPS rate
  • Execution time

(10)

(b) Explain the differences among:

  • Sequential access
  • Direct access
  • Random access

Also explain the general relationship among:

  • Access time
  • Memory cost
  • Memory capacity

(10)

Q. 5

(a) Producer-Consumer Problem

Consider the following producer-consumer pseudocode:

 
 
Producer:
do {
produce an item
place item in buffer
} while (true);
 
Consumer:
do {
remove item from buffer
consume item
} while (true);
 

Answer the following:

(i) What is a race condition? (2)

(ii) Can a race condition occur if producer and consumer threads execute simultaneously? Give a brief justification. (2)

(iii) Add the necessary synchronization using semaphores or mutexes. Pseudocode or C/C++ code may be used. (3)

(iv) A process uses a user-level threading library to create 10 user-level threads. These are mapped onto two kernel threads. The process runs on an eight-core system.

What is the maximum number of threads belonging to this process that can execute in parallel? (3)

(b) Multi-Level Memory Management

Virtual addresses have the following format:

  • Virtual Page Number: 10 bits
  • Virtual Page Number: 10 bits
  • Offset: 12 bits

Page-table entries are 32 bits and contain a 20-bit physical page number along with operating-system bookkeeping bits.

Determine:

(i) The size of one page. (1)

(ii) The maximum memory available in a single virtual-address space, in bytes. Explain. (3)

(iii) The maximum physical memory supported by the scheme, in bytes. Explain. (3)

(iv) Sketch the multi-level page-table structure and illustrate the process of resolving a virtual address, assuming there is no TLB or cache. (3)

SECTION-B

Q. 6

(a) SQL Queries

Using the given database schema, answer the following:

(i) Display the length of the first name and second name for employees whose last name contains the character 'b' after the third position. (2)

(ii) Display the job title, department name, employee last name and starting date for all jobs from 1992 to 1998. (3)

(iii) Differentiate among:

  • Left Outer Join
  • Right Outer Join
  • Full Outer Join

Explain with the help of Venn diagrams. (5)

(b)

(i) Differentiate between a single-row subquery and a multi-row subquery, and provide a sample query for each. (5)

(ii) Explain the roles of primary keys, foreign keys and indexes in a database schema. Discuss their significance in:

  • Data accuracy
  • Referential integrity
  • Query performance

(5)

Q. 7

(a) In the context of data compression, differentiate among:

  • Coding redundancy
  • Spatial redundancy
  • Temporal redundancy

(6)

(b) Explain translation and scaling in image processing.

Also calculate the number of bits required to store a 256 × 256 image with 32 gray levels. (6)

(c) What is histogram equalization? Explain its procedure and discuss its applications/uses. (8)

Q. 8

(a) Explain the role of requirements engineering in web engineering. List suitable functional and non-functional requirements for a website. (6)

(b) What security mechanisms can be used for encrypting website contents? Explain any one mechanism in detail. (6)

(c) Explain the three-tier web application architecture. (8)


DOWNLOAD NOW


Quote
Topic starter Posted : August 15, 2026 12:13 pm
Share: