CSS Past Papers: Subject: Computer Science
CSS Past Papers: Subject: Computer Science
CSS Past Papers: Subject: Computer Science
(b) Write a C/C++ program which inputs a number from a user and prints Fibonacci series (7)
up to the number.
(c) Explain the concept of abstract class with an example (5)
Q. No. 3. (a) Write standard ports for following services HTTP, FTP, SMTP, HTTPS, DNS. (4)
(b) Design an appropriate interface for citizen portal mobile application. The interface (8)
should contain different features which are part of the portal application. The
Interface may contain different screens to support these features.
(c) If you are transferring a file over the Internet, would you prefer TCP or UDP as the (4)
underlying protocol. Explain
(d) If you are transferring live audio in real-time over the Internet, would you prefer TCP or (4)
UDP as the underlying protocol. Explain.
Q. No. 4. (a) Write a program to perform mathematical operations of addition, subtraction and (8)
multiplication on complex numbers. Each operation should be supported by a separate
method.
(b) How object encapsulation is useful? Explain. (4)
(c) Write a program to convert numbers into words. For instance, if the user types 123, the (4)
program should give output one hundred and twenty three. The program should continue
functioning until the user types quit.
Q. No. 5. A university maintains records for students, Faculty, and academic record. Following three
classes are part of the system
Student (ID, Name, Age, Address, Contact, Program, CGPA)
Teachers (ID, Name, Age, Address, Highest Degree, Subjects, Salary)
Courses (Semester, Course Code, Student ID, Teacher ID, Grade). All the data is stored in
files
(a) Draw a class diagram to represent the three classes and their relationships (5)
(b) Write C++ programs to compute following: (15)
i. Add a student ii. Add a course
iii. Find a student with respect to CGPA iv. Add a Teacher
v. Update a student
Page 1 of 2
COMPUTER SCIENCE, PAPER-I
SECTION-B
Q. No. 6. John rides a Van service from new square (S) to the city harbor (T). The van service charges
Rs 10 per Km. There are numerous routes between the two points.
(a) In order to rip off his customers, John always wanted to use the longest path. To find the (7)
longest path, John evaluates all the possible paths and selects the longest path. Write an
algorithm to select the longest path using this approach.
(b) Compute the complexity of this algorithm and determine that whether it is in P, NP, or (3)
NP-complete.
(c) Write an algorithm to find a minimum distance between ‘S’ and ‘T’. (7)
Q. No. 7. (a) How many tokens are there in in this C code : (5)
printf("k = %d, &k = %x", k, &k);
(b) Create State Transition Table from the following graph (5)
(c) Draw Finite State Automata which accepts following input. (4)
(d) Determine which of these inputs are valid for the FSM shown below: (6)
i. aaaaa
ii. ababa
iii. abcabc
iv. abccba
v. acbcd
vi. acbcdcd
(b) Suppose you are representing a social network (such as facebook) as a graph. Devise an (7)
algorithm through which you can determine friends of friends.
(d) Optimal problems are generally NP hard problems. Is it appropriate to use heuristics (4)
based approaches?
**********
Page 2 of 2
FEDERAL PUBLIC SERVICE COMMISSION
Roll Number
COMPETITIVE EXAMINATION-2020
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. No.2. (a) Explain Moore’s law. List high computing requirements in contemporary computing. (7)
(b) List and briefly define two approaches to dealing with multiple interrupts. (6)
(c) What is instruction-level parallelism? What are some typical distinguishing (7)
characteristics of RISC organization?
Q. No.3. (a) What is the kernel of an operating system? Explain the difference between a monolithic (7)
and microkernel.
(b) What is the difference between simple and virtual memory paging? Also explain the (6)
purpose of translation lookaside buffer.
(c) Why do we have deadlock in the multiprocessing environment? Explain different (7)
techniques for dealing with deadlocks.
Q. No.4. (a) Compare IPv4 and IPv6 headers. Explain the use of NAT technology to overcome (8)
IPv4 scarcity.
(b) Find the maximum number of valid subnets and usable hosts per subnet that you can (6)
get from the network 172.23.0.0/23.
(c) List and briefly define any THREE file organization techniques. Also explain basic (6)
Linux file system security.
Q. No.5. (a) What is signal encoding? Explain different encoding techniques used in data (8)
communication.
(b) Explain the functions and needs of ARP and RARP protocols in computer networks. (5)
(c) Explain multiplexing and demultiplexing at the transport layer. Explain in the (7)
context of TCP/IP protocol.
SECTION – B
Q. No.6. (a) What is the purpose of a join in SQL? Explain inner, left, right and full join with the help (8)
of examples.
(b) Construct an E-R diagram for a hospital with a set of patients and a set of medical doctors. (7)
Associate with each patient a log of the various tests and examinations conducted.
(c) Explain Two-phase locking (2PL) as a concurrency control mechanism in the database (5)
systems.
Q. No.7. (a) What is Histogram equalization? Explain the process and discuss its uses. (6)
(b) Explain types of color models. Also discuss the most common hardware oriented color (8)
models in detail.
(c) What is translation and scaling? Find the number of bits required to store a 256x256 image (6)
with 32 gray levels.
Q. No.8. (a) "Web engineering is more challenging than traditional software engineering". Argue for or (7)
against.
(b) Briefly discuss the role of validation and verification in requirement engineering. (6)
(c) Explain functional and non-functional requirements in the context of a web application (7)
development.
*************