IT interview questions and answers
Questions for IT officers, helpdesk and support staff, system and network administrators, developers and data staff: networking, security, databases, troubleshooting and good practice.
20 questions
1Explain the difference between a primary key and a foreign key in a relational database.Easy
- A primary key uniquely identifies each row in a table and must satisfy the table’s uniqueness and nullability rules.
- A foreign key references a key in another table, or sometimes the same table, to represent a relationship.
- Foreign-key constraints help preserve referential integrity by preventing invalid references.
- For example, a jobs table might contain an organization_id foreign key referencing the organizations table.
How to say it
Example answer
"A primary key uniquely identifies each row in a table, for example customer_id in a customers table, and it cannot be empty or repeated. A foreign key is a column in another table that points to that primary key, for example customer_id in the orders table. It keeps the data consistent, because you cannot create an order for a customer who does not exist."
Technical3What is the difference between TCP and UDP?Easy
What the interviewer wants: to see that you understand how data travels on a network and can choose the right protocol.
Key points
- TCP is connection-based and reliable. It sets up a connection (three-way handshake), numbers the data, checks that it arrived, resends lost packets and keeps the order.
- UDP is connectionless and faster. It sends data without confirming delivery, so some packets can be lost or arrive out of order.
- TCP is used for web pages (HTTP/HTTPS), email and file transfer, where every byte matters.
- UDP is used for video calls, live streaming, online games and DNS lookups, where speed matters more than a perfect copy.
How to answer
Give one sentence on each protocol, then one example of where you would use each. Mention the trade-off: reliability against speed.
How to say it
Example answer
"TCP is reliable: it checks that every packet arrives in order, so I use it for web pages, email and file transfers. UDP is faster because it does not wait for confirmation, so it suits video calls and live streaming where a lost packet is less important than delay. In short, TCP for accuracy and UDP for speed."
Technical · Networking4What is multi-factor authentication and why does it matter?Easy
What the interviewer wants: practical security awareness, not only definitions.
Key points
- Multi-factor authentication (MFA) asks for two or more different proofs of identity: something you know (password), something you have (phone, token) and something you are (fingerprint).
- If a password is stolen or guessed, the attacker still cannot log in without the second factor.
- It is especially important for email, admin accounts, remote access and financial systems.
- Prefer an authenticator app or a hardware key over SMS where possible, and never share one-time codes with anyone.
Tip
Mention how you would roll it out: start with administrators, explain it to staff and keep a safe recovery process.
How to say it
Example answer
"MFA means you need more than a password, for example a password plus a code from an app. If a password is stolen, the attacker still cannot enter. I would first enable it for administrators and email accounts, train staff, and keep a safe recovery method for people who lose their phones."
Technical · Security5What is an IP address, a subnet mask and a default gateway?Easy
What the interviewer wants: basic networking vocabulary that every IT officer uses daily.
Key points
- An IP address identifies a device on a network (for example 192.168.1.25).
- A subnet mask (for example 255.255.255.0) shows which part of the address is the network and which part is the device. Devices in the same subnet can talk directly.
- A default gateway is the router address a device sends traffic to when the destination is outside its own subnet, such as the internet.
- Addresses can be static (set by hand, used for servers and printers) or dynamic (given by a DHCP server).
Example
"If a computer has the right IP address but cannot reach the internet, I would check the gateway and DNS settings first."
How to say it
Example answer
"An IP address identifies a device, for example 192.168.1.25. The subnet mask tells which part is the network and which part is the device, so computers know who is in the same network. The default gateway is the router that takes traffic to other networks like the internet. When a computer reaches local printers but not the internet, I check the gateway first."
Technical · Networking6What is the difference between IaaS, PaaS and SaaS?Easy
What the interviewer wants: to check that you understand cloud service models.
Key points
- IaaS (Infrastructure as a Service): you rent virtual servers, storage and networks and manage the operating system and software yourself.
- PaaS (Platform as a Service): the provider manages servers and runtime; you deploy your application.
- SaaS (Software as a Service): you use a finished application through a browser, such as email or an accounting system.
Tip
Give a local example, such as hosting a school system on a rented server (IaaS) compared with using a ready-made online email service (SaaS), and mention cost, control and responsibility for security.
How to say it
Example answer
"IaaS gives me a virtual server and I manage everything on it, like renting an empty office. PaaS gives me a platform where I only deploy my application, like renting an office with furniture and internet. SaaS is a finished application, like using online email. The more managed the service, the less control I have but the less work too."
Technical · Cloud7What is version control, and why do teams use Git?Easy
What the interviewer wants: evidence that you can work safely in a team.
Key points
- Version control records every change to files, so you can see who changed what and go back to any earlier version.
- Git is distributed: everyone has a full copy, and work continues even when offline.
- Branches let people work on features separately; merging and pull requests bring work together after review.
- Good habits: small commits with clear messages, pull before you push, never commit passwords or keys.
How to say it
Example answer
"Version control keeps the history of every change, so a team can work together and go back if something breaks. With Git I create a branch for each task, commit with clear messages, and open a pull request so a colleague reviews before merging. I never commit passwords or keys to the repository."
Technical · Software8How would you reduce the risk of phishing and compromised staff accounts?Medium
- Require multifactor authentication and unique passwords stored in an approved password manager.
- Train staff to check sender addresses, links, attachments, urgency, and unusual requests.
- Verify payment or credential requests through a separate trusted channel.
- Provide a clear reporting route; if compromise is suspected, promptly report it, revoke sessions, secure the account, and follow incident procedures.
How to say it
Example answer
"I use several layers. Technically: email filtering, multi-factor authentication and up-to-date systems. For people: short regular training, with examples of suspicious messages and a simple way to report them, such as one button or one email address. Process: no password or payment changes based only on an email. If an account is compromised, we reset the password, end all sessions and check what was accessed."
Situational9A user cannot access a business application. How would you troubleshoot the issue systematically?Medium
- Ask the user what they were doing, record the exact error, and determine whether one or many users are affected.
- Check account status, permissions, connectivity, service health, and any recent changes.
- Review relevant logs and reproduce the problem safely where possible.
- Test one likely cause at a time, confirm service is restored, document the resolution, and escalate with evidence if needed.
How to say it
Example answer
"First I would ask questions: what exactly happens, what error appears, since when, and does it affect only this user? Then I check the simple things: network connection, correct username, locked account or expired password. If other users are fine, I check this user's permissions and device. If many users are affected, I check the server and the service status. I fix the cause, confirm with the user that it works and record the solution."
Technical10Explain the purpose of DNS, and describe how you would investigate a domain that does not resolve.Medium
- Explain that the Domain Name System maps domain names to records such as IP addresses and mail servers.
- Confirm the exact hostname and check the relevant record types and authoritative nameservers.
- Compare results from authoritative and recursive resolvers; inspect TTLs, delegation, and configuration errors.
- Distinguish a DNS issue from a web-server or network issue, and allow for caching or propagation when relevant.
How to say it
Example answer
"DNS works like the phone book of the internet: it turns a name such as example.co.tz into an IP address. If a website does not open, I first check whether the domain resolves, using nslookup or dig. Then I look at the A record, the name servers and whether the domain has expired. If the domain resolves but the site is still down, the problem is probably the web server and not DNS."
Technical11What is the difference between a backup and a disaster-recovery plan?Medium
- A backup is a recoverable copy of data or system information.
- A disaster-recovery plan describes how to restore services, infrastructure, access, responsibilities, and dependencies after disruption.
- Explain the importance of protected copies, off-site or isolated storage, recovery objectives, and documented procedures.
- Emphasize regular restoration tests; a backup is not reliable until recovery has been tested.
How to say it
Example answer
"A backup is a copy of data. A disaster-recovery plan is the full plan for restoring services after a serious failure: who does what, in which order, on which equipment and how fast. For example, having a nightly copy of our database is a backup. Knowing that we can bring the system back within four hours at another site, and having tested it, is disaster recovery."
Technical12What is database normalisation and why is it used?Medium
What the interviewer wants: good design habits for databases.
Key points
- Normalisation organises data into related tables so that each fact is stored once.
- It reduces duplicate data and prevents update, insert and delete anomalies (for example, a customer's address being different in two places).
- 1NF: each field holds one value. 2NF: no partial dependency on part of a key. 3NF: no dependency on non-key columns.
- Sometimes data is denormalised on purpose to make reporting faster, as a conscious trade-off.
How to say it
Example answer
"Normalisation means organising data so each fact is stored once, in the right table. For example, instead of repeating a customer's address on every order, I store it once in the customers table and link orders with a customer ID. That prevents inconsistent data and makes updates safe. For some reports I may denormalise on purpose for speed."
Technical · Databases13What is the difference between a firewall, an antivirus and an intrusion detection system?Medium
What the interviewer wants: to know whether you understand layers of security and do not treat one tool as the whole answer.
Key points
- Firewall: allows or blocks network traffic using rules (addresses, ports, protocols). It controls what can enter or leave.
- Antivirus / endpoint protection: runs on a computer and detects or removes malicious files and behaviour.
- IDS / IPS: watches network or system activity for suspicious patterns. An IDS alerts you; an IPS can also block the traffic.
How to answer
Finish with "defence in depth": no single tool is enough, so you combine them with updates, backups, user training and least-privilege access.
How to say it
Example answer
"A firewall controls which network traffic is allowed in and out. Antivirus works on the computer and detects malicious files. An IDS watches for suspicious activity and alerts us, and an IPS can also block it. None is enough alone, so I combine them with updates, backups and staff awareness."
Technical · Security14What happens when you type a website address into a browser and press Enter?Medium
What the interviewer wants: a clear, step-by-step explanation that joins DNS, networking and web servers together.
Key points
- The browser checks its cache, then asks a DNS server to turn the domain name into an IP address.
- The browser opens a TCP connection to that IP address. For HTTPS, a TLS handshake follows to encrypt the traffic.
- The browser sends an HTTP request (for example GET /).
- The web server (sometimes through a load balancer, cache or application server) builds the response and sends back HTML.
- The browser reads the HTML, requests extra files (CSS, JavaScript, images) and renders the page.
Tip
Add where problems can occur at each step (DNS failure, blocked port, expired certificate, slow server). It shows you can troubleshoot, not only recite.
How to say it
Example answer
"The browser asks DNS for the IP address of the site, opens a connection to it and, for HTTPS, agrees on encryption. It then sends a request, the server replies with the page, and the browser loads the extra files and shows the page. If the page does not load, I check these steps in order: DNS, connection, certificate and then the server."
Technical · Networking15What is RAID, and which levels do you know?Medium
What the interviewer wants: an understanding of storage reliability.
Key points
- RAID combines several disks to improve speed, protect against disk failure, or both.
- RAID 0: data is striped for speed with no protection; one failed disk loses everything.
- RAID 1: data is mirrored on two disks; if one fails, the other continues.
- RAID 5: data and parity are spread across three or more disks; it survives one disk failure.
- RAID 10: mirrored pairs that are striped; fast and safe, but costs more disk space.
Important
RAID is not a backup. It does not protect against deleted files, ransomware or fire, so regular backups are still required.
How to say it
Example answer
"RAID joins several disks to improve speed or protect against disk failure. RAID 1 mirrors two disks, RAID 5 spreads data and parity across at least three disks and survives one failure, and RAID 10 combines mirroring and striping for speed and safety. I always remind people that RAID is not a backup, so I keep separate backups too."
Technical · Infrastructure16Many users report problems at the same time. How do you prioritise support tickets?Medium
What the interviewer wants: calm, fair and logical decision-making under pressure.
Key points
- Judge by impact (how many people and which services are affected) and urgency (how soon it hurts the business).
- Fix problems that stop the whole organisation (network, email, payment system) before single-user issues.
- Look for a common cause: ten tickets may come from one failed switch or server.
- Communicate: acknowledge each ticket, give a realistic time, and update affected users.
- Record the cause and the fix afterwards so the problem can be prevented.
Example
"If the internet is down for the whole office, I solve that first, and I tell the user with a printer problem that I will return to them after the outage."
How to say it
Example answer
"I would first check whether the tickets have a common cause, for example one failed switch. I then rank by impact: a problem that stops the whole office comes before one user's printer. I acknowledge every ticket, give a realistic time, and update people while I work. Afterwards I write down the cause so we can prevent it."
Situational · IT support17What is a REST API?Medium
What the interviewer wants: knowledge of how applications talk to each other.
Key points
- A REST API lets one program request and change data in another over HTTP, using addresses (URLs) for resources, such as
/users/12. - Common methods: GET (read), POST (create), PUT/PATCH (update), DELETE (remove).
- It is stateless: each request carries everything needed, which makes it easy to scale.
- Data is usually sent as JSON; responses use status codes such as 200 (OK), 404 (not found) and 401 (not authorised).
How to answer
If you have used an API (for example, a payment or SMS service), describe it in one sentence.
How to say it
Example answer
"A REST API lets programs talk over HTTP. Each thing, like a user, has an address such as /users/12. I use GET to read, POST to create, PUT or PATCH to update and DELETE to remove. The response is usually JSON with a status code like 200 for success or 404 for not found. I have used an API like this to send SMS notifications from an application."
Technical · Software- A REST API lets one program request and change data in another over HTTP, using addresses (URLs) for resources, such as
18Explain SQL INNER JOIN and LEFT JOIN with an example.Medium
What the interviewer wants: proof that you can combine data from several tables.
Key points
- A join combines rows from two tables using a related column, usually a foreign key.
- INNER JOIN returns only rows that have a match in both tables.
- LEFT JOIN returns all rows from the left table and the matching rows from the right table; where there is no match, the right-side columns are NULL.
Example
With tables customers and orders: an INNER JOIN lists only customers who have placed orders. A LEFT JOIN lists all customers, and customers without orders show empty order details. Use LEFT JOIN with
WHERE orders.id IS NULLto find customers who have never ordered.How to say it
Example answer
"With customers and orders tables, an INNER JOIN shows only customers who have orders. A LEFT JOIN shows all customers, and the order columns are empty for customers without orders. I use LEFT JOIN with a check for NULL when I want to find customers who have never ordered."
Technical · Databases19A database-backed application has become slow. What would you investigate before changing the system?Hard
- Establish when the slowdown began, which operations are affected, and whether it impacts all users.
- Review monitoring, logs, CPU and memory use, connection pools, locks, and database load.
- Inspect slow queries and query plans; assess indexes and data access patterns before making changes.
- Measure results, test changes in a safe environment, back up where appropriate, and maintain a rollback plan.
How to say it
Example answer
"I would start by finding out when it became slow and what changed. Then I check the server load (CPU, memory, disk), look for slow queries and missing indexes, check for locks and for a growing table, and look at network delays between the application and the database. I would test any fix on a copy first and measure again afterwards, so I know it really helped."
Technical20How would you plan a security update for a production system with minimal disruption?Hard
- Assess the update’s urgency, security impact, compatibility, dependencies, and maintenance requirements.
- Back up relevant data and test the update in a staging or other safe environment.
- Communicate the plan, schedule deployment appropriately, and define success checks and rollback steps.
- Apply the update using approved procedures, monitor the system afterward, and document the outcome.
How to say it
Example answer
"I would read the update notes, test it on a test system, take a fresh backup and choose a quiet time, such as the weekend. I would tell users in advance, install the update in stages, check that the services work afterwards and keep a rollback plan ready. After the update I would monitor the system and record what was done."
Situational