InterviewStack.io LogoInterviewStack.io

Programming Fundamentals Questions

Language-agnostic building blocks of writing code: variables, primitive and composite data types, scope and lifetime, functions and callbacks, control flow, and expressions versus statements. Covers the mental model a candidate needs before any language-specific or algorithmic depth. The baseline literacy layer of a technical screen.

MediumTechnical
91 practiced

Compare the four core built-in container/data types available in most high-level languages (for example Python's list, tuple, set, and dict): describe their mutability, ordering guarantees, typical time complexity for lookup/insert/delete, and when you would reach for each one.

MediumTechnical
83 practiced

You find a function that catches every exception and silently returns None on any error (a bare except that swallows the failure). What can go wrong with this pattern in production, and what should replace it? Describe the technical fix (which exceptions to actually catch, how to preserve the failure signal) before considering how you'd raise it with the author.

EasyTechnical
91 practiced

Explain the difference between stack and heap memory: what gets allocated where, how variable lifetime differs between the two, and what common pitfalls arise (for example a dangling reference in an unmanaged language, or an object staying reachable longer than intended in a managed one).

EasyTechnical
97 practiced

Explain the difference between a shallow copy and a deep copy. How does plain assignment differ from copying? Walk through what a shallow-copy utility and a deep-copy utility each do to a nested structure (for example a list of lists), and give a concrete example of a bug that a shallow copy of nested/mutable data can silently cause.

MediumTechnical
98 practiced

What is a closure, and what does it capture from its enclosing scope? Explain, with a small code example, how a closure or a callback holding a reference can keep an object alive longer than expected (for example through a reference cycle), and describe a practical strategy to avoid or detect that kind of memory retention in a long-running process.

Unlock Full Question Bank

Get access to all 12 Programming Fundamentals interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.