0% found this document useful (0 votes)
161 views

Computer Science 2021

This document contains the past papers for Computer Science from 2021 administered by the Federal Public Service Commission of Pakistan. It provides information about CSS Aspirants, a website and phone number for additional exam preparation resources. The paper includes questions from two sections: Section A includes questions on computer architecture topics like addressing modes, memory management, and page replacement algorithms. Section B includes questions on compiler design, data structures, formal languages and software engineering.

Uploaded by

Ifthikhar Ahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
161 views

Computer Science 2021

This document contains the past papers for Computer Science from 2021 administered by the Federal Public Service Commission of Pakistan. It provides information about CSS Aspirants, a website and phone number for additional exam preparation resources. The paper includes questions from two sections: Section A includes questions on computer architecture topics like addressing modes, memory management, and page replacement algorithms. Section B includes questions on compiler design, data structures, formal languages and software engineering.

Uploaded by

Ifthikhar Ahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

CSS Past Papers

Subject: Computer Science


Year: 2021

For CSS Solved Past Papers, Date Sheet, Online


Preparation, Toppers Notes and FPSC
recommended Books visit our website or call us:
CSSAspirants.Pk
0336 0535622
FEDERAL PUBLIC SERVICE COMMISSION Roll Number
COMPETITIVE EXAMINATION-2021 FOR RECRUITMENT TO
POSTS IN BS-17 UNDER THE FEDERAL GOVERNMENT
COMPUTER SCIENCE, PAPER-I

TIME ALLOWED: THREE HOURS PART-I (MCQS) MAXIMUM MARKS = 20


PART-I(MCQS): MAXIMUM 30 MINUTES PART-II MAXIMUM MARKS = 80
NOTE: (i) Part-II is to be attempted on the separate Answer Book.
(ii) Attempt ONLY FOUR questions from PART-II, by selecting TWO questions from EACH
SECTION. ALL questions carry EQUAL marks.
(iii) All the parts (if any) of each Question must be attempted at one place instead of at different
places.
(iv) Write Q. No. in the Answer Book in accordance with Q. No. in the Q.Paper.
(v) No Page/Space be left blank between the answers. All the blank pages of Answer Book must
be crossed.
(vi) Extra attempt of any question or any part of the question will not be considered.
PART-II
SECTION-A
Q. No. 2. (a) What are office productivity tools? Explain uses of any two productivity tools in your (7)
home or workplace.
(b) Write a detailed note on computer crimes and ethical challenges. (7)
(c) What are the different types of computers? Explain the benefits of miniaturization. (6)

Q. No. 3. (a) Describe any two of the following briefly: ISP, HTML, SSD, Cloud Computing. (6)
(b) Write a program that should output the factors of the number passed as input – one factor on (5)
each line. Factors of a number, say x, are those whole numbers which can be multiplied
with other whole numbers to get x.
(c) What are IDEs? How do they help in software development? List the IDEs you have ever (5)
used.
(d) Write a program in C/C++ to convert a decimal number to hexadecimal. (4)

Q. No. 4. (a) Explain object oriented programming paradigm. Write a detailed note on any two of the (8)
principles of object oriented programming paradigm.
(b) Why do we need interfaces in OOP? How does it help in achieving abstraction? (6)
(c) What do you mean by runtime and compile time errors? (6)

SECTION-B
Q. No. 5. (a) What is a tree in data structure? Describe its types with the help of examples. (8)
(b) What is pass by value and pass by reference? Can we pass an object as a parameter to (6)
call a method in java?
(c) Convert following infix notation to prefix (6)
(i) (30+23)*(43-21)/(84+7)
(ii) 2*(1+(4*(2+1)+3))

Q. No. 6. (a) Convert following NFA to DFA: (8)

(b) Differentiate between overloading and overriding with the help of an example. (6)

(c) What is recursion in data structures? Explain three conditions of a recursive function with the (6)
help of an example.
Page 1 of 2
COMPUTER SCIENCE, PAPER-I
Q. No. 7. (a) Write detailed notes on any TWO of the following: (8)
i. PERT chart ii. Unified Modeling Language iii. AVL Trees

(b) What is a Software Process Model? Explain the Spiral model in detail. (7)

(c) What do you mean by software quality? List at least five quality attributes. (5)

Q. No. 8. (a) Consider the grammar (4)


S → cAd
A→ ab|a
construct a top-down parse tree for the input string w = cad

(b) Is the above given grammar ambiguous or unambiguous? Justify your answer. (4)

(c) Write similarities and differences of CFG and regular expression. (4)

(d) Design grammar for the following language: (4)


“The set of all strings of 0s and 1s such that every 0 is immediately followed by at least
one 1”.
(4)
(e) Write a note on Aspect Oriented Programming

**********

Page 2 of 2
FEDERAL PUBLIC SERVICE COMMISSION
Roll Number
COMPETITIVE EXAMINATION-2021 FOR RECRUITMENT TO
POSTS IN BS-17 UNDER THE FEDERAL GOVERNMENT
COMPUTER SCIENCE, PAPER-II

TIME ALLOWED: THREE HOURS PART-I (MCQS) MAXIMUM MARKS = 20


