Ranjha Solutions logo
Ranjha Solutions
Past Papers — Solved · Free

Lecturer in Computer Science (B-17) — 2023 · Solved Past Paper

Body: Khyber Pakhtunkhwa Public Service Commission (KPPSC) · Post: Lecturer in Computer Science (B-17) · Year: 2023 · Questions: 45 in the original paper — 44 solved and verified, 1 excluded as defective (Q30) · Price: Free

Download as PDF

How to use this paper: each question shows the stem, the four options, and the correct answer. Click “Why each option?” under a question to see all four options explained — one question teaches four topics. General Knowledge answers are as of the 2023 sitting.
Source note: Typed community reproduction on MCQsGalaxy, exam paper "KPPSC Lecturer Computer Science May 2023" (https://mcqsgalaxy.com/exam-paper/kppsc-lecturer-cs-may-2023/, pages /2/ /3/ /4/ /5/), fetched 11 Nov 2026; 45 questions with per-question explanations; correct letters embedded in the page markup (data-correct) and stated in each explanation — treated as claims to verify, never as evidence. Four of the site's keys were found wrong and corrected (Q9 smallest unit of data: site A Byte wrong, correct B Bit; Q13 cache replacement: site C LFU wrong, LFU is a standard policy, correct A Most Frequently Used; Q16 default IP of a computer: site C 192.168.0.1 is the router's gateway, correct B 127.0.0.1; Q36 not a topology: site C Ring wrong, bus/star/ring are standard topologies, correct D Hexagon). Date corroborated by the May 2023 Lecturer/SS test window (Female SS Biology 24-05-2023, Female SS Chemistry 25-05-2023, Male SS Maths 25-05-2023). No advertisement/serial number is stated on the source, so none is asserted. Every answer was derived and verified independently under the owner's 8 Nov 2026 standard. Answer balance (44 solved) A12/B16/C11/D5. Printed wording kept as filed (Q2 "SNMMP"; Q6 "Algorithem"; Q11 "Read on Memory"; Q25 "Screen pixle"; Q28 "Pyrhon"; Q30 stem truncated as printed); delegation decisions recorded in the source file, all decided by the assistant under the owner's 8 Nov 2026 delegation.

Question 1 Computer Science

Informal language description of steps in an algorithm called?

Why each option?

A. Wrong: an algorithm is the sequence of steps itself, not its informal-language description.

B. Correct: pseudocode is an informal, plain-language description of the steps in an algorithm.

C. Wrong: a flowchart is a diagram of the steps, not an informal language description.

D. Wrong: a program is the algorithm written in a programming language, not its informal description.

Question 2 Computer Science

The protocol used for transmission of data / information across the internet?

Why each option?

A. Wrong: ICMP is a control-message protocol (error reporting), not the data-transmission protocol of the internet.

B. Wrong: SNMP is a network-management protocol (the option prints "SNMMP").

C. Correct: HTTP is the protocol used for transmitting data/information across the internet between web servers and browsers.

D. Wrong: SFTP is a file-transfer protocol, not the general data-transmission protocol.

Question 3 Computer Science

The implication p → q is equivalent to its

Why each option?

A. Wrong: q → p is the converse of p → q, not equivalent to it.

B. Correct: the contrapositive of p → q is ~q → ~p, and the two are logically equivalent.

C. Wrong: p = q is not a logical equivalence of the implication.

D. Wrong: ~p → ~q is the inverse of p → q, not equivalent to it.

Question 4 Computer Science

The pointer points to a variable goes out of scope

Why each option?

A. Wrong: there is no standard "empty pointer" concept for this situation.

B. Wrong: a null pointer points to nothing (value NULL), not to freed memory.

C. Wrong: a wild pointer is an uninitialised pointer pointing to an unknown location.

D. Correct: a dangling pointer points to a variable that has gone out of scope or whose memory has been deallocated.

Question 5 Computer Science

Which of the following is used as a database management system?

Why each option?

A. Correct: MySQL is a database management system.

B. Wrong: Java is a programming language, not a DBMS.

C. Wrong: Perl is a programming language, not a DBMS.

D. Wrong: Visual Basic is a programming language, not a DBMS.

Question 6 Computer Science

Which of the following is the technique used in the cryptography to convert plain text into coded message?

Why each option?

A. Wrong: "algorithm" is a step-by-step procedure, not the conversion of plain text to code (the option prints "Algorithem").

B. Correct: encryption converts plain text into a coded (cipher) message.

C. Wrong: decryption converts a coded message back to plain text — the reverse process.

D. Wrong: authorisation grants access rights; it does not convert plain text to code.

Question 7 Computer Science

Function in programming

Why each option?

A. Correct: a function is a chunk of code that can be called over and over again.

B. Wrong: that describes an array, not a function.

C. Wrong: printing is one thing a function may do, not what a function is.

D. Wrong: that describes a loop, not a function.

Question 8 Computer Science

Type of variable that can be used where the scope and extent of the variable is within the method or statement block in which it is declared

Why each option?

A. Wrong: a constant is a value that cannot change; scope is not its defining feature.

B. Correct: a local variable is declared within a method or statement block, and its scope and extent are within that block.

C. Wrong: a global variable is accessible throughout the program, not only within one block.

D. Wrong: a static variable keeps its value between calls; it is not defined by block scope.

Question 9 Computer Science

The smallest unit of storing data is?

Why each option?

A. Wrong: a byte (8 bits) is not the smallest unit of data — a bit is smaller. The source site keys A, which is a common textbook error.

B. Correct: a bit (0 or 1) is the smallest unit of storing data.

C. Wrong: a word is a group of bytes (typically 2, 4 or 8), larger than a byte.

D. Wrong: a kilobyte is 1024 bytes, far larger than a bit.

Question 10 Computer Science

The design approach that focuses on the needs and preference of the end-user?

Why each option?

A. Wrong: information architecture organises the structure of information, not the end-user's needs and preferences.

B. Wrong: information design presents information clearly; it is not the user-focused design approach.

C. Correct: user-centred design is the approach that focuses on the needs and preferences of the end-user in each phase of design.

D. Wrong: user research is a method for learning about users, not the design approach itself.

Question 11 Computer Science

The component of the computer that holds data, programs and instruction that are currently in use is?

Why each option?

A. Correct: RAM holds the data, programs and instructions currently in use.

B. Wrong: ROM holds firmware that is read, not the programs and data currently in use (the option prints "Read on Memory" for Read Only Memory).

C. Wrong: the hard disk stores data permanently, not the data currently in use.

D. Wrong: extended memory is memory above the 1 MB limit in old DOS systems, not the component holding current data.

Question 12 Computer Science

How long is an IPV6 address?

Why each option?

A. Wrong: 16 bits is the length of one IPv6 field, not the whole address.

B. Wrong: 32 bits is the length of an IPv4 address.

C. Wrong: 64 bits is half an IPv6 address.

D. Correct: an IPv6 address is 128 bits long (eight 16-bit fields separated by colons).

Question 13 Computer Science

Which of them is not suitable as a Cache Replacement Algorithm?

Why each option?

A. Correct: evicting the most frequently used entry defeats the purpose of a cache, so "most frequently used" is not a suitable cache replacement policy. The source site keys C, which is wrong — LFU is a standard, widely used cache replacement policy (for example Redis allkeys-lfu, and standard textbooks list LFU alongside LRU and FIFO).

B. Wrong: FIFO is a standard cache replacement algorithm.

C. Wrong: LFU is a standard cache replacement algorithm (evict the least frequently accessed entry).

D. Wrong: LIFO is a standard cache replacement algorithm.

Question 14 Computer Science

Computer Memory addresses are represented using?

Why each option?

A. Wrong: hexadecimal is the human-readable notation for addresses, not the machine representation.

B. Wrong: decimal is not how memory addresses are represented at machine level.

C. Correct: instructions and memory addresses are represented by binary codes at machine level.

D. Wrong: octal is not how memory addresses are represented.

Question 15 Computer Science

UNICODE is an example of?

Why each option?

A. Correct: Unicode is a universal character encoding standard.

B. Wrong: a driver is software that controls hardware, not a character encoding.

C. Wrong: Unicode is a standard, not a piece of software.

D. Wrong: Unicode is not a database.

Question 16 Computer Science

Default IP address of a Computer is?

Why each option?

A. Wrong: 1.1.1.1 is a public DNS resolver address, not a computer's default IP.

B. Correct: 127.0.0.1 (localhost, the loopback address) is the default IP address of a computer itself. The source site keys C, which is the default gateway address of most home routers, not the computer's own default IP.

C. Wrong: 192.168.0.1 is the default address of the router/gateway, not of the computer.

D. Wrong: 0.0.0.0 means "no specific address" / all interfaces, not the computer's default IP.

Question 17 Computer Science

Which of the following is a type of software that is designed to prevent un-authorized access to the computer or network?

Why each option?

A. Wrong: backup software copies data for recovery; it does not block unauthorised access.

B. Correct: a firewall is designed to prevent unauthorised access to a computer or network by inspecting incoming and outgoing traffic.

C. Wrong: antivirus detects and removes malware; preventing unauthorised network access is the firewall's job.

D. Wrong: phishing is an attack technique, not a protective software type.

Question 18 Computer Science

A _____ present a choice of operations or services that can be performed by a system at a given time.

Why each option?

A. Wrong: icons are small pictures representing objects, not a choice of operations.

B. Correct: a menu presents a choice of operations or services that a system can perform at a given time.

C. Wrong: a pointer indicates a position on screen, it does not present choices.

D. Wrong: a window is a display area, not a choice of operations.

Question 19 Computer Science

Which of the following is a type of software that is used to create and edit spreadsheets?

Why each option?

A. Wrong: Google Docs is a word processor, not a spreadsheet application.

B. Correct: Google Sheets is the spreadsheet application in the Google Docs Editors suite.

C. Wrong: Google Colab is a notebook environment for Python, not a spreadsheet application.

D. Wrong: Photoshop is an image editor, not a spreadsheet application.

Question 20 Computer Science

The ability of the user / system to modify the user interface is?

Why each option?

A. Wrong: recoverability is the ability to recover from errors, not to modify the interface.

B. Wrong: observability is the ability to see the system's state, not to modify the interface.

C. Correct: customizability is the ability of the user/system to modify the user interface to suit preferred ways of use.

D. Wrong: responsiveness is how quickly the system reacts, not the ability to modify the interface.

Question 21 Computer Science

The sorting algorithm which repeatedly swaps the adjacent elements if they are in the wrong order is?

Why each option?

A. Correct: bubble sort repeatedly compares adjacent elements and swaps them if they are in the wrong order.

B. Wrong: insertion sort inserts each element into its correct position in a sorted part, it does not repeatedly swap adjacent elements.

C. Wrong: there is no standard sorting algorithm called "adjacent sort".

D. Wrong: quick sort partitions around a pivot; it does not repeatedly swap adjacent elements.

Question 22 Computer Science

In context of database systems, a candidate key that consist of two or more attributes that together uniquely identify an entity occurrence is called?

Why each option?

A. Defensible but not picked: "compound key" is used in some texts as a synonym for a key made of multiple attributes.

B. Picked: a composite key is the standard term for a candidate key consisting of two or more attributes that together uniquely identify an entity occurrence.

C. Wrong: a primary key is the chosen identifier; it may be single-attribute.

D. Wrong: a foreign key references another table's key, it does not identify an entity occurrence in its own table. Picked by assistant under owner's 8 Nov delegation.

Question 23 Computer Science

Any programming language must have the constructs to support

Why each option?

A. True in isolation: selection (if/else) is one of the three basic constructs.

B. True in isolation: sequence is one of the three basic constructs.

C. True in isolation: iteration (loops) is one of the three basic constructs.

D. Correct: any programming language must support selection, sequence and iteration.

Question 24 Computer Science

ASCII stand for?

Why each option?

A. Wrong: the word is "Standard", not "Security".

B. Wrong: this expansion is invented.

C. Correct: ASCII stands for American Standard Code for Information Interchange.

D. Wrong: the words are "Standard" and "Interchange", not "Scientific" and "Exchange".

Question 25 Computer Science

______ expresses how many pixels are present in a display or entire screen.

Why each option?

A. Wrong: pixel count is not the standard term for this.

B. Correct: resolution expresses how many pixels are present in a display or entire screen.

C. Wrong: OpenGL is a graphics API, not a measure of pixels.

D. Wrong: this is a misspelling, not the term (the option prints "pixle").

Question 26 Computer Science

For larger inputs, Merge Sort is faster then Insertion Sort.

Why each option?

A. Correct: merge sort (divide and conquer, O(n log n)) is faster than insertion sort (O(n²)) for larger inputs.

B. Wrong: merge sort is faster for larger inputs.

C. Wrong: the comparison is well established.

D. Wrong: for larger inputs merge sort is consistently faster.

Question 27 Computer Science

Worst case space complexity of Queue is?

Why each option?

A. Wrong: a queue stores each element once, so its space is linear, not quadratic.

B. Correct: all elements must be stored, so the worst-case space complexity of a queue is O(n).

C. Wrong: O(log n) space would mean only a fraction of elements are stored.

D. Wrong: O(n log n) is larger than the actual linear space.

Question 28 Computer Science

Which of the following is not a programming language?

Why each option?

A. Wrong: Python (the option prints "Pyrhon") IS a programming language.

B. Correct: HTML is a markup language, not a programming language.

C. Wrong: Java IS a programming language.

D. Wrong: Ruby IS a programming language.

Question 29 Computer Science

Which of the following is not a web browser?

Why each option?

A. Wrong: Chrome is a web browser.

B. Correct: Apache is a web server, not a web browser.

C. Wrong: Firefox is a web browser.

D. Wrong: Safari is a web browser.

Question 30 Computer Science

What is the output of the code: int num1 = 5; int num2 = 7; cout

No answer is given for this question, and none is taught. DEFECTIVE — excluded (stem truncated: the cout statement is cut off, so the printed question has no determinable output)
Why each option fails

A. Cannot be determined: the code is cut off after "cout" with no output expression shown.

B. Cannot be determined: the code is cut off after "cout" with no output expression shown.

C. The site's explanation says the output is 12 (which would follow from "cout << num1 + num2"), but that expression does not appear in the printed stem.

D. Cannot be determined: the code is cut off after "cout" with no output expression shown. The printed stem is incomplete, so the question has no determinable answer and is excluded as DEFECTIVE (decided by assistant under owner's 8 Nov delegation).

Question 31 Computer Science

Which of the following is known as the language made up of binary coded instructions.?

Why each option?

A. Wrong: high-level languages are written in words, not binary-coded instructions.

B. Wrong: BASIC is a high-level language.

C. Wrong: C is a high-level (compiled) language.

D. Correct: machine language is made up of binary-coded instructions used directly by the computer's hardware.

Question 32 Computer Science

_____ is used to provide the specific implementation of a method which is already provided by its superclass.

Why each option?

A. Wrong: operator overloading gives new meaning to operators, not a new implementation of an inherited method.

B. Wrong: method overloading is multiple methods with the same name but different parameters in the same class.

C. Correct: method overriding lets a subclass provide a specific implementation of a method already provided by its superclass.

D. Wrong: operator overloading is about operators, not about re-implementing an inherited method.

Question 33 Computer Science

Source program is compiled to an intermediate form called?

Why each option?

A. Correct: a source program is compiled to an intermediate form called byte code, which an interpreter converts to machine code.

B. Wrong: there is no standard intermediate form called "smart code".

C. Wrong: executable code is the final machine code, not the intermediate form.

D. Wrong: pseudocode is an informal description, not a compiled intermediate form.

Question 34 Computer Science

Colour Printers uses the ink cartridges of?

Why each option?

A. Correct: colour printers use CMYK ink cartridges (cyan, magenta, yellow, black).

B. Wrong: CMY omits black, which colour printers also use.

C. Wrong: RGB is the colour model for screens, not printer ink.

D. Wrong: printers do not use an RGBK ink set.

Question 35 Computer Science

Which of the following language does computer understand?

Why each option?

A. Wrong: the computer does not understand C directly — C is compiled to machine code.

B. Wrong: assembly is also translated (assembled) to machine code.

C. Correct: the computer understands only binary (machine) language — instructions as 0s and 1s.

D. Wrong: BASIC is a high-level language, compiled or interpreted.

Question 36 Computer Science

Which of the following is not a common used computer topology?

Why each option?

A. Wrong: bus is one of the standard computer topologies.

B. Wrong: star is one of the standard computer topologies.

C. Wrong: ring is one of the standard computer topologies (bus, star and ring are the classic three) — the source site keys C on the grounds that ring is "rarely used today", but that does not make it "not a topology".

D. Correct: a hexagon is a shape, not a computer network topology at all.

Question 37 Computer Science

Which of the following is the correct way to get the length of string variable in C++?

Why each option?

A. Picked: length() is the conventional way to get the length of a C++ std::string.

B. Wrong: there is no standalone Length() function for std::string in C++.

C. Also correct in substance: size() returns the same value as length() for std::string (the site's own explanation says both methods work) — A is picked as the conventional answer.

D. Wrong: there is no standalone Size() function for std::string in C++. Picked by assistant under owner's 8 Nov delegation.

Question 38 Computer Science

Which of the following is the correct way to declare and initialize a string variable in C++?

Why each option?

A. Correct: this declares and initialises a C++ string variable in one statement.

B. Wrong: a char holds a single character, not the string "John".

C. Wrong as "declare and initialise": this declares the variable and then assigns to it in a separate statement — it works, but it is declaration followed by assignment, not declaration with initialisation.

D. Wrong: this declares a character array, not a string variable (and it lacks the null terminator).

Question 39 Computer Science

_____ describe the bundling of data and methods operating on this data into one unit?

Why each option?

A. Wrong: abstraction hides complexity and shows only essential features; it is not the bundling of data and methods.

B. Wrong: polymorphism is one interface with many forms, not bundling.

C. Correct: encapsulation is the bundling of data and the methods operating on that data into one unit (a class).

D. Wrong: aggregation is a has-a relationship between objects, not bundling of data and methods.

Question 40 Computer Science

Which of the following is not a characteristic of High Level Language?

Why each option?

A. Correct: machine code is the language of the hardware, not a characteristic of high-level languages (which are platform independent, interactive and user friendly).

B. Wrong: platform independence IS a characteristic of high-level languages.

C. Wrong: interactive execution IS a characteristic of high-level languages.

D. Wrong: being user friendly IS a characteristic of high-level languages.

Question 41 Computer Science

When algorithm is written in the form of programming language, it becomes a ?

Why each option?

A. Wrong: a flowchart is a diagram of an algorithm, not an algorithm written as code.

B. Wrong: pseudocode is the informal description, not the algorithm in a programming language.

C. Correct: when an algorithm is written in the form of a programming language, it becomes a program.

D. Wrong: syntax is the set of rules of a language, not the algorithm written in it.

Question 42 Computer Science

What is the correct way to declare a constant in C++?

Why each option?

A. Wrong: the const qualifier must come before the type (or after it, as "int const x"), not as "int constant".

B. Correct: this is the standard way to declare a constant in C++.

C. Wrong: this declares an ordinary (changeable) variable, not a constant.

D. Wrong: option B is correct.

Question 43 Computer Science

Which of the following is designed to control the operation of a computer?

Why each option?

A. Wrong: the user operates the computer; software controls it.

B. Wrong: application software performs user tasks (word processing, browsing); it does not control the computer's operation.

C. Correct: system software (operating system and utilities) is designed to control the operation of a computer.

D. Wrong: utility software is a part of system software for maintenance tasks, not the software that controls the computer's operation in general.

Question 44 Computer Science

The condition "Every non prime attribute has a full functional dependency on a candidate key attribute depends on the complete primary key is satisfied in?

Why each option?

A. Wrong: 1NF requires atomic values only; it does not require full functional dependency.

B. Correct: a relation is in 2NF when it is in 1NF and every non-prime attribute is fully functionally dependent on the (whole) primary key.

C. Wrong: there is no normal form called "extensive normal form".

D. Wrong: unnormalised form has repeating groups and no dependency requirements.

Question 45 Computer Science

Software process model that incorporates risk management during every iteration is called?

Why each option?

A. Wrong: the waterfall model is sequential with no iteration or risk management at every step.

B. Wrong: the prototype model builds mock-ups for feedback; risk management at every iteration is not its defining feature.

C. Correct: the spiral model incorporates risk management during every iteration.

D. Wrong: RAD emphasises rapid prototyping and user feedback, not risk management at every iteration.