What is the difference between == and = in most languages?
== compares values; = assigns a value.
What is the default port for HTTP?
80
SSH
Secure Shell
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
CSS
Cascading Style Sheets
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 a NAT used for?
Translating private IPs to public IPs
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.
fn square(x: i32) -> i32 {
x * x
}
fn main() {
let result = square(6);
println!("Result: {}", result);
}
Rust
What’s the difference between a thread and a process?
Threads share memory space; processes are isolated.
What is the difference between IPv4 and IPv6 addressing structure?
IPv4 uses 32-bit addresses; IPv6 uses 128-bit addresses
Hypertext Transfer Protocol Secure
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 method overloading?
Multiple methods with the same name but different parameter lists in the same scope.
How does ARP work?
It maps an IP address to a MAC address within a local network.
CORS
Cross-Origin Resource Sharing
What is 2NF?
Table is in 1NF and all non-key attributes are fully functionally dependent on the entire primary key.
func fibonacci(_ n: Int) -> Int {
if n <= 1 { return n }
return fibonacci(n - 1) + fibonacci(n - 2)
}
print(fibonacci(6))
Swift