InterviewStack.io LogoInterviewStack.io

Coding Fundamentals and Problem Solving Questions

Focuses on algorithmic thinking, data structures, and the process of solving coding problems under time constraints. Topics include core data structures such as arrays, linked lists, hash tables, trees, and graphs, common algorithms for searching and sorting, basics of dynamic programming and graph traversal, complexity analysis for time and space, and standard coding patterns. Emphasis on a disciplined problem solving approach: understanding the problem, identifying edge cases, proposing solutions with trade offs, implementing clean and readable code, and testing or reasoning about correctness and performance. Includes debugging strategies, writing maintainable code, and practicing medium difficulty interview style problems.

MediumTechnical
37 practiced
Given a list of intervals represented as pairs [start, end], implement in Python a function merge(intervals) that merges all overlapping intervals and returns the merged list sorted by start time. Example: [[1,3],[2,6],[8,10],[15,18]] -> [[1,6],[8,10],[15,18]]. Aim for O(n log n) time due to sorting.
HardTechnical
31 practiced
Given an n x n matrix where each row and column is sorted ascending, implement a Python function kthSmallest(matrix, k) to find the kth smallest element. Describe two approaches: using a min-heap merging rows with O(k log n) complexity and using binary search over value range with O(n log(range)) complexity; discuss tradeoffs and when one is preferable.
EasyTechnical
37 practiced
Implement iterative binary search in JavaScript. Given a sorted array of distinct integers nums and an integer target, write function function binarySearch(nums, target) that returns index of target or -1. Constraint: O(log n) time, O(1) space. Provide example: nums = [1,2,3,4,5], target = 3 -> 2. Explain invariants you maintain for left and right pointers.
EasyTechnical
39 practiced
Explain how hash tables handle collisions. Compare separate chaining to open addressing (linear probing), describe how deletion is handled in each, define load factor, and discuss effects on performance and memory usage. Provide scenarios where one approach is preferable.
EasyTechnical
43 practiced
Given two sorted singly linked lists, implement a C++ function ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) that merges them into a single sorted list and returns its head. Do this in-place without allocating new nodes (reuse the existing nodes) and explain both iterative and recursive approaches and their space usage.

Unlock Full Question Bank

Get access to hundreds of Coding Fundamentals and Problem Solving interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.