Lecturer 2026AJKPSCSolved Paper
Lecturer 2026 Computer Science Paper
#cssnexusThe official Lecturer tests 2026 Computer Science solved paper (ajkpsc). Every MCQ is typed out below with its correct answer marked.
Lecturer 2026 Computer Science paper — full text
Every MCQ from the paper, with the correct answer marked in green. Want to test yourself first? Attempt it as a timed quiz.
Data structures and algorithms (Q1–13)
1In a linked list, there are no NULL links in a:
- A)Singly linked list
- B)Linear doubly linked list
- C)Circular linked list
- D)None of the above
Explanation: The last node points back to the first.
2Searching a binary search tree takes (average case, worst case):
- A)N, N+1
- B)log N, N
- C)1, log N
- D)None of the above
Explanation: O(log n) when balanced; O(n) when the tree degenerates into a list.
3Which sorting algorithm repeatedly swaps adjacent entries?
- A)Insertion sort
- B)Bubble sort
- C)Shell sort
- D)Quick sort
Explanation: Bubble sort compares and swaps neighbours.
4O(n) means the running time is:
- A)Of n nested loops
- B)n times slower
- C)Proportional to n
- D)Equal to n statements
Explanation: Linear time.
5Breadth-first search (BFS) uses a:
- A)Linked list
- B)Queue
- C)Graph
- D)Stack
Explanation: DFS uses a stack.
6Which of the following is not a linear data structure?
- A)Array
- B)Linked list
- C)None of the above
- D)Both a & b
Explanation: Both arrays and linked lists are linear; trees and graphs are not.
7Prim's algorithm for minimum spanning trees is based on the:
- A)Divide and conquer method
- B)Dynamic programming method
- C)Branch and bound method
- D)Greedy method
Explanation: It adds the cheapest edge at each step.
8Which of the following is not a backtracking problem?
- A)Tower of Hanoi
- B)N-queens problem
- C)M-colouring problem
- D)Knight's tour problem
Explanation: Tower of Hanoi is solved by simple recursion.
9The time complexity of the Floyd-Warshall algorithm is:
- A)O(n² log n)
- B)O(n³)
- C)O(n log n)
- D)O(n²)
Explanation: Three nested loops over the vertices.
10A key characteristic of dynamic programming is that it:
- A)Divides a problem into independent subproblems
- B)Always uses recursion only
- C)Combines solutions of overlapping subproblems
- D)Never stores intermediate results
Explanation: Results are stored (memoised) and reused.
11Merge sort follows the:
- A)Backtracking method
- B)Divide and conquer method
- C)Dynamic programming method
- D)Greedy method
Explanation: Split, sort halves, merge.
12The prefix (Polish) form of A + (B - C) * D is:
- A)+ A * B C D
- B)+ A * - B C D
- C)A B C - D * +
- D)None of the above
Explanation: Option C is the postfix form.
13The majority element of an array can be found in:
- A)O(1) time
- B)O(log n) time
- C)O(n) time
- D)O(n²) time
Explanation: Boyer-Moore majority vote algorithm.
Computer networks (Q14–27)
14The physical layer is concerned with:
- A)Port-to-port delivery
- B)Bit-by-bit delivery
- C)Application-to-application delivery
- D)Process-to-process delivery
Explanation: It moves raw bits over the medium.
15A coaxial cable has conductors with:
- A)A common axis
- B)Equal resistance
- C)The same diameter
- D)No common feature
Explanation: Hence "co-axial".
16The area on Earth covered by a satellite's radio beam is called its:
- A)Beam width
- B)Circular polarisation
- C)Footprint
- D)Uplink
Explanation: The footprint.
17Buffering is:
- A)A way of reducing routing overhead in routers
- B)Temporary storage to absorb speed differences
- C)A way of reducing crosstalk between cables
- D)A way of compressing data before sending
Explanation: Buffers smooth out speed mismatches.
18Which of the following does not apply to the IP protocol?
- A)It is connectionless
- B)It offers reliable service
- C)It offers best-effort, unreliable service
- D)None of the above
Explanation: Reliability is provided by TCP.
19In asymmetric (public-key) cryptography, the private key is held by the:
- A)Sender
- B)All devices on the network
- C)Sender and receiver both
- D)Receiver
Explanation: Messages are encrypted with the receiver's public key.
20ATM networks are:
- A)Connectionless
- B)Satellite-based
- C)Connection-oriented
- D)None of the above
Explanation: Asynchronous Transfer Mode sets up virtual circuits.
21DHCP stands for:
- A)Digital Host Communication Provider
- B)Dynamic Host Configuration Protocol
- C)Dynamic High Computing Processor
- D)Digital Host Communication Protocol
Explanation: It assigns IP addresses automatically.
22To deliver a message to the right application on a host, the ______ address must be used.
- A)Physical
- B)IP
- C)Port
- D)Tunnel
Explanation: Ports identify processes.
23The main job of the data link layer includes:
- A)Adding physical (MAC) addresses
- B)Encryption
- C)Requesting network services
- D)Setting up sessions
Explanation: Framing and MAC addressing.
24IPv6 addresses are ______ bits long.
- A)32
- B)64
- C)128
- D)256
Explanation: IPv4 uses 32 bits.
25Session layer checkpoints:
- A)Control the addition of headers
- B)Allow only part of a file to be resent
- C)Detect and correct errors
- D)Have nothing to do with recovery
Explanation: Synchronisation points for recovery.
26A computer network allows the sharing of:
- A)Resources
- B)Information
- C)Both a and b
- D)None of the above
Explanation: Hardware, software and data.
27An email message is broken into ______ for transmission.
- A)Packets
- B)Frames
- C)Bytes
- D)Hypertext
Explanation: Packet switching.
Operating systems and computer architecture (Q28–42)
28In a time-sharing system, when a process's time slice ends, it moves from running to the:
- A)Suspended state
- B)Blocked state
- C)Terminated state
- D)Ready state
Explanation: It waits for its next turn.
29Which is a synchronisation tool?
- A)Thread
- B)Socket
- C)Pipe
- D)Semaphore
Explanation: Dijkstra's semaphores.
30The operating system keeps a page table for each:
- A)Instruction
- B)Thread
- C)Process
- D)Address
Explanation: Each process has its own address space.
31Virtual memory allows memory to be shared among:
- A)Users only
- B)Processes
- C)Instructions only
- D)Data only
Explanation: Shared pages map into several processes.
32The address generated by the CPU is the:
- A)Physical address
- B)Logical address
- C)Absolute address
- D)None of the above
Explanation: The MMU maps it to a physical address.
33Memory fragmentation results in:
- A)Stack overflow
- B)Page faults
- C)Poor memory utilisation
- D)Better memory utilisation
Explanation: Free memory is broken into unusable pieces.
34In a wait-for graph, an edge from Pi to Pj means:
- A)Pj waits for a resource held by Pi
- B)Pi waits for a resource held by Pj
- C)Pi waits for a resource held by Pi
- D)None of the above
Explanation: A cycle means deadlock.
35The circuit that stores one bit of data is a:
- A)Register
- B)Encoder
- C)Flip-flop
- D)Decoder
Explanation: Registers are groups of flip-flops.
36Which code, still used today, was developed by IBM?
- A)ASCII
- B)Hollerith code
- C)EBCDIC
- D)Unicode
Explanation: Extended Binary Coded Decimal Interchange Code.
37In a RISC (load-store) architecture, memory is accessed only by:
- A)PUSH and POP
- B)LOAD and STORE
- C)CALL and RET
- D)MOV and JMP
Explanation: Other instructions work on registers.
38A set of lines connecting several devices is called a:
- A)Bus
- B)Peripheral wire set
- C)Port
- D)Channel
Explanation: Data, address and control buses.
39The program counter (PC) is also called the:
- A)Instruction pointer
- B)Data pointer
- C)Memory pointer
- D)Stack pointer
Explanation: It holds the address of the next instruction.
40The minimum number of operands an assembly instruction can have is:
- A)One
- B)Zero
- C)Two
- D)Three
Explanation: E.g. NOP, HLT.
41A nibble is a group of ______ bits.
- A)4
- B)2
- C)8
- D)16
Explanation: Half a byte.
42In a vectored interrupt:
- A)The branch address is fixed at one location in memory
- B)The device supplies the branch address as a vector
- C)The branch address is read from a processor register
- D)The CPU polls every device to find the source
Explanation: Each source has its own vector.
Software engineering (Q43–50)
43Which is a feature of good software?
- A)Modularity
- B)Accessibility
- C)Portability
- D)All of these
Explanation: All are quality attributes.
44CASE stands for:
- A)Computer Assisted Software Engineering
- B)Computer Aided Software Engineering
- C)Computer Adaptive Software Engineering
- D)None of the above
Explanation: Tools that support development.
45The activity that spreads estimated effort across the project by assigning it to tasks is:
- A)Project tracking
- B)Project scheduling
- C)Setting milestones
- D)Risk analysis
Explanation: Scheduling.
46Which is part of the Agile Manifesto?
- A)Customer collaboration
- B)Individuals and interactions
- C)Working software
- D)All of the above
Explanation: Plus "responding to change".
47Which document contains the user and system requirements?
- A)SRD
- B)STD
- C)SRS
- D)SDD
Explanation: Software Requirements Specification.
48The «include» relationship in a use case diagram captures:
- A)Optional behaviour
- B)Tertiary behaviour
- C)Mandatory behaviour
- D)System behaviour
Explanation: «extend» captures optional behaviour.
49Which is not part of a UML design class diagram?
- A)Class name
- B)None of the above
- C)Class operations
- D)Class attributes
Explanation: All three are parts of a class box.
50Aggregation is a relationship in which the:
- A)Part can exist independently of the whole
- B)Part cannot exist without the whole
- C)Whole depends on the part
- D)None of the above
Explanation: In composition the part cannot exist alone.
Discrete mathematics (Q51–58)
51The power set of the empty set has exactly ______ subset.
- A)Zero
- B)Two
- C)One
- D)None of the above
Explanation: {∅}.
52For a function to have an inverse, it must be a:
- A)Bijection
- B)Injection only
- C)Surjection only
- D)None of the above
Explanation: One-to-one and onto.
53Which method can only be used to disprove a statement?
- A)Counterexample
- B)Proof by contrapositive
- C)Mathematical induction
- D)Direct proof
Explanation: One counterexample disproves a universal claim.
54Which of these is a proposition?
- A)Get me a glass of milk.
- B)What time is it now?
- C)The only odd prime number is 2.
- D)God bless you.
Explanation: It is a statement with a truth value (here false).
55How many 4-bit strings contain exactly two 0s and two 1s?
- A)6
- B)5
- C)2
- D)4
Explanation: 4C2 = 6.
56P → Q is logically equivalent to:
- A)¬P ∨ Q
- B)¬P ∧ Q
- C)¬P ∧ ¬Q
- D)P ∨ Q
Explanation: An implication is false only when P is true and Q false.
57Two sets are disjoint if their ______ is empty.
- A)Intersection
- B)Union
- C)Power set
- D)Cartesian product
Explanation: They share no elements.
58If P(x) is "x > 7", which is true?
- A)P(1)
- B)P(2)
- C)P(9)
- D)P(7)
Explanation: 9 > 7.
Web technologies (Q59–65)
59HTML is a:
- A)Markup language
- B)Scripting language
- C)Programming language
- D)Protocol
Explanation: HyperText Markup Language.
60The basic building block of an HTML page is the:
- A)HTML attribute
- B)HTML tag
- C)HTML element
- D)HTML body
Explanation: An element includes its tags and content.
61In web design, CMS stands for:
- A)Content management system
- B)Creative management system
- C)Content mixing system
- D)Creative managerial system
Explanation: E.g. WordPress.
62The protocol of the World Wide Web is:
- A)HTTP
- B)SMTP
- C)TCP
- D)FTP
Explanation: HyperText Transfer Protocol.
63A web cookie is:
- A)Sent from the root server to all servers
- B)Sent from the browser and stored on the server
- C)Sent by a website and stored in the browser
- D)None of the above
Explanation: Small data saved on the client.
64______ was an early search tool for FTP archives.
- A)Google
- B)Archie
- C)AltaVista
- D)Gopher
Explanation: Archie (1990).
65The HTML tag for a line break is:
- A)<br>
- B)<lb>
- C)<td>
- D)<newline>
Explanation: <br> is an empty element.
Programming (C and C++) (Q66–79)
66In C, the % operator is the:
- A)Percentage operator
- B)Quotient operator
- C)Modulus operator
- D)Division operator
Explanation: It gives the remainder.
67The correct array initialisation in C is:
- A)int a(3) = {1,2,3};
- B)int a = {1,2,3};
- C)int a[3] = {1,2,3};
- D)int a new int[3];
Explanation: Size in square brackets.
68In C, the value of 2 + 4/2 + 6*2 is:
- A)16
- B)15
- C)18
- D)12
Explanation: 2 + 2 + 12 = 16.
69Using pointer notation, the third element of array a is:
- A)a+3
- B)&a+3
- C)*(a+2)
- D)*a+3
Explanation: Indexing starts at 0.
70In a structure, the declaration int x:8 means:
- A)x is an 8-bit field
- B)x stores the value 8
- C)Both a and b
- D)None of the above
Explanation: A bit-field.
71printf("Hello") returns:
- A)5
- B)1
- C)10
- D)0
Explanation: The number of characters printed.
72A constructor has:
- A)A void return type
- B)A class-object return type
- C)An int return type
- D)No return type
Explanation: Not even void.
73Objects created with the new operator are created at:
- A)Load time
- B)Compile time
- C)Run time
- D)Link time
Explanation: Dynamic allocation.
74The relationship between a base class and a derived class is:
- A)Encapsulation
- B)Polymorphism
- C)Abstraction
- D)Inheritance
Explanation: The "is-a" relationship.
75Which operator(s) access class members?
- A)Dot operator
- B)Arrow operator
- C)Both a and b
- D)Scope operator only
Explanation: Dot for objects, arrow for pointers.
76Virtual functions are primarily declared in the:
- A)Friend class
- B)Derived class
- C)Base class
- D)Template class
Explanation: Derived classes override them.
77A virtual function should be:
- A)Private
- B)Public
- C)Protected
- D)Static
Explanation: So it can be called through base pointers; it cannot be static.
78Which function(s) allocate memory dynamically in C?
- A)malloc
- B)calloc
- C)realloc only
- D)Both a & b
Explanation: Both allocate from the heap.
79Late (dynamic) binding is implemented using a:
- A)Friend function
- B)Static function
- C)Virtual function
- D)Inline function
Explanation: Resolved at run time through the vtable.
Databases (Q80–86)
80The set concept is the basis of the:
- A)Hierarchical model
- B)Network model
- C)Relational model
- D)Object model
Explanation: A relation is a set of tuples.
81Relational algebra is a:
- A)Data definition language
- B)Procedural query language
- C)Meta-language
- D)Non-procedural language
Explanation: Relational calculus is non-procedural.
82In a relation:
- A)There are no duplicate rows
- B)The order of tuples does not matter
- C)Both a and b
- D)None of the above
Explanation: A relation is a set.
83In an ER diagram, a derived attribute is shown by a:
- A)Diamond
- B)Double ellipse
- C)Rectangle
- D)Dashed ellipse
Explanation: A double ellipse shows a multivalued attribute.
84Which is not true of a view?
- A)It is stored permanently as data
- B)It is derived from base tables
- C)It is a virtual table
- D)It may have derived columns
Explanation: Only its definition is stored (unless materialised).
85Which SQL command removes a column from a table?
- A)UPDATE
- B)ALTER
- C)DELETE
- D)DROP
Explanation: ALTER TABLE ... DROP COLUMN.
86The relational algebra operation that selects columns is:
- A)Selection
- B)Union
- C)Projection
- D)Join
Explanation: Selection picks rows.
Tags
- #Lecturer 2026
- #Lecturer Computer Science past papers
- #Lecturer 2026 Computer Science paper
- #Computer Science
- #Lecturer AJKPSC
- #Lecturer
- #Computer Science lecturer past papers
- #AJKPSC lecturer computer science 2026
- #Lecturer computer science MCQs
- #Computer science MCQs with answers
- #Lecturer test preparation
- #PPSC lecturer computer science
- #Lecturer past papers
- #Lecturer test 2026
- #lecturerquestionpapers
- #lecturerquestionpapers2026
- #Lecturer Computer Science Question Paper 2026
- #CSS Nexus
