Algorithmic Problem Solving Fundamentals Questions
Core foundation for solving entry level algorithmic problems. Focuses on arrays, strings, basic mathematics and number theory problems, simple bit manipulation, basic linked list and tree operations, stacks and queues, basic sorting and searching algorithms, simple recursion, and use of hash based data structures for counting and lookup. Emphasizes understanding asymptotic time and space complexity, selecting appropriate data structures for a task, and clear step by step problem solving including writing a brute force solution and analyzing correctness.
EasyTechnical
60 practiced
Given a string s, return the index of the first non-repeating character in it. If it does not exist, return -1. Implement in Python or Java in O(n) time and discuss space trade-offs. Examples: 'leetcode' -> 0, 'loveleetcode' -> 2. Also describe a streaming variant where characters arrive one by one.
EasyTechnical
54 practiced
Given the head of a singly linked list, reverse the list and return the new head. Implement an iterative solution in your preferred language and explain invariants during iteration. Example: 1->2->3->4->NULL becomes 4->3->2->1->NULL. Achieve O(n) time and O(1) extra space and analyze complexity.
EasyTechnical
56 practiced
You are given two sorted integer arrays nums1 and nums2, where nums1 has a length of m + n with the first m elements valid and the last n elements set to 0 as placeholders. Merge nums2 into nums1 in-place to produce one sorted array. Implement in C++ or Python, achieve O(m+n) time and O(1) extra space, and explain your pointer strategy.
HardTechnical
56 practiced
Design serialize and deserialize functions for a Binary Search Tree that produce a compact representation smaller than naive null-marked BFS strings. Implement serialization using preorder traversal without storing null markers, and reconstruct the BST during deserialization using bound constraints. Provide Python code and explain correctness and compactness.
EasyTechnical
41 practiced
Given a string containing parentheses characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. A string is valid if brackets are closed in the correct order and match types. Implement in Java or Python and analyze time/space complexity. Examples: '()[]{}' -> true, '(]' -> false.
Unlock Full Question Bank
Get access to hundreds of Algorithmic Problem Solving Fundamentals interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.