PMS Computer Science Past Paper 2023 PDF

PUNJAB PUBLIC SERVICE COMMISSION

Combined Competitive Examination (CCE) 2023

For Recruitment to the Posts of Provincial Management Service (PMS)


SUBJECT: Computer Science (Paper-1)

Time Allowed: 3 Hours

Maximum Marks: 100

Attempt any FIVE questions in all. Attempt at least ONE question from each section.

SECTION – A

Q. No. 1
a) The Instruction Set Architecture (ISA) is the set of basic instructions that a processor understands. Historically, there are two philosophies of instruction sets. Write down the names of these two philosophies.
b) Differentiate between compilers and interpreters. Give at least two differences.
(6 + 14 = 20 Marks)

Q. No. 2
a) How would you define a function in a programming language? Explain the main components of a function.
b) Write a program in any programming language to add two 3×3 matrices using arrays.
(10 + 10 = 20 Marks)

Q. No. 3
a) How is program testing done? Explain different types of software testing in detail.
b) Write a program using functions to demonstrate the difference between pass by value and pass by reference.
(10 + 10 = 20 Marks)

SECTION – B

Q. No. 4
a) Consider yourself as the network administrator for a surveillance company. Your company has offices in several countries, and they need to create a network that allows all offices to connect with one another. In this situation, determine the type of network that will emerge.
b) Thick Ethernet uses thick coaxial cable. Transceiver or drop cables connect NIC to transceiver. Different machines send data on the cable which can cause reflection, damaging data.
Keeping in view Thick Ethernet, answer the following:
i) Which device is used to avoid signal reflection?
ii) What type of signal does AUI carry?
(8 + 12 = 20 Marks)

Q. No. 5
a) What are minterms and maxterms? Also explain sum of minterms and product of maxterms with examples.
b) Define logic gates. Enlist digital logic gates along with their names, graphical symbols, algebraic functions, and truth tables.
(10 + 10 = 20 Marks)

Q. No. 6
a) What is meant by an adder? Explain half adder and full adder with examples.
b) Draw NAND logic diagrams for the following expressions using multi-level NAND gate circuits:
i) (AB’ + CD’)E + BC(A + B)
ii) W(X + Y + Z) + XYZ
(10 + 5 + 5 = 20 Marks)

SECTION – C

Q. No. 7
a) Write down three ways in which a queue data structure can be implemented.
b) What is the output of the following program?

MyQueue q;
MyStack s;

q = new MyQueue();
s = new MyStack();

s.push(5);
s.push(6);
s.push(7);

q.enqueue(s.pop());
q.enqueue(5);

cout << s.pop();

q.enqueue(5);

cout << q.dequeue();

s.push(q.dequeue());

cout << s.pop();
cout << s.pop();


Q. No. 8
a) Consider the performance of FCFS scheduling algorithm for three CPU-bound processes:
P1 = 24 seconds
P2 = 3 seconds
P3 = 3 seconds
Processes arrive in order P1, P2, P3. Calculate:
i) Turnaround time of each process
ii) Average turnaround time
b) Enlist the four conditions for deadlock.
(20 Marks)

Q. No. 9
a) What do you know about inter-process communication? Explain semaphores and binary semaphores in detail.
b) In which technique are paging and segmentation combined? Explain with an example.

SUBJECT: Commerce (Paper-II)

Time Allowed: 3 Hours

Maximum Marks: 100


Attempt any FIVE Questions in All. Calculator is allowed (Non-Programmable).

Q.No.1 Following is a state diagram of a TM. is the start state, “q accept” is the accept state and “q reject” is the reject state.
(Image contains a complex Turing Machine state transition diagram with states q0, q1, q2, q3, q4, q_acc, and q_rej)
Does the TM accept the string 1100? Show the execution of the TM on the input by giving the sequence of configurations from the start to the halting configuration. (20 Marks)

Q.No.2 (a) Construct a Context Free Grammar (CFG) for possible sequences of if and else in ‘C’. (b) Find the moves of the above grammar to derive the if-else sequence of the string: iieee. (20 Marks)

Q.No.3 The table below shows the values of the function at various points :
0 1 2 3 4
1 3 5 7 9
(a) Use Lagrange interpolation to find the polynomial of degree 4 that passes through all the given points. (b) Use polynomial approximation to approximate and . (15 + 5 = 20 Marks)

Q.No.4 A) I) Convert the following table into 1st normal form.
emp_id emp_name emp_address emp_mobile
101 James UK 2390231
102 Asad Lahore 881212, 9900012
103 Ron US 8881212, 12300
104 Rocky Paris 80345
II) Convert the following table into 2nd normal form.
teacher_id subject teacher_age
111 Biology 38
111 Physics 44
222 Chemistry 38
333 Physics 49
333 Maths 40
B) What is the Hierarchical data model? Explain the hierarchical data model in detail. C) Explain “Group By” Clause in SQL. (7 + 7 + 6 = 20 Marks)

Q.No.5 (a) Consider the case, where we are using beam search as an NLP for searching computational cost. Beam search provides a tradeoff between accuracy versus computational cost as of the flexible choice. It is referred to as greedy search algorithm because of its projection. The sample nodes are given as:
Given: The process of beam search involves:
  • Beam Size = 2
  • Maximum length of an output sequence = 3
  • The candidate nodes output sequences are: AA, CC, ABAB, CECE, ABDABD, and CEDCED.
You are required to backtrack the searching nodes and draw/give the tree for that beam search.
(b) Apply the Breadth First Search in the formation of tree data structure as given below to figure out your goal state. Given: Goal state is 5. Note:
  1. Just mention the values of ‘Q’ and ‘Visited’ queues/lists at every step.
  2. No need to draw tree for showing any step.
(Image contains a Binary Tree with nodes numbered 2 at root, children 3 and 4, then 5, 6, 7, 8, and bottom leaves 9 through 16) (10 + 10 = 20 Marks)

Q.No.6 “Partition Testing” is one of the strategies to help you select the test cases for testing your system. In Partition testing, you identify groups of inputs that have common characteristics and should be processed in the same way. You should choose tests from within each of these groups.
Now consider a method named “RemoveBlankSpaces” which replaces a sequence of blank spaces with a single space character. Identify the testing partitions and derive a set of tests (i.e. write down the strings that you will test and the test case that will be applied) for the “RemoveBlankSpaces” method. (20 Marks)

Q.No.7 A) What is the intelligent agent in AI, and where are they used? B) What is overfitting? How can it be overcome in Machine Learning? C) What is game theory? How is it important in AI? (7 + 6 + 7 = 20 Marks)

Q.No.8 Consider the Incremental line algorithm (given below) for drawing a straight line. Two points (2, 3) and (5, 6) are given. You are required to run this algorithm for these points to draw a straight line. Also show the values of variables at each step/iteration against every instruction.
Incremental_line (Point p1, Point p2)
dx = p2.x - p1.x
dy = p2.y - p1.y
m = dy / dx
x = p1.x
y = p1.y
b = y - m * x

if |m| < 1
    for counter = p1.x to p2.x  (8 times)
        drawPixel (x, y)
        x = x + 1
        y = m * x + b
else
    for counter = p1.y to p2.y
        drawPixel (x, y)
        y = y + 1
        x = (y - b) / m
(20 Marks)

Leave a Reply

Your email address will not be published. Required fields are marked *