KPPSC Lecturer Computer Science Previous Paper with Answer Keys and Reference

Attempting OMR Paper

Khyber Pakhtunkhwa Public Service Commission

KPPSC Lecturer Computer Science Paper with Answer keys held on 17-11-2021 

Time allowed: 1 hour

Max marks: 45

1. The minimum number of temporary variables needed to swap the contents of two variables is

a) 1
b) 3
c) 4
d) 0 *

Answer: d) 0

Check Reference

Note: This question was missing correct option i.e. 0 in the actual paper.

2. When a variable of data type double is converted into float, then

a) Rounding takes place
b) Truncation takes place
c) The lower order bits are dropped
d) None of these

Answer: a) Rounding takes place
Check Reference

3. Choose the correct statements

a) All The elements of the array should be of the same data type and storage class
b) The number of subscripts determines the dimension of the array
c) Both of these
d) None of these

Answer: b) The number of subscripts determines the dimension of the array

Check Reference

4. Initialization cannot be part of the definition if the storage class of the array is

a) static
b) automatic
c) external
d) none of these

Answer: b) Automatic

Check Reference 

5. English language uses full stop as a sentence

a) Separator
b) Terminator
c) Both of these
d) None of these

Answer: c) Both (a) and (b)

Check Reference 

6. Overloading is

a) Function having the same name but with different types of parameters
b) An operator, whose meaning is determined by the operand type
c) Both (a) and (b)
d) None of these

Answer: c) Both (a) and (b)

Check Reference 

7. If the parameters are passed by name the output will be:

a) 2,4
b) 4,2
c) 2,2
d) 4,4

Answer: d) 4,4

Note: Coding part is missing, the complete question as under:
Consider the following program fragment.
Procedure exchange (A: integer, B: integer)
temp: integer;
temp: = A; A:=B; B:=temp
M: = 2; X[X] :=4;
exchange (M,X[M]; write (M,x[2]);
If the parameters are passed by name the output will be:
a) 2,4
b) 4,2
c) 2,2
d) 4,4

8. Binding cannot be done

a) When separately compiled modules are linked together
b) During loading
c) While writing a program
d) None of these

Answer: d) none of these

Check Reference 

9. What is the maximum value of the function f(x) = 2×2 -2x + 6 in the interval [0, 2]?

a) 6
b) 10
c) 12
d) 5

Answer: b) 10

Check Reference 

10. The number of equivalence relation of the set {1,2,3,4} is:

a) 15
b) 16
c) 24
d) 4

Answer: a)15

Check Reference 

11. In a paged memory, the page hit ratio is 0.35. The time required to access a page in secondary memory is equal to 100 ns. The time required to access a page in primary memory is 10 ns. The average time required to access a page is

a) 3.0 ns
b) 68.0 ns
c) 68.5 ns
d) 78.5 ns

Answer: c) 68.5 ns

Check Reference 

12. Which of the following scheduling policy is well suited for a time-shared operating system?

a) First come first serve.
b) Shortest job first
c) Round robin
d) None of these

Answer: c) Round robin

Check Reference 

13. Any given truth table can be represented by a :

a) Karnaugh Map
b) Sum of product of Boolean expressions
c) Product of sum of Boolean expressions
d) All of these

Answer: (d) All of these

Check Reference 

14. The number of columns in a state table for a sequential circuit with m flip-flops and n inputs is

a) m + n
b) m + 2n
c) 2m + n
d) 2m + 2n

Answer: d) 2m + 2n

Check Reference 

15. Which of the following architecture is/are not suitable for realizing SIMD ?

a) Vector Processor
b) Array Processor
c) Von Neumann
d) All of these

Answer: c)Von Neumann

Check Reference 

16. If memory access takes 20 ns with cache and 110 ns without it, then the ratio ( cache uses a 10 ns memory) is:

a) 93%
b) 90%
c) 88%
d) 87%

Answer: b) 90%
Check Reference 

17. Which of the following is minimum error code?

a) Optical code
b) Binary code
c) Grey code
d) None of these

Answer: c) Grey code

Check Reference 

18. How many flip flag circuit are needed to divide by 16?

a) 4
b) 8
c) 16
d) None of these

Answer: a)4

Check Reference 

19. A compiler – compiler is a/an

a) compiler which compiles a compiler program
b) software tool used in automatic generation of a compiler
c) compiler which in the same language it compiles
d) another name for cross. compiler

Answer: (b) software tool used in automatic generation of a compiler

Check Reference 

 20. The delay between job submission and job completion is called

a) turnaround time
b) in-process time
c) response time
d) wailing time

Answer: (a) turnaround time

Check Reference 

