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.

MediumTechnical
0 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.
HardSystem Design
0 practiced
Design a clean, maintainable codebase layout for an ML model serving microservice that supports model versioning, A/B/canary deployments, rollback, dependency isolation, and logging. Describe directory structure, module boundaries (API, model loading, preprocessing, feature client, utils), packaging, and CI checks to enforce code quality before deployment.
EasyTechnical
1 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).
MediumTechnical
0 practiced
Implement `sliding_window_max(nums: List[int], k: int) -> List[int]` in Python to compute the maximum in each contiguous window of size `k` using O(n) time. Example: `nums=[1,3,-1,-3,5,3,6,7]`, `k=3` -> `[3,3,5,5,6,7]`. Explain how the deque is maintained.
HardTechnical
0 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.