InterviewStack.io LogoInterviewStack.io

Programming Fundamentals and Code Quality Questions

Encompasses core programming skills, data structures, basic algorithms, language fundamentals, and code quality practices. Expect proficiency with arrays, strings, lists, hash maps or dictionaries, sets, common collection operations, basic sorting and searching algorithms, and tradeoffs between data structures. Understand control flow, functions and modular design, classes and object oriented programming concepts including encapsulation, inheritance, and polymorphism, exception handling, file input and output, and common language idioms for mainstream interview languages such as Python, Java, and C plus plus. Emphasizes writing clean, readable, maintainable code: meaningful naming, modular functions, small interfaces, handling edge cases and errors, logging and documentation, simple testing and debugging strategies, and awareness of time and space complexity for common operations. Candidates should be able to implement correct solutions, follow language specific idioms where appropriate, and demonstrate attention to code quality and readability.

EasyTechnical
31 practiced
Explain the Python Global Interpreter Lock (GIL): what it is, why CPython has it, how it affects multi-threaded code, and practical guidance for an ML engineer on parallelizing CPU-bound vs I/O-bound tasks. Mention alternatives (multiprocessing, asyncio, native extensions).
MediumTechnical
33 practiced
Given a long, single-purpose Python function that mixes data loading, preprocessing, augmentation, and training steps, explain how you'd refactor it into modular, testable components. Give concrete suggestions for function/class boundaries, interfaces, dependency injection, and where to add unit and integration tests.
EasyTechnical
28 practiced
Compare memory management strategies in Python, Java, and C++: reference counting and cyclic GC in CPython, generational GC in Java, and manual allocation/RAII in C++. Discuss implications for ML workloads (large in-memory tensors, long-running services) and when explicit management is required (GPU memory).
EasyTechnical
25 practiced
In Python, implement `flatten(nested: List[List[Any]]) -> List[Any]` that flattens one level of nesting. Show an idiomatic one-line solution using list comprehensions and an alternative generator-based approach for large data to avoid materializing the full result.
MediumTechnical
24 practiced
You're processing a high-volume training data stream and must drop near-duplicates in real-time with limited RAM. Describe candidate data structures and algorithms (Bloom filters, Locality-Sensitive Hashing, min-hash), trade-offs (false positives/negatives), persistence, and how to handle recovery after a restart.

Unlock Full Question Bank

Get access to hundreds of Programming Fundamentals and Code Quality interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.