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.

HardSystem Design
49 practiced
Propose a comprehensive testing strategy for ML projects covering unit tests for preprocessing and model ops, integration tests for end-to-end pipelines, model regression tests (accuracy/metric baselines), performance/throughput benchmarks, and reproducibility checks across hardware. Explain required tooling and CI practices to enforce this strategy.
MediumTechnical
27 practiced
Given a list of dictionaries representing dataset rows like `[{'label': 'cat', 'value': 10, 'count': 3}, ...]`, write Python code to group by label and compute weighted average value using the sample counts. Focus on readability, correctness, and efficient use of built-in constructs.
MediumTechnical
25 practiced
Implement a thread-safe counter class in modern C++ that supports atomic increment and read operations with minimal overhead. Provide both an atomic-based implementation and a mutex-based implementation and explain tradeoffs between them, especially under high contention.
EasyTechnical
42 practiced
Given this Python function, refactor it into smaller functions and improve naming, error handling, and performance. Explain each change and why it improves readability and maintainability: `def process(data): for i in range(len(data)): if data[i] is None: data.pop(i) else: data[i] = data[i].strip().lower() result=[] for x in data: if x not in result: result.append(x) return result`
HardTechnical
24 practiced
Design and implement an external merge sort (in Python or pseudocode) to sort a dataset that does not fit in RAM. Explain how you choose run sizes given available memory, how to perform multiway merge efficiently, how to minimize disk seeks, and how to recover or resume after failures.

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.