80 Technical Interview Questions for Freshers (With Answers)

Ezitech profile photo

Ezitech

Careers & Internships article by Ezitech — 80 Technical Interview Questions for Freshers (With Answers)

Part of our guide hub: IT careers in Pakistan

These are 80 common technical interview questions for freshers applying for junior developer jobs and internships at software houses. They are grouped by stack, and each one has a short answer you can build on in your own words.

The bank covers JavaScript, React, Node.js, Laravel, Flutter, Python, SQL, Git and OOP basics, and AI. Start with your own stack, then do the SQL and basics sections, because those come up in almost every interview.

Jump to: HTML, CSS & JavaScript · React · Node.js · PHP & Laravel · Flutter · Python · SQL · Git, OOP & Basics · AI & ML

How to use this bank

Don’t memorise the answers. Interviewers ask a follow-up the moment an answer sounds recited, so read each answer, then say it out loud in your own words with an example from your own project.

  • Answer in three parts: what it is, when you would use it, and one example from something you built.
  • Say “I’m not sure, but I think…” when you don’t know. Reasoning out loud earns more credit than a confident wrong answer.
  • Practise the SQL and basics sections even if you are a frontend or mobile developer. They come up regardless of the role.

Want to know how the interview itself is structured? Read Technical Interview Preparation for Pakistani Software Houses. For HR questions like “introduce yourself”, see Internship Interview Questions in Pakistan.

HTML, CSS and JavaScript interview questions

Every web interview starts here, even for React or Node.js roles, because frameworks sit on top of these basics.

  1. What is the difference between let, const and var? var is function-scoped and hoisted with the value undefined. let and const are block-scoped and can’t be used before their declaration. const can’t be reassigned, but an object it holds can still be changed.
  2. What is the difference between == and ===? == converts types before comparing, so "5" == 5 is true. === compares both type and value with no conversion. Use === by default.
  3. What is a closure? A function that remembers the variables from the scope where it was created, even after that scope has finished running. A counter function returned from another function keeps its own private count this way.
  4. How does the event loop work? JavaScript runs one piece of code at a time on a single thread. Async callbacks wait in queues, and when the call stack is empty the event loop runs promise callbacks first, then the next queued task such as a setTimeout.
  5. What is the difference between promises and async/await? async/await is syntax built on promises. await pauses the function until the promise settles, so async code reads top to bottom, and errors are caught with try/catch.
  6. What is event delegation? Putting one listener on a parent element instead of one on every child, then using event.target to see which child was clicked. It works because events bubble up, and it also covers elements added later.
  7. What is the CSS box model? Every element is made of content, padding, border and margin. box-sizing: border-box makes the width include padding and border, which makes layouts easier to predict.
  8. When do you use Flexbox and when Grid? Flexbox lays items out in one direction, a row or a column. Grid handles rows and columns together. Use Flexbox for navbars and toolbars, and Grid for page layouts and card grids.
  9. What is semantic HTML and why does it matter? Using tags for their meaning, such as header, nav, main and button, instead of div everywhere. It helps screen readers, search engines and the next developer who reads your code.
  10. How do you make a website responsive? Use the viewport meta tag, fluid widths, flexible images, Flexbox or Grid, and media queries that change the layout at breakpoints. Design for mobile first, then add rules for larger screens.

Related: Front-End Development Internship at Ezitech

React interview questions

React questions test whether you understand why a component re-renders, not whether you can recite hook names.

  1. What is the virtual DOM? A lightweight copy of the UI that React keeps in memory. When state changes, React builds a new copy, compares it with the old one, and updates only the real DOM nodes that changed.
  2. What is the difference between props and state? Props are inputs passed in from a parent and are read-only inside the component. State is data the component owns and changes with its setter, which triggers a re-render.
  3. Why do list items need a key? Keys let React match items between renders, so it updates, moves or removes the right ones. Use a stable ID, not the array index, when items can be reordered or deleted.
  4. How does useEffect work? It runs code after render, for side effects such as fetching data or subscribing to events. The dependency array controls when it runs again, and the function it returns cleans up before the next run or when the component unmounts.
  5. What is the difference between useMemo and useCallback? useMemo caches a computed value, and useCallback caches a function so its reference stays the same between renders. Both are worth using only when the recalculation or the child re-render is actually expensive.
  6. What are controlled and uncontrolled inputs? A controlled input gets its value from React state and updates through onChange. An uncontrolled input keeps its own value in the DOM, and you read it with a ref.
  7. What is prop drilling, and how do you avoid it? Passing props through several layers of components that don’t use them. Use Context for shared data like the logged-in user, or a state library such as Redux Toolkit or Zustand in larger apps.
  8. What causes unnecessary re-renders? A parent re-rendering, new object or function props created on every render, and context values that change often. Fix it with React.memo, useMemo or useCallback where it matters, and by keeping state close to where it is used.
  9. What is the difference between client-side and server-side rendering? Client-side rendering sends a nearly empty HTML page and builds the UI in the browser. Server-side rendering, as in Next.js, sends ready HTML from the server, which shows content faster on first load and is easier for search engines to read.
  10. How do you fetch data in React? Inside useEffect with fetch or Axios, with loading and error states, or with a library such as TanStack Query that adds caching and retries. In Next.js, server components can fetch data on the server instead.

