What is the difference between == and = in most languages?
== compares values; = assigns a value.
What is the default port for HTTP?
80
CSS
Cascading Style Sheets
What command is used to remove a table and all its data?
DROP TABLE
def factorial(n):
if n == 0:
return 1
return n * factorial(n - 1)
print(factorial(5))
Python
What does “recursion” mean in programming?
A function calling itself to solve smaller instances of a problem.
What does DNS do?
Translates domain names to IP addresses
HTTPS
Hypertext Transfer Protocol Secure
What clause is used to filter groups created by GROUP BY?
HAVING
for file in *.txt; do
echo "Found $file"
done
Bash
What’s the difference between mutable and immutable types?
Mutable can be changed after creation; immutable cannot.
What is the difference between TCP and UDP?
TCP is reliable/connection-oriented; UDP is fast/connectionless
ACID
Atomicity, Consistency, Isolation, Durability
What’s the difference between DELETE and TRUNCATE
DELETE is row-by-row and can use WHERE; TRUNCATE removes all rows instantly, no WHERE, resets identity.
func fibonacci(_ n: Int) -> Int {
if n <= 1 { return n }
return fibonacci(n - 1) + fibonacci(n - 2)
}
print(fibonacci(6))
Swift
What is the difference between "Deep Copy" and "Shallow Copy"?
Shallow copy only copies references to objects; deep copy creates a new instance and recursively copies all nested objects.
What is the difference between IPv4 and IPv6 addressing structure?
IPv4 uses 32-bit addresses; IPv6 uses 128-bit addresses
REST
Representational State Transfer
What isolation level prevents dirty reads but allows non-repeatable reads
READ COMMITTED
section .data
msg db 'Hi!', 0xA
len equ $ - msg
section .text
global _start
_start:
mov eax, 4
mov ebx, 1
mov ecx, msg
mov edx, len
int 0x80
mov eax, 1
xor ebx, ebx
int 0x80
Assembly
What is the difference between "Strong Typing" and "Weak Typing"?
Answer: Strong typing prevents the language from performing operations on mismatched types. Weak typing allows implicit type conversion to make the operation work.
How does ARP work?
It maps an IP address to a MAC address within a local network.
RAID
Redundant Array of Independent Disks
What is 2NF?
Table is in 1NF and all non-key attributes are fully functionally dependent on the entire primary key.
fn square(x: i32) -> i32 {
x * x
}
fn main() {
let result = square(6);
println!("Result: {}", result);
}
Rust