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
33 practiced
Given an array of integers, implement a Java method boolean containsDuplicate(int[] nums) that returns true if any value appears at least twice and false if every element is unique. Aim for O(n) time and O(n) additional space. Discuss trade-offs if input is sorted, immutable, or memory constrained.
MediumTechnical
27 practiced
Implement a RollingAverage class in Python that maintains the average of timestamped samples within a sliding window of window_seconds. API: add(timestamp: float, value: float) and average(now: float) -> float. Implementation should be O(1) amortized per update and O(k) memory where k is number of samples in window. Discuss bursty input handling and clock skew.
MediumTechnical
28 practiced
Design and implement a cache in Python that supports get/put, per-key TTLs, and LRU eviction when capacity is exceeded. Ensure expired keys do not count toward capacity. Describe complexity and how you handle clock skew and concurrent access if used by multiple threads.
MediumTechnical
33 practiced
Implement a Python function follow(path: str, callback: Callable[[str], None]) that yields or callbacks new lines appended to a log file and correctly handles log rotation (file renamed and new file created). Explain handling of inode changes, truncation, and edge cases like rapid rotations.
HardTechnical
28 practiced
You inherit an on-call script with global state and no tests. Describe a concrete refactoring plan to improve testability and maintainability: identify seams, extract pure functions, introduce dependency injection for external effects, add unit tests and integration tests, and migrate configuration to structured formats. Include before/after code sketches and a rollout strategy.

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.

40+ Programming Fundamentals and Code Quality Interview Questions & Answers (2026) | InterviewStack.io