Skip to content
Tutorials Center
My learning

Topics

Lesson 54 of 55 ยท Practice and Review

Computer Fundamentals Interview Questions

40 common computer fundamentals interview questions with concise answers on hardware, data, operating systems, networks and security, with a few runnable checks.

Interviews for junior technical roles, help-desk jobs and many programming positions start with fundamentals. The interviewer wants to know whether you understand how a computer works underneath, and whether you can explain it in plain words. This page collects 40 questions that come up again and again, grouped by area, with short answers you can expand in your own voice.

Try to answer each question out loud before you open it. If you cannot explain an idea in two or three sentences, follow the link and review the lesson. A few questions are best answered by running a tiny program; those editors are stand-ins that show the behavior in your browser, and nothing here needs a server.

A short correct answer plus one concrete example beats a long recital. Mention trade-offs ("faster, but more expensive") whenever you can. That is what separates a confident answer from a memorized one.

Hardware and memory

These questions come from Hardware and Software, The CPU, Memory: RAM, Cache and the Memory Hierarchy, Storage: HDD, SSD and Beyond and Motherboard, Buses, GPU and Power.

1. What is the difference between hardware and software?

Hardware is the physical equipment you can touch: processor, memory, storage, screen. Software is the set of instructions that tells the hardware what to do, stored as data. The same hardware can do very different jobs depending on which software runs on it.

2. What does the CPU do?

It runs the fetch-decode-execute cycle: fetch an instruction from memory, work out what it means, and carry it out, then repeat billions of times per second. The arithmetic logic unit does calculations, the control unit directs the steps, and registers hold the values being worked on right now.

3. What is the difference between a core and a thread?

A core is a complete processing unit that can run instructions on its own. A thread is a sequence of instructions scheduled onto a core. Some cores can run two hardware threads at once (simultaneous multithreading) by sharing parts of the core, which helps when one thread waits for memory, but two threads do not give twice the speed of one.

4. Does a higher clock speed always mean a faster processor?

No. Clock speed (GHz) only counts cycles per second. What matters is how much work is done per cycle, which depends on the design, the number of cores, the cache and the memory speed. Comparing GHz is only fair between processors of the same design.

5. What is the difference between RAM and storage?

RAM is fast, volatile working memory: it loses its contents when power is off and holds the programs and data in use. Storage (SSD or hard disk) is slower but non-volatile and much larger, so it keeps files for the long term. Programs are loaded from storage into RAM to run.

6. Why does a CPU have a cache?

RAM is far slower than the CPU. A small, very fast cache keeps recently used data and nearby data close to the core. Programs tend to reuse data (temporal locality) and access neighbors (spatial locality), so most accesses become cache hits. Caches come in levels (L1, L2, L3) that trade size for speed.

7. How do an SSD and a hard disk differ?

A hard disk stores data magnetically on spinning platters and must move a read head, so random access is slow. An SSD stores data in flash memory with no moving parts, so random access is much faster, and it is quieter and more shock-resistant. Hard disks often give more capacity per money; flash cells also wear out after many writes, which controllers manage.

8. How is a GPU different from a CPU?

A CPU has a few powerful cores good at complex, varied, sequential work. A GPU has thousands of simpler cores that apply the same operation to huge amounts of data in parallel, which suits graphics, video and machine learning. Work that cannot be split into many independent pieces gains little from a GPU.

9. What is firmware, and what do BIOS and UEFI do?

Firmware is software stored on a hardware device that makes it work at a basic level. BIOS and its modern replacement UEFI are the firmware on the motherboard that initializes the hardware at power-on and then hands control to the operating system's boot loader.

10. What is a bus?

A bus is a set of wires (and the rules for using them) that carries data, addresses or control signals between components, such as CPU to memory or the PCIe connection to a graphics card. Wider and faster buses move more data per second.

Data representation

These questions come from Bits and Bytes, Binary, Octal and Hexadecimal, Text and Character Encoding and Compression and File Formats.

11. Why do computers use binary?

Electronic circuits can reliably tell two states apart (low and high voltage), even with noise and heat. Distinguishing ten levels would be error-prone. Everything, from numbers to video, is encoded as patterns of bits, and n bits give 2^n patterns.

12. What is the difference between KB and KiB?

KB (kilobyte) means 1,000 bytes in the decimal SI system; KiB (kibibyte) means 1,024 bytes (2^10). The same holds for MB/MiB, GB/GiB and so on. Drive makers use decimal units, which is why a 1 TB drive appears as about 931 GiB in some systems.

13. How are negative integers stored?

Almost universally in two's complement. To negate a number, invert its bits and add 1. The top bit acts as the sign, and addition works the same for positive and negative numbers, so the hardware needs no special subtraction circuit. An 8-bit signed value ranges from -128 to 127.