Related: React Internship at Ezitech · MERN Stack Developer Roadmap

Node.js and Express interview questions

Backend questions focus on how requests flow, how errors are handled, and how you keep an API safe.

  1. What is Node.js, and why is it good for APIs? A JavaScript runtime built on Chrome’s V8 engine that runs outside the browser. Its non-blocking I/O lets one process handle many requests that spend most of their time waiting on a database or network.
  2. What does non-blocking I/O mean? Node starts a file or network operation and moves on instead of waiting for it. When the result is ready, its callback or promise runs, so the thread never sits idle.
  3. What is middleware in Express? A function that runs between the incoming request and the route handler, with access to req, res and next. It handles logging, JSON parsing, authentication and errors, and it must either call next() or send a response.
  4. How do you handle errors in Express? Catch errors in async handlers, pass them to next(err), and add one error-handling middleware with four arguments (err, req, res, next) at the end, which sends a consistent JSON error response.
  5. Why use environment variables instead of hard-coded config? Secrets such as database passwords and API keys stay out of the code, and values can differ between development and production. Load them from a .env file with dotenv, and never commit that file to Git.
  6. How does JWT authentication work? After login, the server signs a token that contains the user’s ID. The client sends it in the Authorization header with each request, and the server checks the signature instead of looking up a session. Keep tokens short-lived.
  7. What is the difference between require and import? require is CommonJS and loads modules at runtime. import is ES module syntax, analysed before the code runs, and is the modern standard. Enable it with "type": "module" in package.json.
  8. How would you protect an API from abuse? Validate every input, rate-limit requests per IP or user, check authentication and permissions on every route, set CORS rules, and use parameterised queries or an ORM to prevent injection.

Related: MERN Stack Internship at Ezitech · Backend Development Internship

PHP and Laravel interview questions

Laravel is a common backend stack at Pakistani software houses, so expect questions on Eloquent and database performance.

  1. What is MVC, and how does Laravel use it? Model-View-Controller splits data (models), presentation (Blade views) and request handling (controllers). A Laravel route sends the request to a controller, which uses Eloquent models and returns a view or JSON.
  2. What is Eloquent? Laravel’s ORM, where each database table has a model class. You query with methods like User::where('active', 1)->get() instead of raw SQL, and define relationships such as hasMany and belongsTo.
  3. What is the N+1 query problem, and how do you fix it? Loading a list and then running one extra query per item for a relationship: 1 query for 50 posts, plus 50 more for their authors. Fix it with eager loading: Post::with('author')->get().
  4. What are migrations? Version-controlled PHP files that create or change database tables. Everyone on the team runs php artisan migrate to get the same schema, and migrate:rollback undoes the last batch.
  5. What is middleware in Laravel? A layer that filters requests before they reach the controller, such as auth, which checks that the user is logged in, or throttle, which limits request rates. You attach it to routes or route groups.
  6. How does Laravel protect against CSRF? It stores a token in each session, and forms include it with @csrf. Laravel rejects POST, PUT and DELETE requests whose token doesn’t match, so another site can’t submit forms as your user.
  7. What is the difference between include and require in PHP? Both load another file. If the file is missing, include gives a warning and continues, while require stops with a fatal error. The _once versions load a file only once.
  8. What are queues used for? Moving slow work, such as sending emails or processing uploads, out of the web request. The job goes into a queue such as the database or Redis, and a worker runs it in the background, so the user gets a fast response.

Related: PHP & Laravel Internship at Ezitech · Laravel Developer Roadmap

Flutter and Dart interview questions

Flutter interviews check whether you understand how widgets rebuild and how you manage state as an app grows.

  1. What is the difference between a StatelessWidget and a StatefulWidget? A StatelessWidget depends only on the values passed to it and never changes by itself. A StatefulWidget has a State object, and calling setState() rebuilds it with new data.
  2. What is the widget tree, and what does build() do? A Flutter UI is a tree of widgets, and build() describes what a widget looks like for the current state. Flutter calls it whenever something changes and updates only what differs on screen.
  3. What is the difference between hot reload and hot restart? Hot reload injects your code changes and keeps the app’s current state. Hot restart starts the app again from scratch and resets state, which you need after changing main() or global setup.
  4. How do you manage state in a larger Flutter app? setState works inside a single widget. For state shared across screens, use a package such as Provider, Riverpod or Bloc, which keeps business logic out of the UI and makes it testable.
  5. What are Future and Stream in Dart? A Future is one value that arrives later, like an HTTP response. A Stream is a series of values over time, like chat messages or location updates. FutureBuilder and StreamBuilder show them in the UI.
  6. What does const do in a Flutter widget? A const widget is created once at compile time and reused, so Flutter can skip rebuilding it. Adding const wherever possible is a cheap performance win.
  7. What is null safety in Dart? A variable can’t be null unless its type allows it, as in String?. The compiler catches possible null errors before the app runs, and ! tells it you are sure a value isn’t null.
  8. How do you call a REST API in Flutter? Use the http or Dio package in an async function, check the status code, turn the JSON into a model class with a fromJson constructor, and show loading and error states in the UI.

