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
30 practiced
You receive a flaky test that fails 1% of runs due to nondeterministic ordering of items in a dictionary-based result. How do you diagnose and fix the test and the underlying code to avoid relying on dictionary ordering? Provide code examples or test assertions to make results deterministic.
MediumTechnical
26 practiced
Implement a function in Python to find the longest substring without repeating characters. State complexity and explain how your sliding window or two-pointer approach works. Discuss how your approach performs on very long strings and memory tradeoffs when storing indices.
MediumTechnical
31 practiced
You are given a poorly documented Python function that processes numeric arrays and sometimes returns NaN silently for certain inputs. Describe a systematic debugging strategy to isolate the input patterns that cause NaN, including writing tests, adding assertions, and instrumentation you would add before making changes to the algorithm.
MediumBehavioral
28 practiced
You find a function in a teammate's data cleaning script that swallows exceptions and returns None on any error. Describe your approach to code review feedback to improve error handling and ensure issues are visible in production, while being respectful and actionable.
HardTechnical
29 practiced
Explain race conditions, deadlocks and livelocks with concrete examples in multithreaded code. Then describe a strategy to detect and eliminate a subtle race in a feature cache update during concurrent model serving, including tests you would write.

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.