Technical interview flashcards

30 questions freshers hear most in technical rounds, across OOP, DBMS, SQL, operating systems and networking. Pick a topic, answer out loud, then flip to check the key idea and a clear way to say it.

Free, no sign-up. Cards you mark “Got it” are remembered only on this device.

Card 1 of 300 / 30 marked “Got it”
Interviewer asks

What are the four pillars of OOP?

Key idea

Encapsulation, abstraction, inheritance and polymorphism.

Say it like this

Encapsulation bundles data with the methods that use it and hides internal state. Abstraction shows only what's needed. Inheritance lets a class reuse another's behaviour. Polymorphism lets one interface behave differently per object, like draw() on a Circle and a Square.

Want someone to quiz you for real? Ask a working professional one-to-one. Anonymous and free.

Ask anonymously

All 30 questions

Prefer a list? Here is every card, grouped by topic.

OOP

What are the four pillars of OOP?

Key idea: Encapsulation, abstraction, inheritance and polymorphism.

Say it like this: Encapsulation bundles data with the methods that use it and hides internal state. Abstraction shows only what's needed. Inheritance lets a class reuse another's behaviour. Polymorphism lets one interface behave differently per object, like draw() on a Circle and a Square.

What's the difference between overloading and overriding?

Key idea: Overloading is decided at compile time; overriding at run time.

Say it like this: Overloading: same method name, different parameters, in the same class (add(int, int) and add(double, double)). Overriding: a subclass redefines a parent method with the same signature, and the object's actual type decides which one runs.

Abstract class vs interface: when would you use each?

Key idea: An abstract class shares code and state; an interface defines a contract.

Say it like this: In Java, an abstract class can have fields, constructors and implemented methods, and a class extends only one. An interface is a contract a class can implement many of; since Java 8 it can have default and static methods. Use an interface for a capability (Comparable), an abstract class for a shared base.

What is a constructor? Can it be private?

Key idea: It initialises a new object; a private constructor controls how objects are created.

Say it like this: A constructor has the class's name and no return type, and runs when an object is created. Yes, it can be private: that's used for singletons (one shared instance) and utility classes that shouldn't be instantiated.

Composition vs inheritance: which do you prefer?

Key idea: "Has-a" versus "is-a", and knowing the trade-off.

Say it like this: Inheritance models "is-a" (a Car is a Vehicle); composition models "has-a" (a Car has an Engine). Composition is usually more flexible because you can swap parts without deep class hierarchies, so many teams prefer it unless there's a true "is-a" relationship.

What does static mean?

Key idea: Belongs to the class, not to an object.

Say it like this: A static field or method is shared by all objects of the class and can be used without creating one, like Math.max() or a counter of how many objects were created. Static methods can't use instance fields directly.

DBMS

What is normalisation? Explain 1NF, 2NF and 3NF.

Key idea: Reducing duplicate data to avoid update, insert and delete anomalies.

Say it like this: 1NF: each column holds single (atomic) values. 2NF: 1NF, and no column depends on only part of a composite key. 3NF: 2NF, and no column depends on another non-key column (no transitive dependency). Mention that read-heavy systems sometimes denormalise for speed.

Primary key vs unique key?

Key idea: Both enforce uniqueness; only the primary key identifies the row and can't be NULL.

Say it like this: A table has one primary key: unique and never NULL. It can have several unique keys, which also prevent duplicates but usually allow NULLs (how many NULLs depends on the database). Example: student_id as primary key, email as a unique key.

What are the ACID properties?

Key idea: How a database keeps transactions reliable.

Say it like this: Atomicity: all or nothing. Consistency: data moves from one valid state to another. Isolation: concurrent transactions don't interfere. Durability: once committed, it survives a crash. Use a bank transfer as the example: debit and credit both happen, or neither does.

What is an index, and what does it cost?

Key idea: Faster reads at the cost of storage and slower writes.

Say it like this: An index is like a book's index: a separate structure (often a B-tree) that lets the database find rows without scanning the whole table. It speeds up WHERE, JOIN and ORDER BY on that column, but takes space and has to be updated on every insert, update and delete.

What is a foreign key?

Key idea: Referential integrity between tables.

Say it like this: A column that refers to the primary key of another table, like orders.customer_id pointing to customers.id. The database then stops you from adding an order for a customer that doesn't exist, or (depending on the rule) from deleting a customer who still has orders.

DELETE vs TRUNCATE vs DROP?

Key idea: Removing some rows, all rows, or the whole table.

Say it like this: DELETE removes the rows you choose with WHERE, one by one, and fires triggers. TRUNCATE quickly removes all rows but keeps the table. DROP removes the table itself, structure and all. Whether TRUNCATE can be rolled back depends on the database, so say that if asked.

SQL

WHERE vs HAVING?

Key idea: Filtering rows before grouping versus filtering groups after it.

Say it like this: WHERE filters individual rows before GROUP BY; HAVING filters the groups after aggregation. Example: SELECT dept, COUNT(*) FROM employees WHERE active = 1 GROUP BY dept HAVING COUNT(*) > 5.

Explain the types of JOIN.

Key idea: Which rows each join keeps.

Say it like this: INNER JOIN: only matching rows. LEFT JOIN: every row from the left table, with NULLs where there's no match. RIGHT JOIN: the reverse. FULL OUTER JOIN: all rows from both. CROSS JOIN: every combination. A self join joins a table to itself, like employees to their managers.

How do you find the second-highest salary?

Key idea: Subqueries or window functions, and handling ties.

Say it like this: SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees); For the Nth highest, use DENSE_RANK() OVER (ORDER BY salary DESC) and pick rank N. Mention that DENSE_RANK handles equal salaries correctly.

