What does a semicolon ; do in Java or JavaScript?
It ends a statement
Which is loosely typed — Java or JavaScript?
JavaScript
What’s a boolean expression?
A statement that evaluates to true or false
What does a compiler do?
Translates source code into machine code
Which programming language has a logo with a coffee cup?
Java
What keyword is used to define a function in Python?
def
Between Python and Java, which one usually requires declaring variable types?
Java
What’s a common structure for storing key-value pairs?
Dictionary or Object
What’s the difference between compiling and interpreting?
Compiling runs all at once, interpreting runs line by line
What does HTML stand for?
HyperText Markup Language
Why does true == "true" return false in most languages?
"true" is a string, not a Boolean
Which language is most commonly used for data science?
Python
You want to store 100 student scores. What data structure is best?
List or array
What’s the difference between a syntax error and a runtime error?
A syntax error happens when code breaks language rules and won’t compile/run. A runtime error occurs during execution, like dividing by zero.
What tool helps you collaborate and track code changes with your team?
Git or GitHub
What do you call code inside {} in C-based languages?
A code block or scope
In Java, which keyword is used to define a constant value, and how does it differ from a regular variable?
final — a constant cannot be reassigned once initialized, unlike regular variables.
What’s the difference between an array and a list?
Arrays are often fixed-size, lists are flexible
What happens when a program has a stack overflow?
Too many nested function calls overflow memory — usually due to infinite recursion
What’s a “Rubber Duck Debugging” method?
Explaining your code out loud to something to find bugs (a rubber duck)
What’s recursion, and how does it differ from iteration?
Recursion is a function calling itself to solve smaller instances of a problem; iteration uses loops. Recursion uses the call stack and can be less efficient if not handled properly.
Explain how garbage collection differs in Python and C++.
Python uses automatic garbage collection (via reference counting and a garbage collector), while C++ requires manual memory management with new and delete.
What sorting algorithm is known for its "divide and conquer" approach?
QuickSort or MergeSort
What is the stack used for in program execution?
To keep track of function calls and local variables — it grows with each call and shrinks when functions return.
What was the first computer bug — and where did it come from?
A moth found in a Harvard Mark II computer in 1947 — literally causing a hardware malfunction. Grace Hopper popularized the term "debugging" from this event.