🇵🇰 PPSC Lecturer Test · subject

PPSC Lecturer Test Computer Science (Subject Specialist Portion) Syllabus

The Computer Science (Subject Specialist Portion) syllabus for PPSC Lecturer Test in full: 8 chapters and 30 topics, every one listed below, plus 73 Computer Science (Subject Specialist Portion) flashcards with answers.

8Chapters
30Topics
73Flashcards

Computer Science (Subject Specialist Portion) syllabus: all 8 chapters

Expand any chapter to see its topics and sub-topics.

  1. Programming Fundamentals

    4 topics
    • Algorithms and Flowcharts
    • Data Types, Variables and Operators
    • Control Structures and Loops
    • Functions and Recursion
  2. Data Structures and Algorithms

    4 topics
    • Arrays, Stacks and Queues
    • Linked Lists, Trees and Graphs
    • Searching and Sorting Algorithms
    • Algorithm Complexity and Big-O
  3. Object-Oriented Programming

    3 topics
    • Classes and Objects
    • Inheritance and Polymorphism
    • Encapsulation and Abstraction
  4. Database Systems

    4 topics
    • DBMS Concepts and Models
    • Relational Model and ER Diagrams
    • SQL and Queries
    • Normalization
  5. Operating Systems

    4 topics
    • Process Management and Scheduling
    • Memory Management
    • Deadlocks and Synchronization
    • File Systems
  6. Computer Networks

    4 topics
    • OSI and TCP/IP Models
    • Network Topologies and Devices
    • IP Addressing and Subnetting
    • Network Security Basics
  7. Digital Logic and Computer Architecture

    3 topics
    • Number Systems and Boolean Algebra
    • Logic Gates and Combinational Circuits
    • CPU Organization and Memory Hierarchy
  8. Software Engineering

    4 topics
    • Software Development Life Cycle
    • Process Models (Waterfall, Agile)
    • Requirement Analysis and Design
    • Software Testing and Quality Assurance

