Get started
Interview guide

Technical interview questions for freshers, with answers

The core questions that come up again and again in fresher technical rounds, with short answers you can explain in your own words. Revise these and your own projects, and most rounds will feel familiar.

Updated

Fresher technical interviews in India, at service companies and product companies alike, test the same foundations: one programming language, object-oriented programming, data structures, databases, and a little operating systems and networking. The answers below are deliberately short. In the interview, give the short answer first, then an example, and stop; the interviewer will ask for more if they want it.

Object-oriented programming

What are the four pillars of OOP?

Encapsulation (keeping data and the methods that use it together, and hiding internal details), abstraction (showing only what the user of a class needs), inheritance (a class reusing and extending another class) and polymorphism (one interface, many forms, like a draw() method that behaves differently for a circle and a square).

What is the difference between a class and an object?

A class is a blueprint; an object is a thing built from it. Car is a class; your neighbour's red car is an object of that class, with its own colour and speed.

Overloading vs overriding?

Overloading is several methods with the same name but different parameters in the same class, decided at compile time. Overriding is a subclass giving its own version of a parent's method with the same signature, decided at run time.

Abstract class vs interface?

An abstract class can have both implemented and abstract methods and its own state; a class extends only one. An interface defines a contract that classes implement, and a class can implement many. Use an interface for "can do" (like Comparable) and an abstract class for a shared base with common code.

Data structures and algorithms

Array vs linked list?

An array stores elements next to each other in memory, so reading any index is fast, O(1), but inserting in the middle means shifting elements, O(n). A linked list stores nodes connected by pointers, so inserting or removing a node you already have is O(1), but reaching the k-th element takes O(k).

Stack vs queue?

A stack is last in, first out: the browser's back button and function calls use it. A queue is first in, first out: printer jobs and ticket counters work this way.

What is a hash map and why is lookup fast?

A hash map stores key-value pairs. A hash function turns the key into a bucket index, so finding a key is O(1) on average. When two keys land in the same bucket (a collision), the map keeps a small list or tree there.

What is time complexity? What is the complexity of binary search?

Time complexity describes how running time grows with the input size, written in Big-O. Binary search halves a sorted list at every step, so it takes O(log n): about 20 steps for a million items.

DBMS and SQL

Primary key vs foreign key?

A primary key uniquely identifies each row of a table and can't be empty. A foreign key is a column that refers to the primary key of another table, linking the two, like dept_id in an employees table pointing to the departments table.

What is normalisation?

Organising tables so each fact is stored once, to avoid duplicate data and update mistakes. In practice: 1NF (no repeating groups, one value per cell), 2NF (every column depends on the whole key) and 3NF (no column depends on another non-key column).

Explain the types of joins.

An inner join returns only rows that match in both tables. A left join returns every row from the left table, with matches from the right or NULL. A right join is the mirror image, and a full outer join returns everything from both. For example, every employee with their department name, even employees without a department:

SELECT e.name, d.dept_name
FROM employees e
LEFT JOIN departments d ON d.id = e.dept_id;

Find the second highest salary.

One of the most asked SQL questions. A simple version that works in every database:

SELECT MAX(salary) AS second_highest
FROM employees
WHERE salary < (SELECT MAX(salary) FROM employees);

Be ready to mention the alternative with DENSE_RANK() if the interviewer asks for the n-th highest.

Find duplicate rows.

SELECT email, COUNT(*) AS times
FROM users
GROUP BY email
HAVING COUNT(*) > 1;

DELETE vs TRUNCATE vs DROP?

DELETE removes chosen rows and can be rolled back inside a transaction. TRUNCATE removes all rows quickly and keeps the table. DROP removes the table itself, structure and all.

What is an index?

A separate structure, usually a B-tree, that lets the database find rows without scanning the whole table, like the index at the back of a book. It speeds up reads but makes inserts and updates slightly slower.

Operating systems

Process vs thread?

A process is a running program with its own memory. Threads are smaller units of work inside a process that share its memory. Opening two Chrome windows can start separate processes; one tab loading images and scripts at the same time uses several threads.

What is a deadlock?

Two or more processes each waiting for a resource the other holds, so none can move. It needs four conditions together: mutual exclusion, hold and wait, no pre-emption and circular wait. Breaking any one of them prevents it.

What is virtual memory?

A technique that lets programs use more memory than the physical RAM by keeping some pages on disk and loading them when needed (paging). If the system swaps pages too often, it slows down; that is called thrashing.

Computer networks

TCP vs UDP?

TCP is connection-based and reliable: data arrives complete and in order, used for web pages and email. UDP is connectionless and faster but doesn't guarantee delivery, used for video calls and online games where speed matters more than every packet.

What happens when you type a URL in the browser?

The browser finds the server's IP address through DNS, opens a TCP connection (with a TLS handshake for HTTPS), sends an HTTP request, the server returns a response, and the browser renders the HTML, CSS and JavaScript, fetching images and other files as it goes.

HTTP vs HTTPS?

HTTPS is HTTP over an encrypted TLS connection. It keeps data private, protects it from being changed on the way, and proves the website is who it claims to be through a certificate.

Coding warm-ups

Many first rounds include one or two small programs. Write clean code, say your approach before you start, and mention the time complexity at the end. Examples in Python:

Reverse a string and check for a palindrome

def reverse_string(s):
    return s[::-1]

def is_palindrome(s):
    cleaned = "".join(ch.lower() for ch in s if ch.isalnum())
    return cleaned == cleaned[::-1]

Find the first duplicate in a list

Using a set gives O(n) time instead of comparing every pair, which would be O(n²).

def first_duplicate(nums):
    seen = set()
    for n in nums:
        if n in seen:
            return n
        seen.add(n)
    return None   # no duplicate

The n-th Fibonacci number

The loop version avoids the exponential time of the simple recursive one.

def fibonacci(n):
    a, b = 0, 1
    for _ in range(n):
        a, b = b, a + b
    return a   # O(n) time, O(1) space

When you don't know the answer

Every fresher meets a question they can't answer. What happens next matters more than the gap itself:

  • Be honest: "I haven't worked with that yet."
  • Connect it to what you know: "but I know it's related to X, and I would approach it like this..."
  • Think out loud on problem questions. Interviewers often help a candidate who is reasoning clearly.
  • Never invent an answer. A confident wrong answer hurts more than an honest "I'm not sure".

Make it stick

Reading answers is not enough; you need to explain them out loud. Pick one topic a day, explain each question as if to a friend, and then try a technical mock interview where the AI interviewer asks questions from your job description. Preparing for a drive? Our campus placement plan puts all of this into two weeks.

On the day, Myna can also help on the call itself: it explains coding problems from a screenshot and suggests answers to concept questions in plain words. See the plans and the free trial.

FAQ

Common questions

About the technical round itself.

Which programming language should I use in a technical interview?

The one you know best. Most companies let freshers choose between Java, Python and C++. Knowing one language well is better than knowing three a little.

What if I don't know the answer?

Say so honestly, then share what you do know or how you would find out. Interviewers value clear thinking and honesty more than a confident wrong answer.

Do freshers get asked about projects in technical rounds?

Almost always. Expect questions on what you built, why you chose a tool, what was hard and what you would change. Revise your own projects as carefully as any subject.

Walk into your next interview prepared.

Start with the free trial: Myna on a real call and a mock interview, no payment needed.

Windows 10 and 11 · Prices include GST · No auto-renew