CSS Computer Science Past Paper 2018
PAPER-I (Subjective) 80 Marks
Attempt ONLY FOUR questions from PART-II. (20×4)
PART-II
SECTION-A
Q. 2
(a) How many layers are in the TCP/IP stack? What are the names?
(b) How digital evidences can be preserved from a crime scene. Write in details by taking examples of digital devices commonly used these days.
(c) What are the responsibilities of Operating system kernel?
(d) List down any four best practices for coding standards.
(e) Why do modern processors use more power when their clock frequency is increased?
(f) Ali is telling Ahmad that he is representing a -ve number and its most significant bit is 1, Ahmad immediately shouted you are representing numbers using 2’s compliment. True or False. And why?
(g) If time slice is of 50 milliseconds and context switch requires a microsecond, how many processes can the machine service in a second?
Q. 3
(a) Write a program grade average calculator, User will input marks for five subjects and program will output the average of its marks. Print appropriate message on the base of its mark’s average e.g.; Well done, Keep it up, Better luck next time etc.
(b) Given that i, j, k, n & m are integer variables. Write a condition such that:
(i) hello is only printed when any of the following conditions are met: i is twice the value of j, j is smaller than k and less than n, or m is negative.
int i, j, k, n, m;
cin >> i >> j >> k >> n >> m;
if ( )
cout << "hello";
(ii) hello is only printed when i does not lie in the interval 6-9
int i;
cin >> i;
if ( )
cout << "hello";
(c) Write equivalent instruction to following instruction without the use of += operator:
where w, z are integers.w += 2 * z + 4;
(d) Predict the values of variables a & b after every instruction:
integer a = 5, b = 6;
a = (b++) + 3;
b = --a;
(e) Complete the code such that it prompts the user for a positive number n
. Then displays the output (HINT: instead of triangles of stars, it’s triangles of increasing numbers). For example, for n = 4, it will print:
1 2 3 4
1 2 3
1 2
1
void main() {
int n;
cin >> n;
// your loops will go here
}
(f) In the following code replace the character at the pos
th location in the string st
with the character ch
. For example, in the string “helloworld”, replacing the 2nd character with ‘i’ would result in “hilloworld”.
void main() {
char st[15];
int pos;
char ch;
int size = 0;
cin >> st;
cin >> pos >> ch;
while (st[size] != '\0') {
size++; // calculating the length of the current string
}
// write your code here
}
Q. 4 Consider the inheritance hierarchy shown below. Each part of this question is independent.

(a) In which class(es) would it make most sense to have protected members? Which class(es) would be able to access those protected members directly?
(b) Which class(es) can access private members of class C directly?
(c) Suppose class C contains a pure virtual function. Suppose we wish to instantiate objects of this hierarchy. Which class(es) are or could be abstract and which are concrete?
(d) Consider the following list of classes: Car, SteeringWheel, Vehicle, Van, Minivan, AudioSystem, ParkingLot. Your task is to describe all of the is-a and has-a relationships between these classes. Include an inheritance hierarchy for all classes that fit. Fill in the table with is-a or has-a relationship while leaving the cells empty where no relation is applicable.

SECTION-B
Q. 5
(a) What is dangling pointer?
(b) What data structure would employ to build a text editor and why?
(c) Random insertion of nodes into a binary search tree would result in what types of tree shape. Elaborate.
(d) How would you modify a linked list-based queue so that the first and last nodes can be accessed in constant time regardless of the data nodes in the queue?
Q. 6
(a) Define balanced tree both for AVL and Binary search tree.
(b) What is informed or heuristic search? What type of algorithm is used to do such a search?
(c) Differentiate between graph and trees. Which is a special case of the other?
(d) Explain what type of problems can be solved by genetic algorithm.
Q. 7
(a) Outline the difference between software verification and software validation.
(b) Give an outline of the unit testing process for verification.
(c) Agile Development is a process that values responding to change over following a plan. Discuss three issues a Software Engineer should be mindful of when adopting this approach during software development.
(d) What type of project is not suited to incremental methods?
(e) Outline the difference between Black box and White box testing.
Q. 8
(a) What is the difference between lexers and parsers?
(b) Write a grammar (BNF) for the language of palindromes.
(c) Here DFA is given for the language L. Find the DFA for L².

(d) Convert the following DFA to a RE.

PAPER–II (Subjective) 80 Marks
Attempt ONLY FOUR questions from PART-II. (20×4)
PART-II
SECTION-A
Q. No.2
(A) Briefly describe the functionality of the following CPU special-purpose registers: Instruction Register (IR), Memory Data Register (MDR), and Program Counter (PC).
(B) Differentiate between Address, Data, and Control bus.
(C) Discuss instruction pipelining in the context of the fetch-decode-execute cycle.
Q. No.3
(A) Differentiate between hub, bridge, switch, and router.
(B) Discuss how Network Address Translation (NAT) works and why is it useful?
(C) Elaborate the working of multiplexing/de-multiplexing at the transport layer.
Q. No.4
(A) There are three processes PA, PB, and PC and three resources RA, RB, and RC. Resources RA and RB have one instance each, while resource RC has two instances. PA is holding one instance of RC and has requested RA. Process PB is holding RA and has requested RB. RB is allocated to PC, which has also requested an instance of RC. Represent the scenario with a resource allocation graph. Discuss whether there is a deadlock or not. If yes, which processes are blocked?
(B) In the context of paging, consider the case where memory addresses are 32 bits, i.e., 20 bits Virtual Page Numbers and 12 bits of offset. How many virtual pages are there, and what is the size of each page? Given the virtual address 0x7589, find the virtual page number and offset. If the respective page table entry contains 0x900DF, find the physical address.
(C) In the context of I/O management, differentiate between polling and interrupts.
SECTION-B
Q. No.5
(A) Given two relations R and S, where R contains M tuples, S contains N tuples, and M > N > 0, give the minimum and maximum possible sizes (in tuples) for the resulting relation produced by each of the following relational algebra expressions:
- R−SR – S
- R∪SR \cup S
- R∩SR \cap S
- R×SR \times S
(B) Elaborate the concepts of super key, candidate key, and foreign key with examples.
(C) Discuss the difference between physical data independence and logical data independence.
Q. No.6
(A) Differentiate between image sampling and quantization. Discuss how these concepts relate to spatial and intensity resolutions.
(B) In the context of image smoothing, discuss the differences between mean and median filters.
(C) For the image ‘X’ shown in Figure 1, show the result of applying the given morphological operators. Assume zero padding for border pixels:
- Dilation of X by structuring element [1 1 1][1 \, 1 \, 1].
- Erosion of X by structuring element [1 1 1]T[1 \, 1 \, 1]^T.
- Dilation of X by a 3×3 structuring element containing all ones.

Q. No.7
(A) Perform histogram equalization on the 8-bit image shown in Figure 2.

(B) For the 3×3 image shown below, apply the horizontal and vertical Sobel operators and compute the magnitude of the gradient at the central pixel with intensity value 50

(C) In the context of compression, differentiate between coding, spatial, and temporal redundancies.
Q. No.8
(A) Elaborate the concept of three-tier architecture with reference to presentation, business logic, and data access layers.
(B) Differentiate between XHTML and XML.
(C) Discuss Agile and Waterfall methodologies in the context of web application development.