Prep Right
Questions › CSS › Computer Science › 2025
FPSC · CSS 2025

Computer Science, Paper II

100 marks · 3 hours · 7 questions · official PDF, 4 pages
This paper Computer Science · all yearsQ. 2 · An instruction requires five stages…Q. 3 · (a) Answer the Following Questions:…Q. 4 · A benchmark program is run…Q. 5 · (a) Consider the following pseudo…Q. 6 · (a) Answer the questions i,…Q. 7 · In the context of compression,…Q. 8 · What is the role of…With this paperPart-I MCQs20Official PDF4 pp← 20252026 →
3 hours · questions hide until you reveal them

SECTION–A

Q. 2

An instruction requires five stages to execute:

  1. (a)An instruction requires five stages to execute: Stage Time Stage-1 (instruction fetch) 30 ns Stage-2 (instruction decode) 9 ns Stage-3 (instruction execute) 20 ns Stage-4 (Memory access) 35 ns Stage-5 (Store results) 10 ns An instruction must proceed through the stages in sequence. What is the minimum asynchronous time for any single instruction to complete? [3]
  2. (b)Consider a single-level cache with an access time of 2.5 ns, a line size of 64 bytes, and a hit ratio of H = 0.95. Main memory uses a block transfer capability that has a firstword (4 bytes) access time of 50 ns and an access time of 5 ns for each word thereafter. (i) What is the access time when there is a cache miss? Assume that the cache waits until the line has been fetched from main memory and then re-executes for a hit. (ii) Suppose that increasing the line size to 128 bytes increases the H to 0.97. Does this reduce the average memory access time? [3]
  3. (c)(i) Compare the set of addressing modes of RISC and CISC machines. Give one example of addressing modes used in RISC and CISC respectively. (ii) Explain Parallel Processing, and also draw pipeline processing for instruction: Ai*Bi+Ci [5]
(10)
Q. 3

(a) Answer the Following Questions:

(i) Is it possible for an organization’s Web server and mail server to have exactly the same alias for a hostname (for example, foo.com)? What would be the type for the RR that contains the hostname of the mail server?

(ii) Draw the structure of Internet in terms of ISPs, also show the concept in terms of Edge and Core networks.

(iii) A packet switch receives a packet to be forwarded. When the packet arrives, one other packet is halfway done being transmitted on this outbound link and four other packets are waiting to be transmitted in FIFO manner. Suppose all packets are 1,500 bytes and the link rate is 2 Mbps. What is the queuing delay for the packet?

(iv) Why do HTTP, FTP, SMTP, and POP3 run on top of TCP rather than on UDP?

(b) (i) Why do we need conditional GET when we have regular GET with respect to HTTP? What is its difference in comparison to GET?

(ii) With respect to web caching, if an average object size is 100K bits and the average request rate from browsers to origin servers is 15/sec. Suppose RTT from an institutional router to any origin server is 2 sec. If LAN speed is 100Mbps and access link speed is 1.54 Mbps then with a cache hit of 50%, how much total delay will be there?

[figure]

Checked against official paper
(10)
Q. 4
  1. (a)A benchmark program is run on a 40 MHz processor. The executed program consists of 100,000 instruction executions, with the following instruction mix and clock cycle count: Instruction Type Instruction Count Cycles per Instruction Integer arithmetic 45,000 1 Data transfer 32,000 2 Floating point 15,000 2 Control transfer 8,000 2 Determine the effective CPI, MIPS rate, and execution time for this program. [10]
  2. (b)What are the differences among sequential access, direct access, and random access? Also, write and explain the general relationship among access time, memory cost, and capacity. [10]
(20)
Q. 5

(a) Consider the following pseudo code for producer and consumer:

// producerdo{

//produce an item

//place in buffer

}while(true);

// consumerdo{

// remove item from buffer

// consumes item

}while(true);

(i) What is race condition?

(ii) Is there any possibility of the race condition if two threads named producer and consumer simultaneously execute the above functions? Provide the reasoning in two-three sentences.

(iii) Add the necessary synchronization in the above functions, you may use semaphores or mutex. You may provide just pseudo code or exact C/C++ code.

(iv) Consider a process that uses a user level threading library to spawn 10 user level threads. The library maps these 10 threads on to 2 kernel threads. The process is executing on a 8-core system. What is the maximum number of threads of a process that can be executing in parallel?