14. What is integer overflow?

It happens when a result is too big for the bits available. In fixed-width arithmetic the extra bits are lost and the value wraps around: 127 + 1 in 8-bit signed arithmetic becomes -128. Languages differ: some wrap, some raise errors, and some use arbitrary-size integers.

15. Why do hexadecimal numbers appear everywhere?

One hex digit equals exactly four bits, so a byte is two hex digits. Hex is a compact, readable way to write binary data such as colors (#1e90ff), memory addresses and checksums, without converting by hand.

16. What is the difference between ASCII, Unicode and UTF-8?

ASCII is an old 7-bit table of 128 characters for English. Unicode is a universal catalog that assigns every character a code point. UTF-8 is an encoding that turns code points into bytes using 1 to 4 bytes each; it is backward compatible with ASCII and is the default on the web. Mixing up the encoding when reading text causes garbled characters called mojibake.

17. What is the difference between lossless and lossy compression?

Lossless compression (ZIP, PNG) lets you rebuild the original exactly by removing redundancy. Lossy compression (JPEG, MP3) throws away detail people are unlikely to notice to get much smaller files; the discarded information cannot be recovered.

18. Why does 0.1 + 0.2 not equal 0.3 in most languages?

Most programming languages store decimal fractions as binary floating-point numbers, and 0.1 and 0.2 have no exact binary representation, just like 1/3 has no exact decimal one. The tiny stored errors add up. Compare floats with a tolerance, or use integers (cents instead of dollars) or decimal types for money.

JS Floating-point surprise

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The tolerance comparison on the third line is the usual fix. This stand-in runs in your browser's JavaScript engine, which follows the same floating-point standard as most languages.

Operating systems

These questions come from What an Operating System Does, Processes, Threads and Scheduling, Memory Management and File Systems.

19. What does the kernel do?

The kernel is the core of the operating system. It manages the CPU time, memory, devices and files, enforces permissions, and gives programs a safe interface (system calls) to ask for those services. It runs in a privileged mode that ordinary programs cannot enter.

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

A process is a running program with its own address space and resources. A thread is a path of execution inside a process; threads of the same process share its memory, so they communicate easily but can interfere with each other. A crash in one process normally does not take down others, while a bad thread can take down its whole process.

21. What is a context switch, and why does it cost time?

It is when the operating system stops one task and resumes another by saving the first one's registers and state and restoring the second's. The saving itself, plus the loss of warm cache contents, means switching too often wastes time that could do useful work.

22. What is a system call?

A controlled way for a program to ask the kernel for something it is not allowed to do itself, such as reading a file, opening a network connection or creating a process. The program triggers a switch into kernel mode, the kernel checks the request, performs it and returns the result.

23. What is virtual memory?

A technique that gives each process its own private, continuous address space, which the operating system and hardware map onto real RAM in fixed-size pages. It isolates programs from each other, allows more address space than physical RAM, and lets rarely used pages be moved to disk.

24. What is a page fault?

It occurs when a program touches a page that is not currently mapped to RAM. The operating system then loads the page (for example from disk), updates the mapping and resumes the program. If the address is invalid, the process is stopped, which shows up as a crash such as a segmentation fault.

25. What is a deadlock, and how can it be avoided?

A deadlock is a situation where processes wait on each other in a cycle, so none can proceed. It needs mutual exclusion, hold-and-wait, no preemption and circular wait. Breaking any one condition prevents it; the most practical rule is to always acquire locks in the same global order.

26. What are files, directories and inodes?

A file system organizes storage into named files inside directories. On Unix-style file systems each file has an inode that records metadata (size, owner, permissions, timestamps and where its data blocks are) but not its name; directory entries map names to inodes.

27. What happens when you press the power button?

Firmware (UEFI/BIOS) tests and initializes the hardware, finds a boot device and loads the boot loader. The boot loader loads the kernel into memory, the kernel sets up memory, drivers and the first process, and system services and finally the login screen or desktop start.

Networks and the web

These questions come from Networking Basics, The Internet, IP Addresses and DNS and How the Web Works.

Question 31 below is the classic one. This is its shape:

flowchart LR
  U["URL typed"] --> D["DNS lookup"]
  D --> T["TCP + TLS<br/>connection"]
  T --> R["HTTP request"]
  R --> S["HTTP response<br/>HTML"]
  S --> P["Parse, fetch<br/>CSS/JS/images"]
  P --> V["Page rendered"]

The main steps between pressing Enter and seeing a page.

28. What is the difference between TCP and UDP?

TCP is connection-oriented and reliable: it numbers data, acknowledges it, retransmits losses and delivers bytes in order. UDP just sends independent datagrams with no guarantees but low delay. Web pages and email use TCP; live voice, games and DNS queries often use UDP.

29. How do an IP address and a MAC address differ?

A MAC address identifies a network interface on the local link and is used within one network segment. An IP address identifies a device logically on a network and is used to route packets across many networks. The IP can change when you move; the MAC is normally tied to the hardware.

30. What does DNS do?

It translates human-friendly names such as example.com into IP addresses. A resolver asks a chain of servers (root, top-level domain, the domain's own name server) and caches answers for their time to live so later lookups are fast.

31. What happens when you type a URL and press Enter?

The browser looks up the host with DNS, opens a TCP connection (and for HTTPS a TLS handshake), sends an HTTP request, receives the response, parses the HTML and then requests the CSS, scripts and images it references before rendering the page.

32. What is the difference between HTTP and HTTPS?

HTTPS is HTTP carried over TLS. TLS encrypts the traffic, verifies the server's identity with a certificate and detects tampering, so passwords and pages cannot be read or altered by someone on the path. HTTP alone is sent in plain text.

33. What is the difference between bandwidth and latency?

Bandwidth is how much data can be moved per second (the width of the pipe). Latency is how long one piece takes to get there (the length of the pipe). A satellite link can have high bandwidth and high latency; chatting in a game cares more about latency, downloading a film about bandwidth.

34. What is the difference between a switch and a router?

A switch connects devices inside one local network and forwards frames using MAC addresses. A router connects different networks and forwards packets between them using IP addresses. A home "router" box usually combines both, plus Wi-Fi and a firewall.

35. What is NAT?

Network Address Translation lets many devices on a private network share one public IP address. The router rewrites addresses and ports on outgoing packets and remembers the mapping so replies reach the right device. It also conserves IPv4 addresses.

Security

These questions come from Passwords, Hashing and Encryption, Malware, Phishing and Safe Habits and Backups and Data Recovery.

36. What is the difference between hashing and encryption?

Encryption is reversible with the right key: it protects data you need to read later. A hash is a one-way fingerprint of fixed length: the same input always gives the same output, but you cannot recover the input from it. Hashes check integrity and store passwords; encryption protects confidentiality.

37. What is the difference between symmetric and public-key cryptography?

Symmetric encryption uses one shared secret key for both locking and unlocking and is fast. Public-key cryptography uses a pair: a public key anyone can use to encrypt (or verify), and a private key that only the owner holds. It solves key distribution but is slower, so HTTPS uses it to agree on a symmetric key and then uses that for the data.

38. Why should passwords be salted?

A salt is random data stored with each password hash. It makes two identical passwords hash differently and stops attackers from using precomputed tables of common hashes. Pair it with a deliberately slow password hashing function such as scrypt, bcrypt or Argon2.

39. How can you recognize phishing, and what does two-factor authentication add?

Typical signs are urgency, a mismatched or look-alike address, unexpected attachments and requests for passwords. Check the real domain before entering anything. Two-factor authentication adds a second proof, like a code or hardware key, so a stolen password alone is not enough.

40. What is the 3-2-1 backup rule?

Keep three copies of your data, on two different kinds of media, with one copy stored off-site. It protects against device failure, theft, fire and ransomware. A backup is only trustworthy if you have tested restoring from it.

Quick runnable checks

Some questions are easier to remember after seeing them. These editors are stand-ins in your browser; they show the behavior, not a real CPU or network.

JS Two's complement and wrap-around

Press Run (or Ctrl + Enter) to see the console output here.

No output.

JS Bytes per character in UTF-8

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which pair describes bandwidth and latency correctly?

    Bandwidth is capacity per second; latency is the time one piece of data takes to arrive.
  2. 2. Why is a hash not the same as encryption?

    Hashing is one-way, which is why it is used for integrity checks and password storage; encryption is designed to be reversed.
  3. 3. A thread differs from a process because it...

    Threads in one process share its memory, which makes communication easy and mistakes dangerous.
  4. 4. Which statement about UDP is correct?

    UDP is simple and fast but provides no ordering, acknowledgment or retransmission; applications that need those add them or use TCP.

Summary

  • Know the vocabulary of each layer: hardware, data, operating system, network and security.
  • Give a one-sentence definition first, then a trade-off or an example.
  • Hardware: cores, threads, caches and the memory hierarchy explain most performance questions; GHz alone does not.
  • Data: bits, two's complement, UTF-8 and floating point explain many surprising bugs.
  • OS: processes, threads, virtual memory and system calls are the standard topics.
  • Networks and security: TCP versus UDP, DNS, HTTPS, hashing versus encryption and the 3-2-1 rule come up constantly.

Continue with the Computer Fundamentals Cheat Sheet.