PMS Computer Science Past Paper 2022 PDF

PUNJAB PUBLIC SERVICE COMMISSION

Combined Competitive Examination (CCE) 2022

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) Convert decimal number 25 into binary number using the binary notation method.
b) Write down the names of five devices that use an embedded operating system.
c) What are machine-independent languages? Give the names of two machine-independent languages.
(8 + 5 + 7 = 20 Marks)

Q. No. 2
a) What will be the output of the following program?
int main()
{
float value = 3;
if (value >= 4)
cout << “Report is positive”;
else
cout << “Report is negative”;
return 0;
}
b) Which devices are used by AI agents for the following purposes?
  1. To perceive the environment
  2. To affect the environment
c) Find errors in the following function prototypes:
i) int sum(int x, y);
ii) int sum(int x, int y)
iii) int sum(int x, void y);

SECTION – B

Q. No. 3
a) Write down the names of five main components of data communication.
b) Consider a data rate of 2 Kbps with noise duration of 1/100 seconds. Calculate the number of affected bits.
c) Which TCP/IP layer is used for internetworking? Write the layer name and mention the type of address used at this layer.

Q. No. 4
a) Simplify the following Boolean expression to use the minimum number of gates.
b) Considering the given table/chart, write queries to solve the following:
i) Retrieve the account with the highest balance.
ii) Calculate the total balance of each account type.
c) Write a procedure that deducts 10,000 from all balances greater than 50,000.
d) List different ways to execute a stored procedure in SQL Server.
e) Create a temporary table with the same schema as the charts table and copy data into it.
f) Explain how the following objects improve performance and in which operations:
i) Stored Procedures
ii) Indexes
g) Define triggers and explain types of triggers in SQL Server.
h) Draw NAND-based S-R Latch circuit diagram.
(12 + 8 = 20 Marks)

Q. No. 5
a) In memory segmentation, what happens when a segment fault occurs?
b) What is the difference between computer organization and computer architecture? Write two attributes of each.

SECTION – C

Q. No. 6
a) Which method is better for implementing a list when the number of elements is unknown? Justify your answer.
b) Given input:
{23, 46, 12, 59, 78, 87, 2, 3}
and hash function:
h(x) = x mod 11
Show the resulting chaining hash table.

Q. No. 7
a) Draw an AVL tree using the following nodes in order:
17, 18, 51, 15, 7
Show all insertion and rotation steps.
b) Differentiate between turnaround time and response time.
c) If a deadlock is detected, how can it be recovered? Mention any two methods.

Q. No. 8
a) Write an algorithm for the critical section problem where two variables are shared among processes.
b) Explain how a page fault occurs and who handles it in memory management.

PROGRAM SECTION

Q. No. 7 (Programming)
a) Show output of the following program:

public class Test {

public static void main(String[] args) {

double[][] m = {

{1, 2, 3},

{1.5, 2.5, 3.5},

{0.1, 0.1, 0.1}

};

System.out.println(sum(m));

}

public static double sum(double[][] m) {
double sum = 0;
for (int i = 0; i < m.length; i++) {
sum += m[i];
}
return sum;
}
}

b) Difference between pointer and reference. Explain working of both. Difference between pointer-to-reference and reference-to-pointer.
c) Significance of Fibonacci sequence.
d) Write a program to generate Fibonacci series up to a given range.
e) Explain polymorphism, virtual functions, and inheritance with C++ code.
f) Write a sample code of exception handling in C++. How is it different in Java?

Q. No. 8
a) In a road network graph, vertices represent intersections and edges represent roads. What type of graph is used for one-way and two-way roads, and why?
b) A graph has 11 vertices and 19 edges. Odd-degree vertices have degree 3 and even-degree vertices have degree 4. Find number of each type.
c) Determine whether the given graph is bipartite.
d) Draw a weakly connected directed graph.
e) Construct a tree based on given conditions (parent, siblings, leaves, balanced tree).
f) A full m-ary tree has 136 vertices and 109 leaves. Find m and number of edges.
g) UNO probability problem: explain why no guarantee of red cards and calculate required draws for at least 2 red cards.
h) Coin tossed 6 times: find outcomes with odd number of heads.
i) Course selection problem: calculate number of ways to select courses with order importance.

SUBJECT: Commerce (Paper-II)

Time Allowed: 3 Hours

Maximum Marks: 100


Note: Attempt any FIVE questions.
No. 1 A) What are sorting algorithms? Describe the importance/applications of any four sorting algorithms in modern computing.
B) Discuss the space and time complexity of any five sorting algorithms.
C) Outline the pseudocode and flow diagram of Shell Sort.

No. 2 A) What is a Binary Search Tree (BST)? What is its searching complexity?
B) Make a BST for the following sequence of numbers:
99, 41, 36, 76, 23, 88, 115, 39, 41, 56, 69, 48, 11
Traverse the tree in pre-order and post-order.

C) Using ASCII encoding (8 bits per character), the 13-character string “computer science” requires 128 bits to send. You can use Huffman’s algorithm to construct a tree for data compression. Calculate the minimum number of bits required using Huffman’s algorithm to send the given string.

D) What are Max Heap and Min Heap? Sort the numbers
(2, 6, 6, 1, 9, 2, 2, 4, 4, 0, 1)
in ascending order using Heap Sort.

No. 3 The given network represents an Ethernet Layer-2 network that uses Spanning Tree Protocol (STP) to compute forwarding tables. Assume all links have weight 1.
(Note: Tie-breaking/leader election uses switch identifiers from the diagram.)
A) Compute the steady-state routing/forwarding table for switch 3. (4 marks)
B) Identify switches that recomputed their forwarding tables after failure and removal of link D. List the updated forwarding tables. (9 marks)
C) After removal of link D, a new link H is added between switch 1 and 4, but it fails frequently. Without traffic monitoring, describe a diagnostic strategy to identify the faulty link using switch forwarding tables.

D) If switch forwarding tables cannot be accessed and link status information is unreliable, outline alternative techniques to identify the failed link. (3 marks)

Q. No. 4 A) Describe the main processes in a modern software development environment and the tools used to support them. (6 marks)
B) If the software is safety-critical, such as car anti-lock braking system (ABS), what additional processes should be included? (4 marks)
C) You are developing control software for a car with internet connectivity, where updates are delivered over the air instead of service visits. Security vulnerabilities must be patched quickly, and maintenance will continue for 25 years.
Discuss how this will affect:
  • Development process
  • Cost implications
    (10 marks)

Q. No. 5 A) What are interrupts and exceptions? How are they handled in an operating system? (4 marks)
B) What is paging? Explain paging in the context of virtual memory. (4 marks)
C) What are semaphores? Explain with examples how a process enters a critical section. (4 marks)
D) What is the Banker’s Algorithm? Explain its working with an example. (4 marks)
E) What is the role of API, ABI, and ISA in operating systems?

 

Leave a Reply

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