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.
- What is the difference between
let,constandvar?varis function-scoped and hoisted with the valueundefined.letandconstare block-scoped and can’t be used before their declaration.constcan’t be reassigned, but an object it holds can still be changed. - What is the difference between
==and===?==converts types before comparing, so"5" == 5is true.===compares both type and value with no conversion. Use===by default. - 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.
- 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. - What is the difference between promises and
async/await?async/awaitis syntax built on promises.awaitpauses the function until the promise settles, so async code reads top to bottom, and errors are caught withtry/catch. - What is event delegation? Putting one listener on a parent element instead of one on every child, then using
event.targetto see which child was clicked. It works because events bubble up, and it also covers elements added later. - What is the CSS box model? Every element is made of content, padding, border and margin.
box-sizing: border-boxmakes the width include padding and border, which makes layouts easier to predict. - 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.
- What is semantic HTML and why does it matter? Using tags for their meaning, such as
header,nav,mainandbutton, instead ofdiveverywhere. It helps screen readers, search engines and the next developer who reads your code. - 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.
- 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.
- 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.
- 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. - How does
useEffectwork? 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. - What is the difference between
useMemoanduseCallback?useMemocaches a computed value, anduseCallbackcaches 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. - 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. - 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.
- 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,useMemooruseCallbackwhere it matters, and by keeping state close to where it is used. - 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.
- How do you fetch data in React? Inside
useEffectwithfetchor 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.
- 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.
- 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.
- What is middleware in Express? A function that runs between the incoming request and the route handler, with access to
req,resandnext. It handles logging, JSON parsing, authentication and errors, and it must either callnext()or send a response. - 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. - 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
.envfile with dotenv, and never commit that file to Git. - How does JWT authentication work? After login, the server signs a token that contains the user’s ID. The client sends it in the
Authorizationheader with each request, and the server checks the signature instead of looking up a session. Keep tokens short-lived. - What is the difference between
requireandimport?requireis CommonJS and loads modules at runtime.importis ES module syntax, analysed before the code runs, and is the modern standard. Enable it with"type": "module"inpackage.json. - 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.
- 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.
- 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 ashasManyandbelongsTo. - 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(). - What are migrations? Version-controlled PHP files that create or change database tables. Everyone on the team runs
php artisan migrateto get the same schema, andmigrate:rollbackundoes the last batch. - 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, orthrottle, which limits request rates. You attach it to routes or route groups. - 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. - What is the difference between
includeandrequirein PHP? Both load another file. If the file is missing,includegives a warning and continues, whilerequirestops with a fatal error. The_onceversions load a file only once. - 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.
- What is the difference between a
StatelessWidgetand aStatefulWidget? AStatelessWidgetdepends only on the values passed to it and never changes by itself. AStatefulWidgethas aStateobject, and callingsetState()rebuilds it with new data. - What is the widget tree, and what does
build()do? A Flutter UI is a tree of widgets, andbuild()describes what a widget looks like for the current state. Flutter calls it whenever something changes and updates only what differs on screen. - 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. - How do you manage state in a larger Flutter app?
setStateworks 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. - What are
FutureandStreamin Dart? AFutureis one value that arrives later, like an HTTP response. AStreamis a series of values over time, like chat messages or location updates.FutureBuilderandStreamBuildershow them in the UI. - What does
constdo in a Flutter widget? Aconstwidget is created once at compile time and reused, so Flutter can skip rebuilding it. Addingconstwherever possible is a cheap performance win. - 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. - How do you call a REST API in Flutter? Use the
httpor Dio package in an async function, check the status code, turn the JSON into a model class with afromJsonconstructor, 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.
- 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.
- Why is checking
x in my_setfaster thanx 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. - What are
*argsand**kwargs?*argscollects extra positional arguments into a tuple, and**kwargscollects extra keyword arguments into a dict. They let a function accept a flexible number of arguments. - 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. - 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.deepcopycopies everything, so changing a nested list in the copy doesn’t change the original. - 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_nameabove the function. - 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.
- 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, andrequirements.txtrecords 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.
- 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_idpointing tocustomers.id. - What are the main types of JOIN?
INNER JOINreturns only rows that match in both tables.LEFT JOINreturns every row from the left table plus any matches, withNULLwhere there is no match.RIGHT JOINdoes the same from the right side. - What is the difference between
WHEREandHAVING?WHEREfilters rows before grouping.HAVINGfilters groups afterGROUP BY, so it can use aggregates, as inHAVING COUNT(*) > 5. - What is normalization? Organising tables so each fact is stored only once. Customer details live in a
customerstable instead of being repeated on every order. Most business apps aim for third normal form. - 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.
- What is the difference between
DELETE,TRUNCATEandDROP?DELETEremoves chosen rows and can useWHERE.TRUNCATEremoves all rows quickly but keeps the table.DROPremoves the table itself, structure and all. - How do you find the second highest salary?
SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees);Another way isSELECT DISTINCT salary FROM employees ORDER BY salary DESC LIMIT 1 OFFSET 1; - 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).
- 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'='1in a login form. Prevent it with parameterised queries or an ORM, and never build SQL by joining strings with user input. - 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.
- What is the difference between
git mergeandgit 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. - 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.
- 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, thengit addand commit. - 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.
- 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.
- 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.
- 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).
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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
