Computer Science Past Paper - 2012
Federal Public Service Commission
Competitive Examination for Recruitment to Posts in BS-17
Under the Federal Government, 2012
TIME ALLOWED: (PART-I) 30 MINUTES, MAXIMUM MARKS: 20
(PART-II) 2 HOURS & 30 MINUTES MAXIMUM MARKS: 80
Attempt ONLY FOUR questions from PART-II, selecting at least ONE question from EACH section. All questions carry EQUAL marks.
Part – II
Q.2. (a) With the help of a diagram, briefly describe the interfacing and role major programmable ICs that support/help the processor to control functionality of an Intel-based PC system. (08)
(b) Completely describe the sequence of steps that would be followed in order to print the contents of a file stored on the hard disk. For each step, explicitly tell which component performs the step and which wire it controls. (06)
(c) With the help of a state diagram depict the instruction cycle with interrupts. Also, define the term bus arbitration and its various types. (06)
Q.3. (a) In case of CSMA, what can station do if there is access conflict (there are many contending nodes). (05)
(b) What is the key difference between Frequency Division Multiplexing and Frequency Hoping Spread Spectrum? (05)
(c) Define Framing. Give reasons for its need. (05)
(d) What is the role of address field in a packet travelling through a virtual circuit network? (05)
Q.4. (a) Differentiate between overloading and overriding giving examples. (06)
(b) Define the classes and their relationships as given in following class diagram. Associate at least three appropriate attributes and two methods with each class. You can use any programming language and you do not need to write the code for the methods, only give the class specifications. (14)
Q.5. (a) You are given head of single linked list. Write code to count number of nodes in it (any language). (08)
(b) Write formula to access a particular node of two dimensional array in a row-major order. Consider the start address of a two dimensional array A to be 200, then compute the address of A using your formula, considering each element takes 4 bytes. (06)
(c) Write code to push and to pop elements in a stack. (06)
Q.6. (a) Give at least five differences between classical waterfall way of software development and evolutionary development. (06)
(b) Explain requirement engineering process with proper model diagram. (06)
(c) Write a use case of your choice in expanded form for the Player Information System of Pakistan Cricket Board (PCB). (08)
Q.7. (a) “We can have a relation that is in 3NF but not in BCNF”, explain this point by giving an example. (03)
(b) Write six basic properties of a database relation. Which one of these properties is different from those of a mathematical relation? (03)
(c) Create an ER diagram for each of the following descriptions associating two or three attributes with each entity type: (08)
(i) Each company may operate up to four departments, and each department must belong to one company.
(ii) Each department in part (i) employs one or more employees, and each employee works for one or more departments.
(iii) Each of the employees in part (ii) may or may not have one or more dependants, and each dependant belongs to one employee.
(iv) Each employee in part (iii) may or may not have an employment history.
(v) Some of the employees are managers for other employees.
(d) Represent all the ER diagrams described above as a single ER diagram. (06)
Q.8. Suppose a user vote for his favourite food from a dynamic combo box populated from database and the user must be able to make multiple food selections per request. You can use database of your choice. You are required to implement the following functionality.
(a) Store the favourite foods and the number of votes for each food. (08)
(b) Display all foods and their number of votes for each food. (06)
(c) Display the top three foods. (06)