SWE Fundamentals Part 3 Flashcards

1
Q

What is the difference between Python lists and tuples?

A

Lists are mutable, tuples are immutable.

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

How does Python handle memory management?

A

Using reference counting and cyclic garbage collection.

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

What does Python’s GIL (Global Interpreter Lock) do?

A

It prevents multiple threads from executing Python bytecode at once.

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

How does Java handle garbage collection?

A

Automatic GC using generational heap, including young and old generations.

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

What is a pointer in C++?

A

A variable that stores a memory address.

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

What is a null pointer?

A

A pointer that doesn’t point to any memory address (nullptr).

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

What is manual memory management in C++?

A

Using new and delete to allocate and free memory.

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

What is a segmentation fault?

A

An error caused by accessing invalid memory.

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

What are the four main memory segments in a C/C++ program?

A

Stack, heap, data, and code (text) segments.

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

What is a memory address?

A

A location in RAM where data is stored.

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

What happens when you compile C++ code?

A

It’s converted from source → assembly → machine code via compiler and linker.

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

What is bytecode in Java or Python?

A

Intermediate code run by a virtual machine (JVM or Python VM).

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

What is just-in-time (JIT) compilation?

A

Bytecode is compiled to native machine code at runtime for performance.

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

What is the browser rendering pipeline?

A

Parse HTML → construct DOM → apply CSS → build render tree → paint pixels.

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

What is the DOM?

A

Document Object Model – a tree representation of HTML used by browsers.

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

What is an event loop in JavaScript?

A

A system that handles async callbacks from the call stack and task queue.

17
Q

What is the difference between synchronous and asynchronous code?

A

Sync blocks execution; async allows non-blocking operations like network calls.

18
Q

What is a promise in JavaScript?

A

An object representing a value that may be available now, later, or never.

19
Q

What is multithreading?

A

Executing multiple threads concurrently within a process.

20
Q

What is multiprocessing?

A

Running multiple processes in parallel using separate memory spaces.

21
Q

What is a race condition?

A

When the behavior of code depends on the timing of threads or processes.

22
Q

What is a deadlock?

A

When two or more threads wait indefinitely for each other to release resources.

23
Q

What is the difference between authentication and authorization?

A

Authentication verifies identity; authorization grants access to resources.

24
Q

What is SQL injection?

A

A security vulnerability where malicious SQL is injected into queries.

25
What is HTTPS and why is it important?
Encrypted version of HTTP using SSL/TLS to protect data in transit.
26
What is a hash function?
A one-way function that maps data to a fixed-size value, used in hashing and security.
27
What is a unit test?
A test that checks a single function or component.
28
What is integration testing?
Testing how components work together (e.g., frontend and backend interaction).
29
What is mocking in testing?
Simulating parts of code (like APIs) so they don't run during tests.
30
What is a breakpoint?
A pause point in code used during debugging to inspect values and flow.
31
What is logging and why is it useful?
Recording runtime information for debugging and monitoring.
32
What is the cloud?
Remote servers and services used to store, process, and serve applications and data.
33
What is a virtual machine (VM)?
Software that emulates a computer system, running guest OS on top of a host.
34
What is a container vs VM?
Containers are lightweight, share the host OS, and run isolated processes; VMs run full OSes.
35
What is serverless computing?
A model where you run code without managing servers (e.g., AWS Lambda).
36
What is an API gateway?
A service that sits between clients and backend services, managing requests and routing.
37
What is a load balancer?
A system that distributes traffic across multiple servers for availability and performance.
38
What is horizontal scaling?
Adding more machines to handle increased load.
39
What is vertical scaling?
Upgrading a single machine’s resources (CPU, RAM) to handle more load.