(b) Consider a multi-level memory management scheme with the following format for virtual addresses:

Virtual Page # (10 bits) | Virtual Page # (10 bits) | Offset (12 bits)

Virtual addresses are translated into physical addresses of the following form:

Physical Page # (20 bits) | Offset (12 bits)

Page table entries (PTE) are 32 bits and contain the 20-bit physical page number and OS bookkeeping bits (e.g., valid, dirty, used, etc.).

(i) How big is a page?

(ii) What is the maximum amount of memory (in bytes) in a single virtual address space? Explain your answer.

(iii) What is the maximum amount of physical memory (in bytes) that this memory management scheme supports? Explain your answer.

(iv) Sketch the format of the page table for the multi-level virtual memory management scheme. Illustrate the process of resolving an address as well as possible. Assume there is no TLB or cache.

Checked against official paper
(10)

SECTION–B

Q. 6

(a) Answer the questions i, ii, according to given schema.

[Schema diagram: REGIONS, DEPARTMENTS, EMPLOYEES, COUNTRIES, JOBS, LOCATIONS, JOB_HISTORY tables with their fields and relationships]

(i) Display the length of first name and length of second name for employees where last name contains character ‘b’ after 3rd position.

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

(iii) Differentiate between Left outer join, Right outer join and Full outer join. Explain your answer with the help of Venn Diagram.

(b) Provide brief answers to the following questions:

(i) Differentiate between Single row Sub-Query and Multi row Sub-Query and write a sample query too.

(ii) Discuss the role of Primary Keys, foreign keys, and indexes in database schema. Also, explain their significance in ensuring data accuracy, enforcing referential integrity and improving query performance.

Checked against official paper
(10)
Q. 7
  1. (a)In the context of compression, differentiate between coding, spatial and temporal redundancies. [6]
  2. (b)What is translation and scaling? Find the number of bits required to store a 256x256 image with 32 gray levels. [6]
  3. (c)What is Histogram equalization? Explain the process and discuss its uses. [8]
(20)
Q. 8
  1. (a)What is the role of requirement engineering in web engineering? List functional and non-functional requirements for a website. [6]
  2. (b)What are different security mechanisms used for encrypting the contents of a website? Explain any one in detail. [6]
  3. (c)Explain 3-tier web application architecture. [8]
(20)

Related papers

Computer Science 2000Computer Science 2002Computer Science 2003Computer Science 2004Computer Science 2005Computer Science 2006Computer Science 2009Computer Science 2010Computer Science 2011Computer Science 2012Computer Science 2013Computer Science 2015Computer Science 2016Computer Science 2017Computer Science 2018Computer Science 2018Computer Science 2019Computer Science 2019Computer Science 2020Computer Science 2020Computer Science 2021Computer Science 2021Computer Science 2022Computer Science 2022Computer Science 2023Computer Science 2023Computer Science 2024Computer Science 2024Computer Science 2025Computer Science 2026Computer Science 2026Accountancy & Auditing 2025Accountancy & Auditing 2025Agriculture & Forestry 2025Anthropology 2025Applied Mathematics 2025Arabic 2025Balochi 2025Botany 2025British History 2025Business Administration 2025Chemistry 2025Chemistry 2025Comparative Study of Major Religions 2025Computer Science 2025Constitutional Law 2025Criminology 2025Economics 2025Economics 2025English Essay 2025English Literature 2025English (Précis & Composition) 2025Environmental Sciences 2025European History 2025Gender Studies 2025General Science & Ability 2025Geography 2025Geology 2025Governance & Public Policies 2025History of Pakistan & India 2025International Law 2025International Relations 2025International Relations 2025Islamic History & Culture 2025Journalism & Mass Communication 2025Law 2025Mercantile Law 2025Muslim Law & Jurisprudence 2025Pakistan Affairs 2025Pashto 2025Persian 2025Philosophy 2025Physics 2025Physics 2025Political Science 2025Political Science 2025Psychology 2025Public Administration 2025Punjabi 2025Sindhi 2025Sociology 2025Statistics 2025Town Planning & Urban Management 2025Urdu Literature 2025Zoology 2025

About this paper

The 2025 CSS Computer Science paper set by the Federal Public Service Commission. Question wording only; questions marked “Not yet checked” have not been compared with the official paper yet. Open the official paper beside the questions to check any of them.

Disclaimer Prep Right is independent and not affiliated with FPSC.