🇵🇰 PPSC Lecturer Test · flashcards
PPSC Lecturer Test Computer Science (Subject Specialist Portion) Flashcards
73 question-and-answer cards covering Computer Science (Subject Specialist Portion) as it is examined in PPSC Lecturer Test. 24 of them are printed below, taken from across the deck — no signup, no paywall on the preview.
24 sample cards from the Computer Science (Subject Specialist Portion) deck
Sampled from the end of the deck, so these are different cards from the ones shown on the syllabus page.
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.
In an ER diagram, what shapes represent an entity, an attribute, and a relationship?
Entity = rectangle; Attribute = ellipse/oval; Relationship = diamond.
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).
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.
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).
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.
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.
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).
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.
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.
Name the states in a typical process life cycle.
New, Ready, Running, Waiting (Blocked), and Terminated.
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).
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).
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.
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.
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.
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.
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).
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.
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.
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).
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.
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).
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.
What this deck covers
The Computer Science (Subject Specialist Portion) deck follows the PPSC Lecturer Test Computer Science (Subject Specialist Portion) syllabus — 8 chapters and 30 topics — so questions land on material that is genuinely examinable rather than trivia around it. That works out to roughly 9.1 cards per chapter.
Answers are written to be recallable, not just readable — averaging about 162 characters, which is long enough to carry the reasoning and short enough to say out loud.
A deck like this earns its keep on the second and third pass. Read the syllabus first so you know the shape of the subject, then use the cards to find the specific facts that have not stuck.
Computer Science (Subject Specialist Portion) flashcards FAQ
How many Computer Science (Subject Specialist Portion) flashcards are in this PPSC Lecturer Test deck?
73 cards. This page previews 24 of them, sampled evenly across the deck so you can judge the difficulty before installing anything.
Are these PPSC Lecturer Test flashcards free?
Yes. The preview here is free to read with no signup, and the full 73-card deck is free inside the Examius app.
What do the Computer Science (Subject Specialist Portion) cards cover?
They follow the PPSC Lecturer Test Computer Science (Subject Specialist Portion) syllabus — 8 chapters and 30 topics — so the questions track what is actually examinable.
How should I use these flashcards?
Read the syllabus first so you know the shape of the subject, then drill the deck. Examius schedules each card with spaced repetition, so cards you keep missing come back sooner and ones you know drift further apart.