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
26 practiced
Implement `binary_search(arr: List[int], target: int) -> int` in Python that returns the index of target in a sorted ascending array or -1 if not found. Provide an iterative implementation, explain boundary conditions (duplicates) and off-by-one pitfalls, and state time and space complexity.
HardSystem Design
24 practiced
Design a robust checkpointing strategy for long-running distributed training jobs. Cover atomic checkpoint writes, consistency across workers, handling partial failures, metadata/versioning, checkpoint frequency vs overhead, and how to resume training after node failures minimizing lost work.
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.
MediumTechnical
27 practiced
Given `nums: List[int]` and integer `k`, implement `top_k_frequent(nums, k)` in Python that returns the k most frequent elements. Aim for O(n log k) or better. Explain trade-offs between using a heap and bucket sort, and discuss handling ties.
HardTechnical
33 practiced
You manage several ML teams with a growing codebase and mounting technical debt. Propose a staged plan to enforce code quality: linters/formatters, type hints, pre-commit hooks, unit/integration tests, CI gating, code review standards, and measurable ways to reduce debt without stalling product delivery.

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.