If you're a fresher, the technical interview at most companies is built on four subjects: object-oriented programming, databases and SQL, operating systems and computer networks. Service companies like TCS, Infosys, Wipro, Accenture and Cognizant lean on them heavily, and product companies use them to check that your foundations are solid before the harder rounds.
The good news is that the question pool is small and well known. The bad news is that interviewers can tell instantly whether you understand a concept or memorised a definition. This guide lists what to cover in each subject, how deep to go, where to learn it, and how to practise so your answers sound like understanding.
How deep do you need to go?
| You are | What's expected |
|---|---|
| A fresher applying to a service company's base tier | Clear definitions, one example each, simple SQL queries, and the ability to connect concepts to your project. |
| A fresher aiming for a higher tier or a product company | All of the above, plus the "why": trade-offs, what happens under the hood, and follow-up questions two levels deep. |
| Experienced (2+ years) | Fewer textbook questions. Expect them through your work: "how did you index that table?", "why did your service run out of threads?" |
The single best habit for all three: for every concept, have one example from code you wrote or a system you used.
1. Object-oriented programming
OOP comes up in almost every fresher interview, usually through your main language (Java, C++, Python or C#).
Must know:
- The four pillars: encapsulation, abstraction, inheritance, polymorphism, each with a small code example.
- Classes versus objects, constructors (default, parameterised, copy in C++),
this,staticmembers. - Overloading versus overriding, and compile-time versus runtime polymorphism.
- Abstract class versus interface, and when you'd pick each.
- Access modifiers, and why fields are usually private.
- Composition versus inheritance ("has-a" versus "is-a"), and why composition is often preferred.
- Exceptions: checked versus unchecked (Java),
try/catch/finally, custom exceptions.
Go deeper for higher tiers: SOLID principles, a few design patterns (Singleton, Factory, Strategy, Observer), and the diamond problem with multiple inheritance. The LLD roadmap covers these.
Typical questions: "Explain polymorphism with an example from your project." "Why can't we create an object of an abstract class?" "What happens if a subclass doesn't override an abstract method?"
2. DBMS and SQL
Databases are the subject most likely to decide a fresher interview, because almost every project uses one and SQL can be tested live.
Must know:
- Keys: primary, foreign, candidate, composite, unique.
- Normalisation: 1NF, 2NF, 3NF and BCNF, with an example of a badly designed table and how to fix it.
- ACID properties and what a transaction is.
- Joins: inner, left, right, full, self join. Draw them if it helps.
- Indexes: what they are, why they speed up reads, why they slow down writes, and when an index isn't used.
GROUP BYwithHAVING, aggregate functions, subqueries,DISTINCT,ORDER BYandLIMIT.- DELETE versus TRUNCATE versus DROP. Views. Stored procedures and triggers at a basic level.
SQL you should be able to write on the spot:
-- Second-highest salary
SELECT MAX(salary) FROM employees
WHERE salary < (SELECT MAX(salary) FROM employees);
-- Employees earning more than their department's average
SELECT e.name, e.salary, e.dept_id
FROM employees e
WHERE e.salary > (SELECT AVG(salary) FROM employees WHERE dept_id = e.dept_id);
-- Departments with more than five employees
SELECT dept_id, COUNT(*) AS headcount
FROM employees
GROUP BY dept_id
HAVING COUNT(*) > 5;
-- Duplicate emails
SELECT email, COUNT(*) FROM users GROUP BY email HAVING COUNT(*) > 1;Practise 20 to 30 queries like these until you can write them without thinking. Also be ready for "the Nth highest salary" using DENSE_RANK() or LIMIT ... OFFSET.
Go deeper: isolation levels and the anomalies they prevent, how a B-tree index works, query plans with EXPLAIN, and SQL versus NoSQL trade-offs.
Best free material: Use The Index, Luke for indexing (the topic that separates candidates) and CMU 15-445 lectures if you want real depth.
3. Operating systems
Must know:
- Process versus thread, and why threads are cheaper. Our processes and threads guide has runnable code in four languages.
- Process states and the context switch.
- CPU scheduling: FCFS, SJF, round robin, priority. Be able to work out average waiting time for a small example.
- Deadlock: the four necessary conditions, and how to prevent or avoid it (banker's algorithm at a high level).
- Mutex versus semaphore, critical sections, race conditions, the producer-consumer problem.
- Memory: paging, segmentation, virtual memory, page faults, thrashing, and page replacement (FIFO, LRU, optimal).
- Kernel versus user mode, system calls, what an interrupt is.
Typical questions: "What's the difference between a process and a thread?" "What is a deadlock and how do you avoid it?" "What happens when a page fault occurs?" "Why does a program with too many threads slow down?"
Best free material: Operating Systems: Three Easy Pieces, a free book that's clearer than most textbooks, and The Little Book of Semaphores for concurrency.
4. Computer networks
Must know:
- The OSI model versus TCP/IP, and what happens at each layer (with one protocol per layer).
- TCP versus UDP: reliability, ordering, the three-way handshake, and when you'd use UDP (video calls, games, DNS).
- What happens when you type a URL and press Enter: DNS lookup, TCP connection, TLS handshake, HTTP request, server response, rendering. This is the single most common networks question.
- HTTP: methods, status codes (200, 201, 301, 400, 401, 403, 404, 500), headers, cookies, HTTPS and why it's secure.
- IP addressing, subnets at a basic level, public versus private IPs, NAT, DHCP.
- What a router, switch, load balancer and proxy do.
Go deeper: REST API design, WebSockets versus polling, CDNs, and load balancing.
Best free material: High Performance Browser Networking explains TCP, TLS and HTTP from the angle interviewers care about, and Beej's Guide to Network Programming if you want to write socket code.
5. The two subjects nobody lists but everyone asks
Your project. Expect to spend half the interview on it. Know its architecture, its database schema, why you chose the stack, what you'd do differently, and which part was yours. Read explaining your projects.
Your language. Whatever you put first on your CV, be ready for: data types, strings and immutability, collections (and which to use when), exceptions, and memory basics (stack versus heap, garbage collection in Java or Python, pointers in C++).
A three-week plan
| Week | Focus | Done when |
|---|---|---|
| 1 | OOP in your language, plus your project explanation | You can explain each pillar with an example from your own code, and give your project pitch in under two minutes. |
| 2 | DBMS and 25 SQL queries | You can normalise a messy table and write any of the queries above without notes. |
| 3 | Operating systems and networks | You can answer "process versus thread" and "what happens when you type a URL" with follow-ups. |
How to practise
Fundamentals fail in interviews for one reason: people read them but never say them. Two things fix that.
- Explain each topic out loud as if to a friend, without notes, in under a minute. If you stall, that's the part to re-read.
- Do a mock technical round. The interviewer asks about your project and the basics behind it, then follows up when you're vague, exactly like the real thing. The report shows which subject cost you the most, so you know what to revise before the next one.