PPSC COMPUTER SCIENCE LECTURER PAPER 2020
1. How do you initialize an array in C?
a) int arr[3] = (1,2,3);
b) int arr(3) = {1,2,3};
c) int arr[3] = {1,2,3};
d) int arr(3) = (1,2,3);
2. Assuming int is of 4bytes, what is the size of int arr[15];?
a) 15
b) 19
c) 11
d) 60
3. Elements in an array are accessed _____________
a) randomly
b) sequentially
c) exponentially
d) logarithmically
4. What would be the Prefix notation for the given equation?
A+(B*C)
a) +A*CB
b) *B+AC
c) +A*BC
d) *A+CB
5. In asynchronous serial communication the physical layer provides ___________
a) start and stop signalling
b) flow control
c) both start & stop signalling and flow control
d) only start signalling
6. How many types of access specifiers are provided in OOP (C++)?
a) 1
b) 2
c) 3
d) 4
7. >> operator is used to denote _________
a) left shift
b) right shift
c) greater than
d) less than
8. What is interprocess communication?
a) communication within the process
b) communication between two process
c) communication between two threads of same process
d) none of the mentioned
9. The address of the next instruction to be executed by the current process is provided by the __________
a) CPU registers
b) Program counter
c) Process stack
d) Pipe
10. Which scheduling algorithm allocates the CPU first to the process that requests the CPU first?
a) first-come, first-served scheduling
b) shortest job scheduling
c) priority scheduling
d) none of the mentioned
PPSC SOLVED WITH EXPLANATION COMPUTER SCIENCE LECTURER PAPER 2020
1. How do you initialize an array in C?
a) int arr[3] = (1,2,3);
b) int arr(3) = {1,2,3};
c) int arr[3] = {1,2,3};
d) int arr(3) = (1,2,3);
Answer: c
Explanation: This is the syntax to initialize an array in C.
2. Assuming int is of 4bytes, what is the size of int arr[15];?
a) 15
b) 19
c) 11
d) 60
Answer: d
Explanation: Since there are 15 int elements and each int is of 4bytes, we get 15*4 = 60bytes.
3. Elements in an array are accessed _____________
a) randomly
b) sequentially
c) exponentially
d) logarithmically
Answer: a
Explanation: Elements in an array are accessed randomly. In Linked lists, elements are accessed sequentially.
4. What would be the Prefix notation for the given equation?
A+(B*C)
a) +A*CB
b) *B+AC
c) +A*BC
d) *A+CB
Answer: c
Explanation: Reverse the equation or scan the equation from right to left. Apply the infix-postfix algorithm. The equation inside the bracket evaluates to CB* and outside the bracket evaluates to A+ therefore getting CB*A+. Reversing this and we get +A*BC
5. In asynchronous serial communication the physical layer provides ___________
a) start and stop signalling
b) flow control
c) both start & stop signalling and flow control
d) only start signaling
Answer: c
Explanation: In asynchronous serial communication, the communication is not synchronized by clock signal. Instead of a start and stop signaling and flow control method is followed. Unlike asynchronous serial communication, in synchronous serial communication a clock signal is used for communication, so the start and stop method is not really required.
6. How many types of access specifiers are provided in OOP (C++)?
a) 1
b) 2
c) 3
d) 4
Answer: c
Explanation: Only 3 types of access specifiers are available. Namely, private, protected and public. All these three can be used according to the need of security of members.
7. >> operator is used to denote _________
a) left shift
b) right shift
c) greater than
d) less than
Answer: b
Explanation: >> operator denotes the right shift in binary arithmetic.
E.g. If we say, >>110 by 2-bits, the value obtained will be 001.
Similarly, << denotes the right shift operator.
8. What is interprocess communication?
a) communication within the process
b) communication between two process
c) communication between two threads of same process
d) none of the mentioned
Answer: b
Explanation: None.
9. The address of the next instruction to be executed by the current process is provided by the __________
a) CPU registers
b) Program counter
c) Process stack
d) Pipe
Answer: b
Explanation: None.
10. Which scheduling algorithm allocates the CPU first to the process that requests the CPU first?
a) first-come, first-served scheduling
b) shortest job scheduling
c) priority scheduling
d) none of the mentioned
Answer: a
Explanation: None.
No comments:
Post a Comment
Type Your Comment Here