Language Design and Abstraction
Python Programming
C Programming Concepts
Memory Management
Scope and Variable Semantics
100

What is the von Neumann architecture?

A stored-program architecture where computers execute sequential instructions stored in memory.

100

Are Python 2 and Python 3 interchangeable?

No, Python 2 and Python 3 are not interchangeable due to syntax and feature differences.

100

Why does C have less abstraction than modern languages?

It was designed when computational resources were scarce, requiring low-level memory management.

100

What are the three types of memory management?


What are the three memory allocation mechanisms?

Manual, Garbage Collection, Automatic Reference Counting

Static allocation, stack allocation, and heap allocation

100

What is the concept of scope in programming?

The textual region of a program where a variable's binding is valid.

200

What is abstraction in programming?

A feature of high-level languages allowing programmers to focus on "what" a program does rather than "how" it does it.

200

What is the key difference between a list and a tuple in Python?

Lists are mutable, while tuples are immutable.

200

What is a function prototype in C?

A declaration of a function's return type and parameters without the function body, used for single-pass compilation.

200

Why can’t languages using only static allocation support recursion?

Static allocation predefines memory at compile time, preventing dynamic function call stacks.

200

What happens when a local variable shadows a global variable?

The local variable hides the global variable within its scope.

300

What are the computational paradigms discussed in class?

Imperative, functional, object-oriented, and logic-based paradigms

300

How does Python handle deep and shallow copies?

Using copy.copy() for shallow copies and copy.deepcopy() for deep copies.

300

What are the two pointer operators in C?

The address-of operator (&) and dereference operator (*)

300

What is a lexical address in static scoping?

A reference composed of a level number and an offset to locate variables in nested blocks

300

What is a scope hole?

A region in code where a variable's declaration is inaccessible due to shadowing or other scoping rules.

400

How does a compiler differ from an interpreter?

A compiler translates the entire program to machine code before execution, while an interpreter translates and executes code line-by-line.

400

What is Python’s typing and binding paradigm?

Python uses dynamic typing and late binding, where types are determined at runtime.

400

How is the end of a string in C identified?

By a null terminator (\0)

400

What is the difference between stack and heap allocation?

Stack allocation is managed automatically and more efficient for local variables, while heap allocation provides dynamic memory for variable-sized data.

400

How does static binding differ from dynamic binding?

Static binding occurs at compile time, while dynamic binding happens during runtime.

500

What is a Just-In-Time (JIT) compiler?

A hybrid translation system that compiles code at runtime for optimized performance.

500

What is the syntax for inheritance in Python?

class Subclass(SuperClass1, SuperClass2, ...):

500

What is a dangling reference?

A pointer that refers to a memory location that has been deallocated.

500

What is garbage in memory management?

Unused memory that has been allocated but is no longer referenced.

500

Why is scoping important in programming?

It prevents naming conflicts and helps organize code by controlling variable visibility.