HomeInterview QuestionsAlgorithms Interview Questions

Algorithms Interview Questions

36 real Algorithms questions asked in live technical interviews — each with a model answer. Updated weekly.

🎤 Auto-captured by Assisting AI during live interviews

These Algorithms interview questions were captured from real interviews by candidates using Assisting AI. Each links to a full model answer. For real-time help during your own interview, get Assisting AI from ₹500/day.

Given a string s, write a Python function to find the length of the longest substring without repeating characters.🟡 Medium · Coding · Asked 10×What logic are you applying?🟢 Easy · Conceptual · Asked 7×What is a Python palindrome?🟢 Easy · Conceptual · Asked 6×Write code to check if a list is a palindrome.🟢 Easy · Coding · Asked 3×Given a list of words, return a list of booleans indicating whether each word has been seen before. Use a HashSet for O(1) lookups.🟢 Easy · Coding · Asked 1×Write a Python script that takes a string like '3a1b4j' and outputs 'aaabbjjj' by sorting the string and counting consecutive characters based on the numeric values.🟡 Medium · Coding · Asked 1×Write Python code to find the largest number in a list.🟢 Easy · Coding · Asked 1×Given an array arr[] of n integers and a target value, check if there exists a pair whose sum equals the target.🟡 Medium · Coding · Asked 1×You have a list of orders for a particular user. I want to remove duplicate orders. How would you do that?🟡 Medium · Coding · Asked 1×Define an array of integers and write a function to determine if any two elements sum to a target value of 20.🟡 Medium · Coding · Asked 1×Print all prime numbers between 100,000 and 191,000.🟡 Medium · Coding · Asked 1×Suppose you have a large dataset that does not fit into memory. How would you process that data?🟡 Medium · Conceptual · Asked 1×Use a prefix sum approach to find the partition points in one pass to split an array into three parts with equal sums.🟡 Medium · Coding · Asked 1×Use a two-pointer approach with prefix sums to find the split points in one pass for dividing an array into three equal-sum parts.🟡 Medium · Coding · Asked 1×Given an array of integers, find two indices that split the array into three contiguous parts with equal sums. Return the indices or -1 if it is impossible.🟡 Medium · Coding · Asked 1×Find the most occurring element and its frequency in an array.🟡 Medium · Coding · Asked 1×Given a list of customer purchase dates, identify customers who have not made a purchase on three consecutive dates.🟡 Medium · Coding · Asked 1×Which algorithm counts the occurrences of the characters 's', 'B', and 'C' in a given string?🟡 Medium · Coding · Asked 1×Provide a straightforward solution that does not use string functions.🟡 Medium · Coding · Asked 1×What sorting technique would you use to sort data?🟢 Easy · Conceptual · Asked 1×We have 10 teams. Each team will play against every other team, alternating home and away stadiums. How would you design a schedule for these matches?🟡 Medium · Conceptual · Asked 1×Return true if two strings match with only one swap.🟡 Medium · Coding · Asked 1×Given two strings, determine if they match exactly or can be made equal by swapping exactly one pair of characters in one of the strings. Return true if they match, false otherwise.🟡 Medium · Coding · Asked 1×Write a function that reads two input strings and returns true if they match exactly or if they can be made equal by swapping exactly one pair of characters in one of the strings; otherwise return false.🟡 Medium · Coding · Asked 1×Count how many times each word appears and show the result in a dictionary.🟡 Medium · Coding · Asked 1×Write code to find the longest common substring among the input list ['flower', 'floor', 'flow'].🟡 Medium · Coding · Asked 1×Find the longest common prefix among the strings ['flow', 'flower', 'floor'].🟢 Easy · Coding · Asked 1×There are 100 people standing in a single straight line, all facing forward. They cannot look back or around. They are wearing colored hats of different colors. What is the maximum number of people who can correctly guess their hat color?🟡 Medium · Conceptual · Asked 1×Why is it important to consider time and space complexity?🟢 Easy · Conceptual · Asked 1×What is time complexity?🟢 Easy · Conceptual · Asked 1×What is the time complexity of the code written?🟡 Medium · Conceptual · Asked 1×Find the index of the first repeating character in a string.🟡 Medium · Coding · Asked 1×Find the index of the first non-repeating character in a string.🟡 Medium · Coding · Asked 1×Write a function that returns the index of the first non-repeating character in a given string.🟡 Medium · Coding · Asked 1×Give the common elements from both datasets.🟡 Medium · Coding · Asked 1×Given the list list1 = [1, 2, 2, 3, 1, 4, 2, 3], find the frequency of each element without using existing functions.🟢 Easy · Coding · Asked 1×

🎤 Get Algorithms questions answered in real-time

Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers on a discreet on-screen overlay.

Get Assisting AI — Starts at ₹500

Browse Other Topics