DSA / Arrays Interview Questions 2026

Published July 22, 2026 · Updated July 22, 2026

18 DSA / Arrays interview questions from Amazon, Microsoft, Flipkart, Swiggy, Zomato, Google, Meta, Netflix, Uber, Airbnb, Atlassian, TCS, PayU and more. Real questions from Technical, System Design, and HR rounds.

18 questions
Companies: Amazon, Microsoft, Flipkart, Swiggy…

All DSA / Arrays Questions

Flipkart Easy Screening round

Given a stock price array, find the maximum profit you can make with at most two buy-sell transactions. Discuss the DP state and how it generalizes to k transactions.

↑ 78 upvotes · 29 engineers asked this · SDE1
Swiggy Medium Technical round JavaPython

Given a list of delivery time windows for N restaurants, find the maximum number of restaurants whose windows overlap at any point in time. Explain the sweep-line approach, time complexity, and how this maps to capacity planning for Swiggy's logistics team.

↑ 78 upvotes · 29 engineers asked this · SDE1
Google Medium Technical round JavaPythonC++

Given a list of intervals, merge all overlapping intervals and return the result. Explain the sort-then-scan approach and the edge cases (touching intervals, single interval, all disjoint).

↑ 67 upvotes · 43 engineers asked this · SDE1
Airbnb Medium Technical round JavaPython

Given a list of bookings with start and end dates, find the minimum number of rooms needed so that no two overlapping bookings share a room. Explain the sweep-line and min-heap approaches.

↑ 63 upvotes · 42 engineers asked this · SDE1
Zomato Medium Technical round JavaPython

Given a list of restaurant ratings and a minimum threshold, return the top-k restaurants sorted by rating using a min-heap. Explain why a heap beats a full sort for large k, and the time complexity of both approaches.

↑ 61 upvotes · 22 engineers asked this · SDE1
PayU Medium Technical round 2–5 YearsInterview ExperienceJavaScriptJavaPython

Given an array of transaction amounts, find all pairs whose sum equals a given target. Return the count of unique pairs. For example: [100, 200, 300, 400], target = 500 → pairs: (100,400), (200,300) → count: 2. What is the time and space complexity of your approach?

↑ 61 upvotes · 42 engineers asked this · Full Stack Developer
Microsoft Easy Screening round JavaC#Python

Find all pairs in an array that sum to a given target value. Explain the HashSet approach for O(n) time, handle duplicate pairs correctly, and discuss edge cases (negative numbers, empty array).

↑ 55 upvotes · 37 engineers asked this · SDE1
Amazon Medium Technical round JavaPythonJavaScript

Given an array of integers and a target sum, return all unique triplets that sum to the target. Discuss time and space complexity. Then extend the problem to k-sum and analyze how recursion depth changes performance for large k.

↑ 54 upvotes · 47 engineers asked this · SDE2
Meta Medium Technical round PythonJavaJavaScript

Given an array of N integers, find the maximum product subarray. Explain why you need to track both the maximum and minimum product ending at each position, and handle zeros and negative numbers.

↑ 52 upvotes · 33 engineers asked this · SDE1
Amazon Medium Technical round JavaPython

Given an array of integers, find the length of the longest subarray with a sum equal to zero. Explain the prefix sum + HashMap approach and why the naive O(n2) solution is unacceptable for large inputs.

↑ 51 upvotes · 32 engineers asked this · SDE1
TCS Medium Technical round Java

Write a Java program to rotate a matrix 90 degrees clockwise in-place. Explain the transpose-then-reverse approach and why it is O(n2) time with O(1) extra space.

↑ 49 upvotes · 30 engineers asked this · SDE1
PayU Medium Technical round 2–5 YearsInterview ExperienceJavaScriptJava

You have an array of daily payment failure counts for the past 30 days. Find the longest contiguous subarray where failures stayed below a given threshold k. Explain your sliding window approach and walk through the algorithm step by step.

↑ 48 upvotes · 33 engineers asked this · Full Stack Developer
Netflix Medium Technical round PythonJava

Given a list of movie ratings (1-5 stars) for N users, compute the Pearson correlation between two users to measure taste similarity. Explain how this feeds into collaborative filtering.

