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
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
0 practiced
Review this Python function and propose fixes and improvements for production-readiness: def process(path): counts={} for line in open(path): obj=json.loads(line) counts[obj['key']]+=1 return counts Identify bugs, exceptions, performance issues, and provide a corrected implementation sketch that includes resource management, error handling, and testing ideas.
MediumTechnical
0 practiced
How do you choose linters and static analyzers for a mixed codebase with Python, Go, and Bash scripts? Discuss which classes of issues to catch with tooling (style, correctness, security), how to tune rules to balance noise vs value, and strategies for onboarding the team to new checks without slowing development.
MediumTechnical
0 practiced
Implement a Python decorator retry(max_attempts=5, backoff_base=0.5, jitter=True) that retries a function on transient exceptions using exponential backoff and optional jitter. Ensure you let callers specify which exceptions are retriable and explain how jitter strategy reduces thundering herd.
HardTechnical
0 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.