PPSC Lecturer Test Computer Science (Subject Specialist Portion) flashcards — 73 questions with answers

  1. What is an algorithm?

    A finite, ordered set of unambiguous, well-defined steps to solve a problem or perform a task in a finite amount of time.

  2. In a flowchart, what shapes represent (a) a process/computation, (b) a decision, (c) input/output, and (d) start/end?

    (a) Rectangle, (b) Diamond, (c) Parallelogram, (d) Oval (terminator).

  3. What is pseudocode?

    An informal, language-independent description of an algorithm using plain English-like statements and programming structures, meant for human reading rather than execution.

  4. Differentiate between a primitive (built-in) data type and a derived/composite data type.

    Primitive types are basic types provided by the language (int, char, float, boolean). Derived/composite types are built from primitives (arrays, structures, classes, pointers).

  5. What is the difference between a variable and a constant?

    A variable is a named memory location whose value can change during execution; a constant is a named value that cannot be modified once defined.

  6. List the four main categories of operators in most programming languages.

    Arithmetic, Relational (comparison), Logical, and Bitwise operators (also assignment operators).

  7. What is operator precedence and associativity?

    Precedence determines which operator is evaluated first in an expression; associativity (left-to-right or right-to-left) decides the order when operators have equal precedence.

  8. What is the difference between '==' and '=' in C-like languages?

    '==' is the equality comparison operator (returns true/false); '=' is the assignment operator (stores a value in a variable).

  9. Name the three fundamental control structures in structured programming.

    Sequence, Selection (decision), and Iteration (loop).

  10. What is the key difference between a while loop and a do-while loop?

    A while loop checks the condition before executing the body (may run 0 times); a do-while loop checks after, so the body always executes at least once.

  11. What is the difference between 'break' and 'continue' statements?

    'break' exits the loop entirely; 'continue' skips the rest of the current iteration and proceeds to the next iteration.

  12. When is a for loop preferred over a while loop?

    A for loop is preferred when the number of iterations is known in advance (definite iteration); while is used for indefinite iteration based on a condition.

  13. What is the difference between call by value and call by reference?

    Call by value passes a copy of the argument (changes don't affect the original); call by reference passes the address, so the function can modify the original variable.

  14. What is recursion and what two essential parts must every recursive function have?

    Recursion is when a function calls itself to solve smaller subproblems. It must have a base case (stopping condition) and a recursive case (call to itself on a smaller input).

  15. What is the time and space complexity issue with naive recursion, and how can it be improved?

    Naive recursion can have exponential time and uses O(n) stack space. It can be improved with memoization, dynamic programming, or tail recursion.

  16. What is the difference between an iterative and a recursive solution?

    Iteration uses loops and constant stack space; recursion uses self-calls and consumes stack memory per call, often clearer but with overhead and risk of stack overflow.

  17. How is an element accessed in an array, and what is the time complexity of access by index?

    By its index (offset from base address); access by index is O(1) (constant time) because of contiguous memory allocation.

  18. What is a stack and what principle does it follow? Name its two main operations.

    A stack is a linear data structure following LIFO (Last In, First Out). Main operations: push (insert) and pop (remove); also peek/top.

  19. What is a queue and what principle does it follow? Name its main operations.

    A queue is a linear structure following FIFO (First In, First Out). Operations: enqueue (insert at rear) and dequeue (remove from front).

  20. What is a circular queue and why is it used?

    A queue where the last position connects back to the first, forming a circle. It is used to efficiently reuse empty spaces left by dequeued elements in an array implementation.

Show the other 53 Computer Science (Subject Specialist Portion) flashcards
  1. What is the difference between a stack and a queue?

    A stack is LIFO (add and remove from the same end/top); a queue is FIFO (add at rear, remove from front).

  2. What is a linked list and what are its advantages over arrays?

    A linear collection of nodes where each node holds data and a pointer to the next. Advantages: dynamic size and O(1) insertion/deletion without shifting elements.

  3. Differentiate between a singly linked list, doubly linked list, and circular linked list.

    Singly: each node points to the next only. Doubly: each node has pointers to both next and previous. Circular: the last node points back to the first node.

  4. What is a binary tree and a binary search tree (BST)?

    A binary tree is a tree where each node has at most two children. A BST is a binary tree where the left subtree holds smaller values and the right subtree holds larger values than the node.

  5. Name the three depth-first tree traversal orders and the visiting sequence of each.

    Inorder (Left, Root, Right), Preorder (Root, Left, Right), and Postorder (Left, Right, Root).

  6. What is a graph, and how do an undirected and a directed graph differ?

    A graph is a set of vertices connected by edges. In an undirected graph edges have no direction; in a directed graph (digraph) edges have a direction (from one vertex to another).

  7. What are the two common ways to represent a graph, and their space costs?

    Adjacency matrix (O(V^2) space, fast edge lookup) and adjacency list (O(V+E) space, efficient for sparse graphs).

  8. Compare BFS and DFS graph traversals.

    BFS (Breadth-First Search) explores level by level using a queue; DFS (Depth-First Search) explores as deep as possible using a stack or recursion.

  9. How does linear search work and what is its time complexity?

    It checks each element sequentially until the target is found or the list ends. Time complexity is O(n); works on unsorted data.

  10. How does binary search work, what is its precondition, and its time complexity?

    It repeatedly halves a sorted array, comparing the target with the middle element. Precondition: the array must be sorted. Time complexity is O(log n).

  11. State the best, average, and worst-case time complexity of Bubble Sort.

    Best: O(n) (already sorted, with optimization); Average and Worst: O(n^2). Space: O(1).

  12. State the average and worst-case time complexity of Quick Sort, and when the worst case occurs.

    Average: O(n log n); Worst: O(n^2), which occurs with poor pivot choice (e.g., already sorted data with the first/last element as pivot).

  13. What is the time complexity of Merge Sort in all cases, and is it stable?

    O(n log n) in best, average, and worst cases; it is stable. Space complexity is O(n).

  14. Compare Selection Sort and Insertion Sort.

    Selection Sort repeatedly selects the minimum and places it in order (O(n^2), not stable, fewer swaps). Insertion Sort builds the sorted list by inserting each element into its correct position (O(n^2), stable, fast for nearly sorted data).

  15. What is Big-O notation?

    An asymptotic notation describing the upper bound (worst-case growth rate) of an algorithm's running time or space as the input size grows.

  16. Order these complexities from fastest to slowest growth: O(n^2), O(1), O(n log n), O(log n), O(n), O(2^n).

    O(1) < O(log n) < O(n) < O(n log n) < O(n^2) < O(2^n).

  17. Differentiate Big-O, Big-Omega (Ω), and Big-Theta (Θ).

    Big-O is the upper bound (worst case), Big-Omega is the lower bound (best case), and Big-Theta is the tight bound (both upper and lower).

  18. In OOP, what is the difference between a class and an object?

    A class is a blueprint/template defining attributes and methods; an object is a concrete instance of a class with actual values in memory.

  19. What is a constructor and a destructor?

    A constructor is a special method automatically called when an object is created to initialize it; a destructor is called when an object is destroyed to release resources.

  20. What is inheritance in OOP and what is its main benefit?

    A mechanism where a child (derived) class acquires the properties and methods of a parent (base) class. Main benefit: code reusability and establishing an is-a relationship.

  21. What is polymorphism, and what are its two main types?

    Polymorphism means 'many forms' - the ability of one interface to behave differently. Types: Compile-time (static, via method/operator overloading) and Run-time (dynamic, via method overriding/virtual functions).

  22. What is the difference between method overloading and method overriding?

    Overloading: same method name with different parameter lists in the same class (compile-time). Overriding: redefining a parent class method in a child class with the same signature (run-time).

  23. What is encapsulation in OOP?

    The bundling of data (attributes) and the methods that operate on them into a single unit (class), and restricting direct access to internal data using access modifiers (data hiding).

  24. What is abstraction, and how does it differ from encapsulation?

    Abstraction hides implementation complexity and shows only essential features (the 'what'). Encapsulation hides data by wrapping it with methods (the 'how' is protected). Abstraction is design-level; encapsulation is implementation-level.

  25. Name the common access specifiers in OOP and their visibility.

    Public (accessible everywhere), Private (accessible only within the class), and Protected (accessible within the class and its derived classes).

  26. What is a DBMS and what are its key advantages over file systems?

    A Database Management System is software to define, store, manage, and query data. Advantages: reduced data redundancy, data integrity, security, concurrent access, and backup/recovery.

  27. What are the three levels of the ANSI-SPARC database schema architecture?

    Internal (physical) level, Conceptual (logical) level, and External (view) level - providing physical and logical data independence.

  28. Name three database data models.

    Hierarchical model, Network model, and Relational model (also Object-oriented and Entity-Relationship models).

  29. In the relational model, define: relation, tuple, attribute, and degree.

    Relation = a table; Tuple = a row/record; Attribute = a column/field; Degree = the number of attributes (columns) in a relation.

  30. Differentiate between a primary key, a candidate key, and a foreign key.

    A candidate key uniquely identifies a tuple; the primary key is the chosen candidate key (unique, non-null); a foreign key is an attribute referencing the primary key of another table to enforce referential integrity.

  31. In an ER diagram, what shapes represent an entity, an attribute, and a relationship?

    Entity = rectangle; Attribute = ellipse/oval; Relationship = diamond.

  32. What are the three types of cardinality in ER relationships?

    One-to-One (1:1), One-to-Many (1:N), and Many-to-Many (M:N).

  33. Differentiate the SQL commands DDL, DML, and DCL with examples.

    DDL (Data Definition): CREATE, ALTER, DROP. DML (Data Manipulation): SELECT, INSERT, UPDATE, DELETE. DCL (Data Control): GRANT, REVOKE.

  34. What is the difference between WHERE and HAVING clauses in SQL?

    WHERE filters individual rows before grouping; HAVING filters groups after GROUP BY (used with aggregate functions like SUM, COUNT).

  35. Differentiate INNER JOIN, LEFT JOIN, and FULL OUTER JOIN.

    INNER JOIN returns only matching rows from both tables; LEFT JOIN returns all rows from the left table plus matches; FULL OUTER JOIN returns all rows from both tables, with NULLs where no match exists.

  36. What is normalization and why is it performed?

    Normalization is the process of organizing data to reduce redundancy and eliminate insertion, update, and deletion anomalies by decomposing tables into well-structured relations.

  37. State the requirements of 1NF, 2NF, and 3NF.

    1NF: atomic (indivisible) values, no repeating groups. 2NF: 1NF plus no partial dependency (non-key attributes fully depend on the whole primary key). 3NF: 2NF plus no transitive dependency (non-key attributes don't depend on other non-key attributes).

  38. What is BCNF (Boyce-Codd Normal Form)?

    A stronger version of 3NF where for every non-trivial functional dependency X -> Y, X must be a superkey. It removes anomalies that 3NF cannot.

  39. What is a process in an operating system, and how does it differ from a program?

    A process is a program in execution, with its own state, memory, and resources. A program is a passive set of instructions on disk; a process is its active, running instance.

  40. Name the states in a typical process life cycle.

    New, Ready, Running, Waiting (Blocked), and Terminated.

  41. What is the difference between preemptive and non-preemptive scheduling?

    In preemptive scheduling the CPU can be taken from a running process (e.g., Round Robin, SRTF); in non-preemptive scheduling a process keeps the CPU until it completes or blocks (e.g., FCFS, non-preemptive SJF).

  42. Define turnaround time and waiting time in CPU scheduling.

    Turnaround time = completion time minus arrival time (total time in system). Waiting time = turnaround time minus burst (execution) time (time spent waiting in the ready queue).

  43. What scheduling problem does the Round Robin algorithm solve, and what key parameter does it use?

    It provides fair, time-shared CPU allocation to prevent starvation. Its key parameter is the time quantum (time slice) given to each process in turn.

  44. What is the difference between logical and physical address space?

    Logical (virtual) address is generated by the CPU as seen by a process; physical address is the actual location in main memory. The MMU maps logical to physical addresses.

  45. What is paging and what problem does it solve?

    Paging divides logical memory into fixed-size pages and physical memory into frames, mapped via a page table. It eliminates external fragmentation and allows non-contiguous allocation.

  46. Differentiate internal fragmentation from external fragmentation.

    Internal fragmentation is unused space within an allocated block (e.g., partial page). External fragmentation is unused space scattered between allocated blocks, too small to use.

  47. What is virtual memory and what technique commonly implements it?

    Virtual memory lets programs use more memory than physically available by keeping only needed parts in RAM. It is commonly implemented using demand paging (loading pages from disk only when needed).

  48. What is a page fault?

    An interrupt that occurs when a program accesses a page that is mapped in virtual memory but not currently loaded in physical memory, requiring the OS to fetch it from disk.

  49. What is a deadlock, and what are the four Coffman necessary conditions for it to occur?

    A deadlock is when a set of processes are blocked, each holding a resource and waiting for another held by another. Conditions: Mutual Exclusion, Hold and Wait, No Preemption, and Circular Wait.

  50. Name the strategies for handling deadlocks.

    Deadlock Prevention, Deadlock Avoidance (e.g., Banker's Algorithm), Deadlock Detection and Recovery, and Ignoring the problem (Ostrich algorithm).

  51. What is the critical section problem, and what three requirements must a solution satisfy?

    The critical section is the code segment accessing shared resources. A valid solution must ensure Mutual Exclusion, Progress, and Bounded Waiting.

  52. What is a semaphore, and what are its two atomic operations?

    A semaphore is an integer variable used for process synchronization. Its two atomic operations are wait/P (decrement) and signal/V (increment).

  53. What is the difference between a mutex and a semaphore?

    A mutex is a locking mechanism allowing only one thread into a critical section (ownership-based, binary). A semaphore is a signaling mechanism that can allow multiple threads (counting) and has no ownership.

PPSC Lecturer Test Computer Science (Subject Specialist Portion) FAQ

What is in the PPSC Lecturer Test Computer Science (Subject Specialist Portion) syllabus?

PPSC Lecturer Test Computer Science (Subject Specialist Portion) is split into 8 chapters: Programming Fundamentals, Data Structures and Algorithms, Object-Oriented Programming, Database Systems, Operating Systems, Computer Networks, Digital Logic and Computer Architecture and Software Engineering. Together they contain 30 topics.

How many chapters are in PPSC Lecturer Test Computer Science (Subject Specialist Portion)?

8 chapters, containing 30 topics. The largest chapter is Programming Fundamentals, with 4 topics.

Are there flashcards for PPSC Lecturer Test Computer Science (Subject Specialist Portion)?

Yes — a 73-card Computer Science (Subject Specialist Portion) deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.