↑ 44 upvotes · 27 engineers asked this · SDE1
PayU Medium Technical round 2–5 YearsInterview ExperienceJavaScriptJavaPython

Given a 2D matrix representing a payment heatmap (rows = hours, columns = days), find the submatrix with the maximum sum. The submatrix represents the peak payment activity window. Describe your approach — can you do better than O(n³)?

↑ 44 upvotes · 29 engineers asked this · Full Stack Developer
Microsoft Medium Technical round

Given a matrix of 0s and 1s, find the largest rectangle containing only 1s and return its area. Walk through the histogram-based O(n*m) solution and discuss why the naive O(n2*m2) approach is unacceptable at scale.

↑ 43 upvotes · 38 engineers asked this · SDE2
Uber Medium Technical round JavaPython

Given a list of GPS coordinates representing a driver's path, compute the total distance travelled. Then find the longest contiguous segment where the driver was stationary (speed < 5 km/h). Discuss floating-point precision issues.

↑ 42 upvotes · 26 engineers asked this · SDE1
Atlassian Medium Technical round JavaPython

Given a list of Jira sprint start/end dates, find all sprints that overlap with a given date range. Implement an efficient solution using interval trees or sorted arrays with binary search.

↑ 42 upvotes · 25 engineers asked this · SDE1
Swiggy Medium Technical round JavaPython

Given delivery time estimates for N restaurants, find the restaurant with the minimum average delivery time across all its orders. Handle ties and explain your data structure choices.

↑ 41 upvotes · 24 engineers asked this · SDE1

Practice these questions with AI feedback

Get instant grading on your answers, identify your weak areas, and generate a personalised 14-day study plan — all free.

Build my study plan →

Same topic at specific companies

Amazon DSA / Arrays Microsoft DSA / Arrays Flipkart DSA / Arrays Swiggy DSA / Arrays Zomato DSA / Arrays Google DSA / Arrays Meta DSA / Arrays Netflix DSA / Arrays Uber DSA / Arrays Airbnb DSA / Arrays

Related topics

System Design DSA / Trees DSA / Graphs Behavioral Testing Domain DevOps API Testing DSA / Hashmaps GCP / Real-time Data Java / Pub-Sub React / Performance Node.js / Memory SQL / Query Optimization Python / Async AWS / Lambda Kafka / Consumer Microservices / Saga Pattern TypeScript / Type System MongoDB / Indexing Security / SQL Injection Performance / Latency Tail Redis / Cache Stampede Elasticsearch / Cluster Health GraphQL / Security Data Engineering / Exactly Once Snowflake / Architecture PySpark / Core Concepts Airflow / Scheduling Web / WebAssembly Debugging / Production JavaScript / V8 Engine

Frequently asked questions

Given a stock price array, find the maximum profit you can make with at most two buy-sell transactions. Discuss the DP state and how it generalizes to k transactions.
Given a stock price array, find the maximum profit you can make with at most two buy-sell transactions. Discuss the DP state and how it generalizes to k transactions.
Given a list of delivery time windows for N restaurants, find the maximum number of restaurants whose windows overlap at any point in time.
Given a list of delivery time windows for N restaurants, find the maximum number of restaurants whose windows overlap at any point in time. Explain the sweep-line approach, time complexity, and how this maps to capacity planning for Swiggy's logistics team.
Given a list of intervals, merge all overlapping intervals and return the result.
Given a list of intervals, merge all overlapping intervals and return the result. Explain the sort-then-scan approach and the edge cases (touching intervals, single interval, all disjoint).
Given a list of bookings with start and end dates, find the minimum number of rooms needed so that no two overlapping bookings share a room. Explain the sweep-line and min-heap approaches.
Given a list of bookings with start and end dates, find the minimum number of rooms needed so that no two overlapping bookings share a room. Explain the sweep-line and min-heap approaches.
Given a list of restaurant ratings and a minimum threshold, return the top-k restaurants sorted by rating using a min-heap.
Given a list of restaurant ratings and a minimum threshold, return the top-k restaurants sorted by rating using a min-heap. Explain why a heap beats a full sort for large k, and the time complexity of both approaches.