21. Which technique is preferable for transferring a large amount of data to and from a memory in a short time?

a) Programmed I/O
b) Interrupt driven I/O
c) DMA
d) None of these

Answer: c) DMA

Check Reference 

22. A software is to be developed for a system which has a small memory. The software should?

a) avoid using recursion
b) Not use macros instead of functions
c) Both of these
d) None of these

Answer: c) both of these

Check Reference 

23. A function that does the same operation on different data types is to be implemented using

a) macros
b) overloading
c) function templates
d) default arguments

Answer: c) function templates

Check Reference 

24. The order in which operands are evaluated in an expression is predictable if the operator is:

a) *
b) +
c) %
d) &&

Answer: d) &&

Check Reference 

25. Which of the following comments about object oriented design of software, is not true?

a) Objects inherit the properties of class
b) Classes are defined based on the attributes of objects
c) classes are always different
d) an object can belong to two classes

Answer: d) an object can belong to two classes

Check Reference 

26. Design phase will usually be

a) Top-down
b) Bottom-up
c) Random
d) None of the above

Answer: a )Top-down

Check Reference 

27. Which of the following is a desirable property of a module?

a) High coupling
b) Independency
c) Low cohesiveness
d) Multi functioning

Answer: b) Independency

Check Reference 

28. The extent to which the software can continue to operate correctly despite the introduction of invalid inputs is called as

a) Reliability
b) Fault tolerance
c) Robustness
d) Portability

Answer: (c) Robustness

Check Reference 

29. Which of the following graph theoretic concept will be useful in software testing?

a) Hamiltonian circuit
b) Eulerian cycle
c) Cyclomatic number
d) None of these

Answer: c) Cyclomatic number

Check Reference 

30. In unit testing a module, it is found that for a set of test data, maximum 90% of the code alone were tested with a probability of success 0.9. The reliability of the module is

a) greater than 0.9
b) equal to 0.9
c) at most 0.81
d) at least 1/0.81

Answer: c) at most 0.81

Check Reference 

31. The programme volume of a source code with 10 operators, including 6 unique operators, 6 operands including 2 unique operands. The program volume is

a) 48
b) 100
c) 512
d) Cannot be determined

Answer: a) 48

Check Reference 

32. A PL /SQL block can return data to SQL* plus through:

a) Local variables
b) Bind variables
c) substitution variables
d) none of these

Answer: a) Local variables

Check Reference 

33. Which of the following SQL* Plus commands can be used to see the compilation errors in a PUSQL code?


Answer: d) SHOW ERRORS

Check Reference 

34. In SQL 10 null be evaluated to

a) False
b) -1
c) Null
d) 10

Answer: c) null

Check Reference 

35. Which of the following is illegal?

d) None of these

Answer:  d) None of these 
Check Reference  

36. Which of the following SQL commands can be used to add data to a database table?

b) ADD

Answer: a) INSERT

Check Reference  

37. The SQL statement: select LPAD(‘abcd’,10,’wert’) from dual; prints

a) Wertwertab
b) Wertweabcd
c) Abcdwertwer
d) None of these

Answer: b) wertweabcd

Check Reference  

38. The basic programming unit of a PL/SQL code is

a) Procedure
b) Sub-program
c) Module
d) Block

Answer: d)Block 

Check Reference

39. Which of the following package can be used to build dynamic SQL?

a) Writing a query with parameters
b) Using sp_executesql
c) Using EXEC
d) All of these

Answer: d)  All of these  

Check Reference

40. Which of the following keyword is not used in PL/SQL procedure creation?

a) Declare
b) Begin
c) Exception
d) End

Answer: a) declare

Check Reference

41. Logically speaking, in general it is a good idea to set the values of the checkbox making of the other values property to the value of the property

a) Value when checked
b) Value when unchecked
c) Null
d) None


42. Summary column can be used to display

a) Total
b) Minimum value
c) Average
d) All of these

Answer: d) all of these

43. Column names used and reports are

a) Global
b) Local to the query
c) Local to the groups
d) None of these

Answer: a) Global

Check Reference

44. Records that are displayed by a form can be edited if the mode of the corresponding query is

a) Query
b) Enter query
c) Normal
d) Enter normal

Answer: c) Normal
Check Reference

45. At a particular time of computation, the value o. a counting semaphore is 7. Then 20 P operation and ‘x’ V operation were completed on this semaphore. If the final value of the semaphore is 5, x will be

a) 15
b) 22
c) 18
d) 13

Answer: c) 18
Check Reference

Related Posts

Like, Share, and Follow Us!

Leave a Reply

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

Copyright © 2021 Basics of Computer