Computer Science KP PMS Paper 2013

KHYBER PAKHTUNKHWA, PUBLIC SERVICE COMMISSION

COMPETITIVE EXAMINATION FOR THE POSTS OF PROVINCIAL MANAGEMENT SERVICES (BPS-17) 2013

COMPUTER SCIENCE

TIME ALLOWED: 03 HOURS
MAX MARKS: 100

Note: Attempt total FIVE questions, with at least ONE question from each section. Each question carries 20 marks.

Section A

Question No. 1

A. Explain the purpose of cache memory. Show the cache/main memory structure and how blocks of main memory are mapped to the lines in cache. Explain what happens when the cache is full and a new block has to be read in from main memory?
B. The CPU executes instructions from main memory, therefore a computer programme must first be loaded into main memory before it can be executed. Explain the memory management mechanism which enables execution of a large computer programme having size greater than the amount of main memory of a computer?

Question No. 2

A. What are CPU schedulers? Explain each.
B. What is a process? Give the process life cycle.
C. Explain the five-state process model with the help of a state transition diagram and give the description of all possible transitions.

Question No. 3

A. Differentiate between Non-adaptive & Adaptive routing?
B. Discuss the four different framing methods in Data link layer.
C. Explain CSMA/CD and its use. What part of the 802 project uses CSMA/CD?
D. What is the purpose of Time-to-Live field in the IP datagram Header?

Section B

Question No. 4

A. What is a recursive procedure? What properties must it have so that it does not run indefinitely?
B. Let \(a\) and \(b\) denote positive integers. Suppose function \(Q\) is defined recursively as:
\[
Q(a, b) =
\begin{cases}
0 & \text{if } a < b \\ Q(a - b, b) + 1 & \text{if } b \leq a \end{cases} \] Find the value of \(Q(2, 3)\) and \(Q(14, 3)\).
What does the function \(Q\) do?
C. What is a binary tree? What are the tree traversal algorithms? Briefly explain each.

Question No. 5

A. Describe the software process framework and the activities within it.

P.T.O

B. What are software process models? Describe a process model suited to managing unpredictability, i.e. case having rapidly changing project and technical conditions. Highlight the characteristics of this process model that enables it to adapt to change.
C. Cost of Quality is related to prevention appraisal and failure. Explain each.

Question No. 6

A. C++ provides the basic types i.e. int, float, char etc. Create a class named Complex having data members real and imaginary. Write the member function to add and subtract two complex numbers. Write the statement for adding two complex numbers c1 and c2.
B. Modify the class Complex to show how operator overloading can be used to add two complex numbers using the + operator so that a complex number c3 as the sum of complex numbers c1 and c2 may be simply written as a statement c3 = c1 + c2 instead of having to use the Add member function of class Complex.

Section C

Question No. 7

A. What is normalization, explain the normalized forms? What problems can arise if data is not in normalized form?
B. What is functional dependency? For the table shown, normalize the data up to the 3nf

ClientRental

clientNo propertyNo cName pAddress rentStart rentFinish rent ownerNo oName
CR76 PG4 John Kay 6 Lawrence St, Glasgow 1-Jul-03 31-Aug-04 350 CO40 Tina Murphy
CR76 PG16 John Kay 5 Novar Dr, Glasgow 1-Sep-04 1-Sep-05 450 CO93 Tony Shaw
CR56 PG4 Aline Stewart 6 Lawrence St, Glasgow 1-Sep-02 10-Jun-03 350 CO40 Tina Murphy
CR56 PG36 Aline Stewart 2 Manor Rd, Glasgow 10-Oct-03 1-Dec-04 375 CO93 Tony Shaw
CR56 PG16 Aline Stewart 5 Novar Dr, Glasgow 1-Nov-05 10-Aug-06 450 CO93 Tony Shaw

Question No. 8

A. Write HTML code to create an ordered list that contains 3 list items and the numbering should start from 5.
B. Write HTML code to link email address [email protected] with the text “Contact us”
C. List three major differences between JAVA and Javascript.
D. Write CSS rules for the following:
i. Change the color of all h1 headings to blue
ii. Give pink background color to visited links
E. In the following scenarios, state whether static or dynamic website is needed by the client. Also give reasons to support your answer.
i. A website of a University that enables the visitor to look at the courses offered by the University and the admission procedure
ii. A website for a company that enables the visitor to select multiple items and calculate the total amount to be paid. Once the order is confirmed, email is sent to the customer.
42 Views