UNION vs UNION ALL?

Key idea: Removing duplicates costs time.

Say it like this: Both stack the results of two queries with the same columns. UNION removes duplicate rows, which needs extra work; UNION ALL keeps every row and is faster. Use UNION ALL when you know there are no duplicates or you want them.

What does GROUP BY do?

Key idea: Aggregating rows that share a value.

Say it like this: It groups rows with the same value in the given columns so you can apply aggregates like COUNT, SUM and AVG to each group. Every selected column must either be in GROUP BY or inside an aggregate, for example SELECT city, AVG(salary) FROM employees GROUP BY city.

In what order is a SQL query processed?

Key idea: Why a SELECT alias can't be used in WHERE.

Say it like this: Logically: FROM and JOIN, then WHERE, GROUP BY, HAVING, SELECT, DISTINCT, ORDER BY and finally LIMIT. Because WHERE runs before SELECT, you can't use a column alias defined in SELECT inside WHERE, but you can in ORDER BY.

OS

Process vs thread?

Key idea: Separate memory versus shared memory.

Say it like this: A process is a running program with its own memory space. Threads are units of execution inside a process that share its memory, so they're lighter to create and switch, but need synchronisation (locks) to avoid race conditions. A browser tab running several tasks is a common example.

What is a deadlock, and how do you prevent it?

Key idea: The four conditions, and breaking one of them.

Say it like this: A deadlock is when processes wait on each other forever. It needs all four: mutual exclusion, hold and wait, no pre-emption and circular wait. Prevent it by breaking one, most often circular wait: always take locks in the same order.

What is virtual memory and paging?

Key idea: Giving each process its own address space, bigger than physical RAM.

Say it like this: Each process sees virtual addresses, which the OS maps to physical memory in fixed-size pages. Pages not in use can live on disk; touching one that isn't in RAM causes a page fault and the OS loads it. This isolates processes and lets programs use more memory than is physically free.

Name some CPU scheduling algorithms.

Key idea: The trade-off between fairness and throughput.

Say it like this: First Come First Served (simple, but long jobs make others wait), Shortest Job First (lowest average wait, but needs job lengths), Round Robin (each process gets a time slice in turn, good for responsiveness) and Priority scheduling (risk of starvation, fixed by ageing).

Mutex vs semaphore?

Key idea: One owner versus a counter.

Say it like this: A mutex is a lock that one thread holds at a time and the same thread releases. A semaphore is a counter that lets up to N threads in, useful for a pool of N connections. A binary semaphore looks like a mutex but has no owner, so any thread can signal it.

What is thrashing?

Key idea: Too little memory per process.

Say it like this: When processes don't have enough memory for the pages they actively use, the system spends most of its time swapping pages in and out instead of doing work, and performance collapses. Fixes: run fewer processes at once, add RAM, or use better page replacement.

Networking

What are the 7 layers of the OSI model?

Key idea: The layers in order, and an example of each.

Say it like this: Physical, Data Link, Network, Transport, Session, Presentation, Application. Examples: cables and signals, Ethernet and switches, IP and routers, TCP and UDP, sessions, encryption and formats, HTTP and DNS. Mention that the internet actually uses the 4-layer TCP/IP model.

TCP vs UDP?

Key idea: Reliability versus speed.

Say it like this: TCP is connection-based and guarantees delivery and order using acknowledgements and retries, used for web pages, email and file transfer. UDP sends packets with no connection or guarantee, so it's faster, used for video calls, online games and DNS lookups.

What happens when you type a URL and press Enter?

Key idea: The whole journey, in order.

Say it like this: The browser looks up the domain's IP address with DNS, opens a TCP connection (plus a TLS handshake for HTTPS), sends an HTTP request, the server responds with HTML, and the browser parses it, fetches CSS, JavaScript and images, and renders the page.

HTTP vs HTTPS?

Key idea: Encryption and proving the server's identity.

Say it like this: HTTPS is HTTP over TLS: traffic is encrypted, so others on the network can't read or change it, and a certificate proves you're talking to the real site. HTTP uses port 80 by default and HTTPS port 443.

IPv4 vs IPv6, and what is a subnet mask?

Key idea: Address sizes and splitting a network.

Say it like this: IPv4 addresses are 32-bit (about 4.3 billion addresses, like 192.168.1.10); IPv6 addresses are 128-bit, written in hex, created because IPv4 ran out. A subnet mask, like 255.255.255.0 (/24), splits an address into the network part and the host part.

What is DNS?

Key idea: Turning names into IP addresses.

Say it like this: DNS is the internet's phone book: it translates names like example.com into IP addresses. A resolver asks the root servers, then the top-level domain servers (.com), then the domain's authoritative server, and caches the answer for a time (the TTL).

How to use these cards

  • Answer out loud first, in two or three sentences, then flip. Interviewers care how clearly you explain, not just whether you know.
  • Add an example from your own project wherever you can: “In my library app, I used an index on book_id because…”
  • Expect follow-ups. If you mention normalisation, be ready to explain 2NF with an example.

Frequently asked questions

What technical questions are asked to freshers?

Most fresher technical rounds cover OOP concepts, DBMS and SQL, operating system basics and computer networks, plus questions about your own projects and some coding. These cards cover the most common basics in each area.

How should I answer a technical question I don't know?

Say what you do know, reason out loud and be honest about the gap: "I haven't used that, but I think it works like…". Interviewers prefer honest reasoning to a confident wrong answer.

Are the answers specific to one language or database?

The ideas are general. Where it matters, like abstract classes and interfaces in Java or how TRUNCATE behaves in different databases, the card says so.

Is my progress saved?

Only on this device: the cards you mark "Got it" are remembered in your browser so you can focus on the rest.