Related: Flutter Development Internship at Ezitech · Flutter Developer Roadmap

Python interview questions

Python questions for freshers are mostly about core data types and how the language behaves, whether the role is Django, data or AI.

  1. What is the difference between a list and a tuple? A list is mutable, so you can add, remove and change items. A tuple is immutable and can be used as a dictionary key, so use it for fixed records like coordinates.
  2. Why is checking x in my_set faster than x in my_list? A list is scanned item by item, which is O(n). A set or dict uses hashing, so a lookup is O(1) on average. Use a set when you check membership often.
  3. What are *args and **kwargs? *args collects extra positional arguments into a tuple, and **kwargs collects extra keyword arguments into a dict. They let a function accept a flexible number of arguments.
  4. What is a list comprehension? A short way to build a list from another iterable, such as [x * 2 for x in nums if x > 0]. It reads better than a loop for simple transforms; for complex logic, a normal loop is clearer.
  5. What is the difference between a shallow copy and a deep copy? A shallow copy creates a new outer object but shares the nested objects inside it. copy.deepcopy copies everything, so changing a nested list in the copy doesn’t change the original.
  6. What is a decorator? A function that wraps another function to add behaviour, such as logging, timing or a login check, without changing its code. You apply it by writing @decorator_name above the function.
  7. What is the GIL? In standard CPython, the Global Interpreter Lock lets only one thread run Python code at a time. Threads still help with I/O-bound work; for CPU-heavy work, use multiprocessing or libraries like NumPy that do the heavy lifting outside it.
  8. What is a virtual environment, and why use one? An isolated folder with its own packages for one project, created with python -m venv. It stops projects clashing over package versions, and requirements.txt records what to install.

Related: Python Developer Roadmap · Data Science Internship at Ezitech

SQL and database interview questions

SQL comes up in almost every developer interview, whatever the stack, and you may be asked to write a query on the spot.

  1. What is the difference between a primary key and a foreign key? A primary key uniquely identifies each row and can’t be null. A foreign key is a column that points to a primary key in another table, such as orders.customer_id pointing to customers.id.
  2. What are the main types of JOIN? INNER JOIN returns only rows that match in both tables. LEFT JOIN returns every row from the left table plus any matches, with NULL where there is no match. RIGHT JOIN does the same from the right side.
  3. What is the difference between WHERE and HAVING? WHERE filters rows before grouping. HAVING filters groups after GROUP BY, so it can use aggregates, as in HAVING COUNT(*) > 5.
  4. What is normalization? Organising tables so each fact is stored only once. Customer details live in a customers table instead of being repeated on every order. Most business apps aim for third normal form.
  5. What is an index, and what is the trade-off? A structure that lets the database find rows without scanning the whole table, like the index of a book. It speeds up reads on the columns you filter or join on, but slows down inserts and updates and uses extra storage.
  6. What is the difference between DELETE, TRUNCATE and DROP? DELETE removes chosen rows and can use WHERE. TRUNCATE removes all rows quickly but keeps the table. DROP removes the table itself, structure and all.
  7. How do you find the second highest salary? SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees); Another way is SELECT DISTINCT salary FROM employees ORDER BY salary DESC LIMIT 1 OFFSET 1;
  8. What is a transaction, and what does ACID mean? A group of statements that succeed or fail together, like debiting one account and crediting another. ACID means atomic (all or nothing), consistent (rules stay valid), isolated (no one sees half-done work) and durable (committed data survives a crash).
  9. What is SQL injection, and how do you prevent it? An attacker types SQL into an input so it runs as part of your query, such as ' OR '1'='1 in a login form. Prevent it with parameterised queries or an ORM, and never build SQL by joining strings with user input.
  10. When would you choose MongoDB over MySQL? MySQL and PostgreSQL suit structured data with relationships and transactions, such as orders and payments. MongoDB suits flexible or nested data that changes shape often, such as product catalogues or activity logs.

Related: PostgreSQL vs MySQL vs MongoDB · Database Design Mistakes

Git, OOP and computer science basics

