ShareYourGroupShareYourGroupInterview

Software developer (fresher) interview questions with answers

A fresher's software interview usually has an online test, one or two technical rounds and an HR round. In the technical rounds you will be asked about your projects in detail, core computer science, and to write or reason through small programs. The answers below show the level of clarity expected; the interviewer will go deeper where you seem confident.

What interviewers look for

12 questions with model answers

1. Explain the four pillars of object-oriented programming.

Encapsulation is keeping data and the methods that work on it together in a class and hiding the internal details. Abstraction is showing only what is necessary, through interfaces or abstract classes. Inheritance lets a class reuse and extend another class. Polymorphism lets the same method name behave differently: by overloading at compile time, or by overriding at run time. In my booking app, a Booking class kept its validation inside it, which is encapsulation.

2. What is the difference between an array and a linked list?

An array stores elements in adjacent memory, so any element can be reached directly by index in constant time, but inserting or deleting in the middle needs shifting. A linked list stores elements in nodes that point to the next, so insertion and deletion at a known position are quick, but reaching the nth element means walking the list. Arrays suit frequent reading; linked lists suit frequent insertion and deletion.

3. What is the difference between a stack and a queue?

A stack is last in, first out: you add and remove at the same end, like a pile of plates. A queue is first in, first out: you add at the rear and remove from the front, like a line at a counter. Function calls use a stack; a print spooler uses a queue.

4. What is a primary key and a foreign key?

A primary key uniquely identifies each row of a table and cannot be null. A foreign key is a column in one table that refers to the primary key of another, and keeps the two tables consistent. In my project, student_id was the primary key of the students table and a foreign key in the bookings table.

5. Write a query to find the second highest salary from an Employee table.

One way is: SELECT MAX(salary) FROM Employee WHERE salary < (SELECT MAX(salary) FROM Employee). The inner query finds the highest salary and the outer query finds the highest among the rest. If there is no second value it returns null. Interviewers often then ask for the nth highest, which can be done by ranking the distinct salaries.

6. What is the difference between INNER JOIN and LEFT JOIN?

An inner join returns only the rows that have a match in both tables. A left join returns all rows from the left table, with nulls where the right table has no match. To list all students including those with no bookings, I would use a left join from students to bookings.

7. What is the time complexity of binary search, and when can it be used?

It is O(log n), because each comparison halves the remaining range. It can be used only when the data is sorted and can be accessed by index.

8. Tell me about your project. What was the hardest part?

I built a web app for booking seats in the college reading room, using React, Node.js and PostgreSQL. The hardest part was preventing two students from booking the same seat at the same time. At first I checked availability and then inserted, and two requests could both pass the check. I fixed it by adding a unique constraint on seat and time slot in the database and handling the error, so the database itself refuses the second booking.

9. How do you debug a program that gives a wrong result?

First I reproduce the problem with the smallest input that shows it. Then I check my assumptions one by one, printing or inspecting values at each step, or use the debugger to step through. I narrow down where the actual value first differs from the expected one. Once I find the cause, I fix it and test with the failing case and some edge cases.

10. What is the difference between a process and a thread?

A process is a program in execution with its own memory space. A thread is a unit of execution inside a process; threads of the same process share its memory. Creating and switching threads is lighter than for processes, but shared memory means threads need care to avoid conflicts.

11. What is version control and why is it used?

Version control records changes to code over time, so that you can see who changed what, go back to an earlier version, and let several people work on the same project without overwriting each other. I use Git: I commit small changes with clear messages and work on a branch for each feature.

12. You are given a problem you have never seen. How do you start?

I repeat the problem in my own words and ask about anything unclear: the size of input, special cases. I work one small example by hand. Then I describe a simple solution first, even if it is slow, and look for a better one. I talk through my thinking so that the interviewer can guide me if I go wrong.

Model answers are examples. Use your own experience and figures, and for anything that changes (rates, limits, rules) check the official source before the interview.

How to prepare

Do not forget the common questions

Every one of these interviews also includes the general questions. Prepare them too:

Practise aloud with a timer

Other jobs

Guides

Model answers are examples. They show the shape of a good answer, reviewed in November 2026. Use your own facts: an answer copied word for word will not survive a follow-up question. Employers differ, and nothing here promises selection. Names in the examples are invented.