SWE Fundamentals Part 2 Flashcards

1
Q

What is a trie used for?

A

Efficient prefix matching, like autocomplete or dictionary lookups.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a union-find data structure?

A

A structure that tracks disjoint sets, useful for Kruskal’s algorithm and cycle detection in graphs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is topological sort used for?

A

Ordering nodes in a Directed Acyclic Graph (DAG) where dependencies matter (e.g. task scheduling).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a segment tree?

A

A tree used for range queries and updates (e.g. sum, min, max over ranges).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the time complexity of inserting into a binary heap?

A

O(log n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the difference between preorder, inorder, and postorder traversal?

A

Preorder: root → left → right, Inorder: left → root → right, Postorder: left → right → root.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the difference between DFS recursive and iterative?

A

Recursive uses the call stack; iterative uses an explicit stack.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the time complexities of DFS and BFS?

A

O(V + E), where V is vertices and E is edges.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is bit manipulation used for?

A

Space-efficient operations and optimizations (e.g. toggling bits, checking power of 2).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a shallow copy?

A

A copy where nested objects still reference the original.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a deep copy?

A

A full independent copy including all nested objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the difference between mutable and immutable types?

A

Mutable types (like lists) can be changed; immutable types (like tuples or strings) cannot.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a static method?

A

A method that doesn’t access instance data and is bound to the class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the difference between an abstract class and an interface?

A

Abstract classes can have partial implementations; interfaces define method signatures only.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the difference between object-oriented and functional programming?

A

OOP centers around objects and state; functional emphasizes pure functions and immutability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What happens during program compilation?

A

Source code is translated to machine code (or bytecode), optionally optimized, and linked.

17
Q

What is a memory leak?

A

Allocated memory that’s never released, leading to increased usage over time.

18
Q

What is garbage collection good for?

A

Automatically cleaning up unused memory, preventing memory leaks.

19
Q

What is DNS?

A

A system that translates domain names to IP addresses.

20
Q

What’s the difference between HTTP and HTTPS?

A

HTTPS is HTTP over TLS/SSL – it’s encrypted and secure.

21
Q

What is the client-server model?

A

Client sends requests; server processes them and returns responses.

22
Q

What is latency in networking?

A

The time it takes for data to travel from source to destination.

23
Q

What is caching?

A

Storing previously retrieved or computed data to speed up future access.

24
Q

How does a browser fetch a webpage?

A

DNS lookup → HTTP request → server response → HTML rendered by browser.

25
What is a join in SQL?
A way to combine rows from multiple tables based on related columns.
26
What is an INNER JOIN?
Returns only rows with matching keys in both tables.
27
What is a LEFT JOIN?
Returns all rows from the left table and matching rows from the right.
28
What is an index in a database?
A data structure that speeds up read queries on specific columns.
29
What are ACID properties in databases?
Atomicity, Consistency, Isolation, Durability – properties ensuring reliable transactions.
30
What is the difference between SQL and NoSQL?
SQL is relational with structured schemas; NoSQL is flexible and often used for unstructured data.
31
What is normalization?
Organizing tables to reduce redundancy and improve integrity.
32
What is a foreign key?
A field that links one table to another via a primary key.
33
What is Docker?
A platform that packages applications into containers for consistent environments.
34
What is a container?
A lightweight, isolated environment with everything needed to run an app.
35
What is continuous integration (CI)?
Automatically building and testing code every time it changes.
36
What is continuous deployment (CD)?
Automatically deploying code to production after it passes tests.
37
What is a build pipeline?
A series of automated steps (build, test, deploy) triggered by code changes.
38
What is rebase in Git?
Rewrites commit history to make a linear sequence, often used before merging.
39
What is semantic versioning (semver)?
A versioning system: MAJOR.MINOR.PATCH – for breaking changes, features, and bug fixes.