These questions are asked in almost every interview, whatever the role, because they show how you will work in a team codebase.

  1. What is the difference between git merge and git rebase? Merge combines two branches and adds a merge commit, keeping the full history. Rebase replays your commits on top of another branch for a straight history. Never rebase commits that others have already pulled.
  2. What is a pull request? A request to merge your branch into the main branch, where teammates review the changes, comment and approve before it is merged. It is how most software houses review code.
  3. How do you fix a merge conflict? Open the conflicted files, keep or combine the changes between the <<<<<<< and >>>>>>> markers, delete the markers, test the code, then git add and commit.
  4. What are the four pillars of OOP? Encapsulation hides internal data behind methods. Abstraction shows only what is needed. Inheritance lets a class reuse another class’s code. Polymorphism lets different classes respond to the same method in their own way.
  5. What is the difference between an abstract class and an interface? An abstract class can have both finished and unfinished methods and shared fields, and a class can extend only one. An interface only lists the methods a class must have, and a class can implement many.
  6. What is the difference between overloading and overriding? Overloading means several methods with the same name but different parameters in one class. Overriding means a child class replaces a parent’s method with its own version of the same method.
  7. What is Big O notation? A way to describe how an algorithm’s time or memory grows as the input grows. A single loop over n items is O(n), a nested loop is O(n²), and binary search is O(log n).
  8. What is the difference between an array and a linked list? An array stores items side by side, so reading by index is O(1) but inserting in the middle is slow. A linked list connects nodes with pointers, so inserting is quick once you are at the right spot, but finding an item means walking the list.
  9. What is the difference between a stack and a queue? A stack is last in, first out, like the browser’s back button or nested function calls. A queue is first in, first out, like a print queue or background jobs.
  10. What happens when you type a URL into a browser? The browser finds the server’s IP address through DNS, opens a connection with a TLS handshake for HTTPS, and sends an HTTP request. The server returns HTML, and the browser loads the CSS, JavaScript and images and renders the page.

Related: Open Source Contributions for Students

AI and machine learning interview questions

AI interviews for freshers test the fundamentals: how models learn, how you measure them, and when a result can’t be trusted.

  1. What is the difference between supervised and unsupervised learning? Supervised learning trains on labelled examples, such as emails marked spam or not spam. Unsupervised learning finds patterns in unlabelled data, such as grouping customers by behaviour with clustering.
  2. What is overfitting, and how do you prevent it? The model memorises the training data, noise included, and does poorly on new data. Prevent it with more data, a simpler model, regularisation, dropout, early stopping and cross-validation.
  3. Why split data into training, validation and test sets? Training data teaches the model, validation data is used to tune settings and pick the best model, and the test set is kept aside for one final, honest measure on unseen data.
  4. What are precision and recall? Precision is how many of the items the model flagged were actually correct. Recall is how many of all the real positives the model found. In fraud or disease detection, recall often matters more, because a miss is costly.
  5. When is accuracy a misleading metric? When classes are imbalanced. If 99% of transactions are genuine, a model that calls everything genuine scores 99% accuracy but catches no fraud. Use precision, recall, F1 score or a confusion matrix instead.
  6. What is gradient descent? A method that adjusts a model’s weights step by step in the direction that reduces its error. The learning rate sets the step size: too large and it overshoots, too small and training crawls.
  7. What is a large language model, and what is RAG? An LLM is a neural network trained on huge amounts of text to predict the next token, which lets it write and answer questions. Retrieval-augmented generation (RAG) first finds relevant documents and passes them to the model, so answers are based on your own data and can cite sources.
  8. What is transfer learning? Starting from a model already trained on a large dataset and fine-tuning it on your smaller one. It lets you build strong image or text models without a huge dataset or expensive GPUs.

Related: Machine Learning Internship at Ezitech · Machine Learning Roadmap

Frequently asked questions

Which questions should I prepare first?

Start with your own stack, then SQL and the Git, OOP and basics section, because those come up in almost every interview. Save time to explain your final year project or best project in detail, since that is where most follow-up questions come from.

How can I prepare in one week?

Spend two days on your own stack, one day on SQL, one day on the basics section, one day practising a walkthrough of your project, and one day on a mock interview with a friend. Say every answer out loud, not just in your head.

Should I answer in English or Urdu?

Answer in the language the interviewer uses. Technical terms stay in English either way, so practise explaining each concept in simple English sentences.

Are these questions enough to get an internship?

They cover the theory. Most interviewers also want to see something you built, so pair this bank with one working project on GitHub and a CV that links to it.

Get interview-ready with real project work

The easiest interview is the one where you can point to something you built. Ezitech internships in web development, app development, AI and design give you hands-on project work to talk about.

Apply for an Ezitech Internship

Before you apply: How to Make a CV That Gets Shortlisted · 70 FYP Ideas for Computer Science Students

Leave a Reply