Interactive problems are a special class of coding challenges where your program communicates with a judge during execution instead of receiving all input at once. Instead of reading a full dataset, your solution sends queries and receives responses, gradually discovering the information needed to compute the final answer.
These problems are common in competitive programming and occasionally appear in advanced technical interviews because they test more than just algorithms. They evaluate your ability to design efficient query strategies, handle input/output carefully, and reason under constraints where information is partially hidden.
Solving interactive problems often involves combining several core algorithmic ideas. For example, Binary Search is frequently used to minimize the number of queries when locating hidden values. Some problems require modeling relationships using Graph structures, while others simulate system behavior through controlled queries using techniques similar to Simulation. In certain cases, randomized strategies inspired by Randomized algorithms can help reduce the expected number of interactions.
Practicing interactive questions helps you develop disciplined debugging habits, careful I/O handling, and strategic thinking about information gathering. With consistent practice, you'll learn how to design query-efficient solutions that work reliably within strict interaction limits.
Some interactive challenges model unknown relationships or structures that must be explored like a graph.
Randomized strategies can reduce expected queries and help discover hidden information efficiently.
Helps you reason about how the judge responds and how your program should react step by step.
Often used to minimize the number of queries when narrowing down hidden values in interactive problems.
| Status | Title | Video | Leetcode | Solve | Difficulty | Companies | Topics |
|---|---|---|---|---|---|---|---|
| 277. Find the Celebrity | Solve | Medium | Amazon+5 | ||||
| 702. Search in a Sorted Array of Unknown Size | Solve | Medium | Google+1 | ||||
| 1236. Web Crawler | Solve | Medium | Bloomberg+2 | ||||
| 1237. Find Positive Integer Solution for a Given Equation | Solve | Medium | Google | ||||
| 1428. Leftmost Column with at Least a One | Solve | Medium | Facebook+2 | ||||
| 1533. Find the Index of the Large Integer | Solve | Medium | Amazon | ||||
| 1538. Guess the Majority in a Hidden Array | Solve | Medium | Google | ||||
| 1618. Maximum Font to Fit a Sentence in a Screen | Solve | Medium | Google | ||||
| 1778. Shortest Path in a Hidden Grid | Solve | Medium | Facebook | ||||
| 1810. Minimum Path Cost in a Hidden Grid | Solve | Medium | Facebook+1 | ||||
| 2782. Number of Unique Categories | Solve | Medium | Amazon | ||||
| 2936. Number of Equal Numbers Blocks | Solve | Medium | Google | ||||
| 3064. Guess the Number Using Bitwise Questions I | Solve | Medium | - | ||||
| 3094. Guess the Number Using Bitwise Questions II | Solve | Medium | - |
Start Easy, progress to Hard.
Frequently appear alongside Interactive.
Common questions about Interactive.
You typically simulate the judge locally using a custom script or debug logs. Printing intermediate steps and verifying query formats helps ensure the interaction protocol is correct.
They require careful control of input/output, efficient query strategies, and reasoning with incomplete information. Small mistakes like missing flush operations or exceeding query limits can cause failures.
Practicing 15–25 well-chosen interactive problems is usually enough to understand common patterns. Focus on learning query optimization and proper I/O handling.
Interactive problems require your program to communicate with a judge during execution by sending queries and reading responses. Instead of full input upfront, you gather information step by step to compute the final result.
Binary search, graph exploration, greedy strategies, and randomized approaches are commonly used. The goal is usually to minimize the number of queries needed to reveal hidden data.