SWE Fundamentals Part 3 Flashcards
What is the difference between Python lists and tuples?
Lists are mutable, tuples are immutable.
How does Python handle memory management?
Using reference counting and cyclic garbage collection.
What does Python’s GIL (Global Interpreter Lock) do?
It prevents multiple threads from executing Python bytecode at once.
How does Java handle garbage collection?
Automatic GC using generational heap, including young and old generations.
What is a pointer in C++?
A variable that stores a memory address.
What is a null pointer?
A pointer that doesn’t point to any memory address (nullptr).
What is manual memory management in C++?
Using new
and delete
to allocate and free memory.
What is a segmentation fault?
An error caused by accessing invalid memory.
What are the four main memory segments in a C/C++ program?
Stack, heap, data, and code (text) segments.
What is a memory address?
A location in RAM where data is stored.
What happens when you compile C++ code?
It’s converted from source → assembly → machine code via compiler and linker.
What is bytecode in Java or Python?
Intermediate code run by a virtual machine (JVM or Python VM).
What is just-in-time (JIT) compilation?
Bytecode is compiled to native machine code at runtime for performance.
What is the browser rendering pipeline?
Parse HTML → construct DOM → apply CSS → build render tree → paint pixels.
What is the DOM?
Document Object Model – a tree representation of HTML used by browsers.
What is an event loop in JavaScript?
A system that handles async callbacks from the call stack and task queue.
What is the difference between synchronous and asynchronous code?
Sync blocks execution; async allows non-blocking operations like network calls.
What is a promise in JavaScript?
An object representing a value that may be available now, later, or never.
What is multithreading?
Executing multiple threads concurrently within a process.
What is multiprocessing?
Running multiple processes in parallel using separate memory spaces.
What is a race condition?
When the behavior of code depends on the timing of threads or processes.
What is a deadlock?
When two or more threads wait indefinitely for each other to release resources.
What is the difference between authentication and authorization?
Authentication verifies identity; authorization grants access to resources.
What is SQL injection?
A security vulnerability where malicious SQL is injected into queries.