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
30 practiced
Given a string s, implement a function in Python that returns the index of the first non-repeating character. If none exists, return -1. Aim for O(n) time and O(1) extra space assuming a fixed alphabet; then explain tradeoffs if the alphabet is large (Unicode) and how you'd adapt. Examples: 'leetcode' -> 0, 'loveleetcode' -> 2.
EasyTechnical
25 practiced
Explain the differences between arrays and singly linked lists: memory layout (contiguous vs node-based), random access costs, insertion/deletion costs at head/middle/tail, cache locality effects, and practical scenarios where you would choose one over the other. Include how real-world allocator behavior and resizing of dynamic arrays affects performance.
EasyTechnical
33 practiced
Describe how a hash table (hash map/dictionary) works internally. Explain common collision-resolution strategies (separate chaining, open addressing variants like linear/quadratic probing and double hashing), trade-offs, average and worst-case lookup complexity, and how resizing (rehashing) is typically implemented.
EasyTechnical
27 practiced
List and explain the time and space complexity (Big-O) for these common operations: array index access, appending to a dynamic array (amortized), inserting into a linked list, hash map lookup/insert, binary search, and a typical tree traversal. Include note about recursive algorithms and their stack space usage.
MediumTechnical
30 practiced
Implement breadth-first traversal (BFS) for a graph represented as an adjacency list in Python. The function should accept a start node and return nodes visited in BFS order. Discuss how to handle disconnected graphs, very large graphs, and memory considerations for the visited set.

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.