You have revised the difference between an abstract class and an interface four times. The interviewer asks it, and you recite the answer perfectly. Then they lean back and say, "Okay. So when would you pick one over the other in your own project?" And the sentence you memorised has nothing more to give.
That second question is the real interview. Most fresher IT interviews are not testing whether you have read the definition. They are testing whether you understand it well enough to use it, and the only way they can check that is by asking one more question.
The short answer
Interview questions for freshers in IT jobs are predictable: technical questions on OOP, one programming language, DBMS and SQL, operating systems, networks and basic data structures, then your own project and a few HR closers. What is not predictable is the follow-up. So for every question below, the model answer explains why the thing works the way it does, and then names the follow-up you are likely to hear. Learn the reasoning, not the wording, and say each answer out loud at least once before the interview.
If you want the wider plan around this list, start with our interview preparation guide for freshers. This article is the question bank.
OOP questions
1. What are the four pillars of OOP?
Encapsulation, abstraction, inheritance and polymorphism. Then give one line on why each exists: encapsulation keeps an object's data from being changed in ways it did not allow, abstraction lets callers use something without knowing how it works, inheritance reuses behaviour, and polymorphism lets one call do the right thing for different types.
Likely follow-up: "What is the difference between encapsulation and abstraction?" Encapsulation is about hiding data (private fields, controlled setters). Abstraction is about hiding complexity (you call list.sort() without caring which algorithm runs).
2. What is the difference between method overloading and overriding?
Overloading is the same method name with different parameters in the same class, and the compiler picks which one to call, so it is compile-time polymorphism. Overriding is a subclass replacing a parent's method with the same signature, and the choice happens at runtime based on the actual object, so it is runtime polymorphism.
Likely follow-up: "Can you override a static method in Java?" No. A static method with the same signature in a subclass hides the parent's method; it does not override it, because static methods belong to the class, not the object.
3. Abstract class or interface: when do you use which?
Use an interface when you are describing a capability that unrelated classes can share, such as Comparable or Runnable. Use an abstract class when related classes share actual state or code and you want to put it in one place. A class can implement many interfaces but extend only one class, which is often the deciding factor.
Likely follow-up: "Interfaces can have method bodies since Java 8, so what is the difference now?" Interfaces still cannot hold instance state (fields are implicitly static final), and they cannot have constructors.
Java and Python questions
Pick the language on your resume and know it properly.
4. What is the difference between == and equals() in Java?
== compares references, meaning whether two variables point to the same object. equals() compares content, if the class overrides it. Two String objects with the same text can fail == and pass equals().
Likely follow-up: "Why must you override hashCode() when you override equals()?" Because hash-based collections like HashMap find the bucket using hashCode() first. If two equal objects return different hash codes, the map looks in the wrong bucket and never finds the match.
5. Why are Strings immutable in Java?
Because strings are shared. Java keeps a string pool so identical literals point to the same object, which is only safe if nobody can change it. Immutability also makes strings safe as HashMap keys and safe to share across threads without locking.
Likely follow-up: "So what do you use when building a string in a loop?" StringBuilder, because concatenating immutable strings creates a new object every time.
6. How does a HashMap work internally?
It is an array of buckets. The key's hashCode() decides the bucket, and if two keys land in the same bucket (a collision), they are stored together and told apart with equals(). In Java 8 and later, a bucket that grows large is converted from a linked list to a balanced tree, so the worst case improves from O(n) to O(log n). When the map fills past its load factor (0.75 by default), it resizes and rehashes.
7. Checked vs unchecked exceptions?
Checked exceptions, like IOException, must be caught or declared, because they describe things that can reasonably go wrong outside your control. Unchecked exceptions, subclasses of RuntimeException like NullPointerException, usually signal a bug in the code, so the compiler does not force you to handle them.
8. In Python, what is the difference between a list and a tuple?
A list is mutable, a tuple is not. Because a tuple cannot change, it can be hashed and used as a dictionary key, as long as everything inside it is hashable too, and signals a fixed record, such as a coordinate.
Likely follow-up: "What goes wrong with def add(item, items=[])?" The default list is created once, when the function is defined, so every call without an argument shares and mutates the same list. Use items=None and create the list inside.
DBMS and SQL questions
9. Primary key vs unique key?
Both prevent duplicates. A primary key also cannot be NULL, and a table has only one, because it is the row's identity and what other tables reference through foreign keys. A table can have several unique keys, and most databases allow NULLs in a unique column.
10. What is normalisation, and why would anyone denormalise?
Normalisation splits data so each fact is stored once, which prevents update anomalies: change a customer's address in one place and it is changed everywhere. The follow-up is the real test. You denormalise when reads vastly outnumber writes and the joins are getting expensive, accepting duplicated data in exchange for faster queries.
11. Explain INNER JOIN and LEFT JOIN.
An inner join returns only rows that have a match in both tables. A left join returns every row from the left table, with NULLs where the right table has no match.
Likely follow-up: "Find employees with no department." SELECT e.name FROM employees e LEFT JOIN departments d ON e.dept_id = d.id WHERE d.id IS NULL;
12. DELETE vs TRUNCATE vs DROP?
DELETE removes chosen rows (it takes a WHERE) and fires triggers. TRUNCATE empties the whole table quickly, without row-by-row logging, and in MySQL and SQL Server resets the auto-increment counter (PostgreSQL needs RESTART IDENTITY). DROP removes the table itself, structure and all. Whether TRUNCATE can be rolled back depends on the database: in MySQL it commits implicitly, in PostgreSQL it can be rolled back inside a transaction.
13. Write a query for the second-highest salary.
SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees); It finds the highest salary below the top one, and handles ties correctly.
Likely follow-up: "Now the Nth highest." Use a window function: rank salaries with DENSE_RANK() OVER (ORDER BY salary DESC) and filter for rank N. Prefer DENSE_RANK so ties do not skip numbers.
14. What is an index, and why not index every column?
An index is a separate sorted structure (usually a B-tree) that lets the database find rows without scanning the whole table, much like a book's index. You do not index everything because every insert, update and delete must also update every index, and indexes take storage. Index the columns you filter and join on.
15. What does ACID mean?
Atomicity (a transaction happens fully or not at all), consistency (it moves the database from one valid state to another), isolation (concurrent transactions do not see each other's half-finished work) and durability (once committed, it survives a crash). Anchor it with a bank transfer: the debit and credit both happen or neither does.
Operating system questions
16. Process vs thread?
A process is a running program with its own memory space. Threads live inside a process and share its memory. That sharing is why threads are cheaper to create and switch between, and also why they need synchronisation: two threads writing the same variable can corrupt it.
Likely follow-up: "What is a race condition?" When the result depends on the timing of threads accessing shared data, such as two threads both reading a counter as 5 and both writing 6.
17. What is a deadlock, and how do you prevent one?
Two or more processes each wait for a resource the other holds, so none can proceed. It needs four conditions together: mutual exclusion, hold and wait, no preemption, and circular wait. Break any one and deadlock cannot happen. The practical one to mention is circular wait: always acquire locks in the same fixed order.
Computer network questions
18. What happens when you type a URL into a browser?
The browser checks its caches, resolves the domain to an IP address through DNS, opens a connection to the server (TCP plus a TLS handshake for HTTPS; HTTP/3 uses QUIC over UDP instead), sends an HTTP request, receives a response, and renders the HTML, fetching CSS, scripts and images as it goes. Interviewers can stop you at any step and go deeper, so know one more sentence about each.
19. TCP vs UDP?
TCP is connection-based and guarantees ordered, complete delivery, retransmitting lost packets. UDP sends packets with no such guarantee, which makes it faster and lighter. Use TCP when every byte matters, such as web pages and file transfers. Use UDP when a late packet is useless anyway, such as live video calls and online games.
20. HTTP vs HTTPS?
HTTPS is HTTP over TLS. TLS encrypts the traffic so nobody on the network can read it, and the server's certificate proves you are talking to the real site rather than an impostor. Plain HTTP sends everything, passwords included, as readable text.
DSA basics
For the full list of structures worth knowing, see the data structures you must know. These are the questions that come up in the theory round.
21. Array vs linked list?
An array stores elements contiguously, so reading index i is O(1), but inserting in the middle means shifting everything after it. A linked list stores nodes connected by pointers, so inserting is O(1) once you are at the right node, but reaching the i-th element is O(n).
22. Stack vs queue, with a real use for each?
A stack is last-in, first-out: the browser's back button, undo, and the function call stack. A queue is first-in, first-out: print jobs, task scheduling, and breadth-first search.
23. Why does binary search need a sorted array, and what is its complexity?
Each step compares the middle element and discards the half that cannot contain the target, which only works if order tells you which half that is. Halving each time gives O(log n): a million elements need about 20 comparisons.
24. Is a hash table lookup really O(1)?
On average, yes. In the worst case, when many keys collide into one bucket, it degrades towards O(n) (Java 8+'s HashMap caps this at O(log n) by turning crowded buckets into trees, as in question 6). Saying "average O(1), worst case O(n), and here is why" is exactly the kind of answer that survives a follow-up. The coding round that follows is a different skill; our coding interview preparation guide for freshers covers it, and you can drill these in a DSA practice round.
Your project
For most freshers, this is where the interview is won or lost, because it is the one topic the interviewer cannot look up an answer to.
25. Walk me through your project.
Cover four things in about two minutes: the problem it solves, the stack and why you chose it, what you personally built, and one hard thing you solved. "We made an e-commerce site in MERN" says nothing. "I built the cart and checkout, and the hard part was keeping stock counts correct when two users bought the last item at once" gives the interviewer somewhere to go.
Likely follow-ups: "Why MongoDB and not MySQL?", "How did you handle authentication?", "What would break with 10,000 users?" If the honest answer is "the tutorial used it", say what you would weigh next time.
26. What would you change if you rebuilt it?
This tests whether you can look at your own work critically. Name something specific and technical: adding indexes, writing tests, moving secrets out of the code, validating input on the server instead of only the browser. "Nothing, it works fine" is the one wrong answer.
HR-style closers
These often arrive at the end of a technical round. For the full set, see HR interview questions for freshers.
27. Why should we hire you?
Connect one or two concrete things you have done to what the role needs. Not "I am a quick learner", but "I taught myself SQL for my project and wrote the reporting queries, and this role is heavy on data work."
28. Do you have any questions for us?
Always have one. Ask what a new joiner's first three months look like, or how code review works on the team.
What to do when the follow-up goes past what you know
It will happen at least once. Say what you do know, reason out loud towards the rest, and say plainly where your knowledge ends. We wrote about this in more detail in how to handle a question you don't know, and about the gap between knowing an answer and explaining it in why knowing the answer isn't enough.
The way to find out where your answers break is to have someone ask the second question. Read each answer above, close the page, and explain it out loud as if to an interviewer, then ask yourself "why?" once more. When you are ready for an interviewer who actually follows up, practise it out loud in a scored round on 99interview: Sia, our AI interviewer, asks one question at a time and follows up on what you actually said, and every round is scored on technical depth, problem solving, communication, behaviour and code quality, so you can see which of these areas still needs work.