PART-I(MCQS): MAXIMUM 30 MINUTES PART-II MAXIMUM MARKS = 80
NOTE: (i) Part-II is to be attempted on the separate Answer Book.
(ii) Attempt ONLY FOUR questions from PART-II by selecting TWO questions from EACH SECTION.
ALL questions carry EQUAL marks.
(iii) All the parts (if any) of each Question must be attempted at one place instead of at different places.
(iv) Candidate must write Q. No. in the Answer Book in accordance with Q. No. in the Q.Paper.
(v) No Page/Space be left blank between the answers. All the blank pages of Answer Book must be crossed.
(vi) Extra attempt of any question or any part of the attempted question will not be considered.

PART – II (SECTION – A)
Q. 2. (a) The addressing in a typical instruction format are done by using different addressing (10)
modes. Examine any five addressing modes with an example based on the contents of
address field, actual address and contents of memory location.
(b) The decimal value of address field in an instruction is 120. The addressing mode of the (5)
machine’s architecture is register direct and register indirect addressing. Calculate the address of
corresponding operand.
(c) Compare the set of addressing modes of RISC and CISC machines. Give one example of (5)
addressing modes used in RISC and CISC respectively.

Q. 3. Memory managed by BITMAP is shown below:


1 1 1 1 1 0
0 1 1 0 0 0
1 0 0 1 1 1
1 0 0 0 0 0
1 1 0 0 0 0
0 0 0 0 1 1
(a) Show properly filled memory according to the BITMAP where memory index starts from zero. (3)
(b) Insert a page H of size 3 allocation units in memory drawn in part ‘a’ using first-fit algorithm. (3)
Redraw memory and the BITMAP after insertion.
(c) Now insert another page K of size 2 allocation units in memory drawn in part ‘b’ using (3)
next-fit algorithm. Redraw memory and the BITMAP after insertion.
(d) Use linked list data structure for the above memory mapping (Only give equivalent figure). (6)
(e) Use hash table to keep track of active pages in the above memory (Only give figure). (5)

Q. 4. Do as directed:
(a) Calculate effective memory access time using following data: (3)
 TLB hit ratio is 85%,
 TLB access time=20nsec
 Memory access time=115nsec
Effective memory access time =Hit rate * (TLB access time+ Mem access time)+(1-Hit
rate)( TLB access time+Process_table access time+ Mem access time)
(b) Consider a logical address and physical address of 31 and 22 bits respectively. What will be (4)
total logical and physical address space?
(c) Does resource allocation graph shown below consist of a deadlock or not? Justify with (3)
reason.

(Figure: Resource Allocation Graph)


(d) What is race condition? What are the different techniques to avoid race condition in the (10)
processes? Which one is optimal and why?
Page 1 of 2
COMPUTER SCIENCE, PAPER-II

Q.5. (a) Compare Transmission Control Protocol and User Datagram Protocol. How they are used in (6)
wireless networks?
(b) What mechanism is used by TCP to protect itself from miss delivery? (6)
(c) Calculate the TCP window size to fully utilize the line on which WAN link is 2 Mbps and RTT (8)
between source and destination is 300 msec.

SECTION – B
Q.6. Consider the following database schema and write the relational algebra expression for the following
queries.
Students (Stu_Reg, Stu_Name, Stu_Address)
Instructor (Ins_ID, Ins_Name, Ins_Dept_ID)
Course (Cr_Code, Cr_Title, Cr_CrHours)
Dept (Dept_ID, Dept_Name)
Results (Res_Stu_Reg, Res_Cr_Code, Res_Marks, Res_Ins_ID, Res_Grade)
(a) Write relational algebraic expression for:
(i) To display all the students details in section BSSE. (8)
(ii) To display all Instructor Names and their respective Department Names, (if an instructor
is not assigned any Dept his name should be displayed as well).
(iii) To display Stu_Reg, Stu_Name, Cr_Code, Cr_Title and Res_Marks for students who got
75 or more marks.
(iv) To display Res_Stu_Reg, Ins_Name, Res_Grade for Instructors whose Dept_ID is 1.
(b) What is the concept of gerund in database? Give one example of gerund. Is this essential to (12)
eliminate gerunds from the database? If yes, how and if no, why?

Q.7. (a) Write code/pseudo code to locate all of the large boxes in the image below using morphological (8)
image processing.

(b) Is there a need for more than 1 color model? Mention different colors models and there uses.
(6)
(c) Explain CMY color model, its use and how is it different from CMYK?
(6)

Q.8. (a) Analyze the code and draw resulting table as drawing on the paper (8)
<table border="1" cellspacing="0">
<tr><td>1</td><td colspan="3">2</td></tr>
<tr><td rowspan="2" >3</td><td colspan="2">4</td><td>5</td></tr>
<tr><td>6</td><td>7</td><td>18</td></tr>
<tr><td colspan="3">9</td></tr>
<tr><td>10</td><td colspan="3">11</td></tr>
<tr><td>12</td><td>13</td><td>14</td></tr>
<tr><td rowspan="2" >15</td><td colspan="2">16</td><td>17</td></tr>
</table>
(b) What is the role of requirement engineering in web engineering? List functional and non- (6)
functional requirements for a website.
(c) What are different security mechanisms used for encrypting the contents of a website? Explain (6)
one in detail.

*************

Page 2 of 2

You might also like