Job hunt · 6 min read
What they actually ask in a fresher interview in Pakistan
The real question bank — coding, OOP, DSA, databases, SE, OS, and the HR round.
This is the list I’d revise from. Nothing exotic — the same questions come back again and again at Pakistani software houses.
Coding (whiteboard or screen-share)
- Find the 2nd maximum in an array, then optimise the time complexity
- Move elements from one stack to another without a third stack
- Count trailing zeros in a factorial without computing the factorial
- Reverse a singly linked list
- Swap two numbers without a third variable
- Print the Fibonacci series recursively
OOP — the round most freshers lose
- The four pillars: abstraction, encapsulation, inheritance, polymorphism (know a real example of each)
- Aggregation vs composition: the child can live without the parent (aggregation) vs cannot (composition)
- The diamond problem, why Java avoids it, and the scope resolution operator (
::) in C++ - Overloading (compile-time) vs overriding (run-time)
- Operator overloading, and which operators you cannot overload
- Static variables: when they initialise, where they live in memory
- Constructor and destructor call order
- Abstract class vs interface
- Stack vs heap: which variables go where
- Access modifiers, wrapper classes, early vs late binding
- Memory leak vs overflow, dangling pointers, mutable vs immutable types
Data structures
Array vs linked list · stack vs queue · tree vs graph · cycle detection · recursion (factorial is the standard warm-up) · sorting algorithms with complexities · binary search · balanced BST from a sorted array · string basics (reverse, palindrome, character frequency) · BFS and DFS.
Databases
Types of keys · TRUNCATE vs DELETE · indexing and its cost · SQL injection · how to store passwords · joins (the most asked) · joins vs subqueries · transactions · unique vs primary key · GROUP BY and HAVING · normalisation to 3NF · deletion anomalies · can a foreign key be null.
Software engineering & OS
SDLC and its models · coupling vs cohesion · GoF design patterns · requirement gathering and prototyping · TCP vs UDP · critical path · deadlock and how to prevent it.
Plus the scenario ones: a teammate didn’t deliver and the project failed — what do you tell your manager? and the code was deleted two days before delivery — how do you tell the client? They’re testing ownership, not blame.
HR round
Tell me about yourself · strengths and weaknesses · why you · why this company · salary expectations · your favourite project · why computer science.
Write your answers down before the interview. The people who get offers aren’t smarter — they’ve said the words out loud once already.