Start with a problem small enough to explain

Practice this task: given a list of integers, return true if any value appears more than once, otherwise return false. Clarify the input and output before coding. Can the list be empty? Are negative values allowed? Do you need to preserve input order? For this exercise, assume an empty list returns false, integers may be negative, and you only need a boolean result. This is a general exercise, not a claim about a particular employer’s question bank.

Explain the baseline before the improvement

A direct approach compares every pair of values. In the worst case, that checks a quadratic number of pairs and uses constant extra space. Explain why it works, then identify the cost: the same values get compared repeatedly. A set-based approach keeps track of values already seen. Before inserting each value, check whether it is present; if so, return true. If the scan finishes, return false. With typical hash-set operations, expected time is linear and extra space is linear in the number of distinct values. State that assumption instead of describing the time bound as unconditional.

Walk through the state, not every line

Use [4, 1, 4] as a walkthrough. Start with an empty set. The first 4 is new, so store it. The 1 is new, so store it. The next 4 is already present, so return true. The key invariant is that the set contains exactly the values encountered earlier in the scan. That tells the listener why checking membership detects a duplicate. For [4, 1, 9], the scan ends without a repeat and returns false. Keep the explanation tied to what changes in the data structure.

Practice a short answer out loud

Try this structure in your own words: “I’ll first confirm what counts as a duplicate and whether I can use extra memory. Comparing pairs is correct but takes quadratic time. I can scan once and store previously seen values in a set. If a value is already in the set, I have found a duplicate. Otherwise I add it and continue. Under usual hash-set assumptions that gives expected linear time, using linear extra space. I would test an empty list, a single element, all distinct values, and a repeated value at the beginning or end.” Then explain the same solution again without reading the paragraph.

Use an AI interviewer to change the constraint

Give your practice assistant this prompt: “Ask me to explain duplicate detection in a list of integers. Do not give me the solution. Ask one follow-up at a time about correctness, complexity assumptions, edge cases, or memory constraints. After I answer, point to the exact claim that needs clarification. Change one constraint after the first explanation.” Useful follow-ups include: what if memory is limited, what if the input is already sorted, and what if you must report the repeated values rather than return a boolean? For a sorted list, adjacent comparisons can detect repetition in linear time with constant extra space. Sorting an unsorted list changes the trade-off and may alter the input.

Review understanding rather than fluency

Ask a human reviewer to mark whether they understood the problem, why the algorithm is correct, which complexity assumptions you made, and what changes under a new constraint. If you used words such as “efficient” or “optimal,” ask whether you actually supported the claim. Record one explanation, review it, and repeat with one targeted improvement. Progress is being able to adapt and defend the approach, not delivering a memorized paragraph faster.

Your rehearsal scorecard

After a spoken attempt, mark what a listener could follow. Use “Needs work” to choose the next drill. These ratings are practice notes, not a hiring prediction.

Notes stay in this page and are not submitted. Reloading clears them.

Download practice worksheet

Practice with personal feedback.

Discuss your target role and interview timeline. We can review which training exercises fit your goals.

Request interview coaching

Another practice guide

Job Interview Speaking Practice: AI Rehearsal with Human CoachingTrue Stealth Interview Copilot: Hardware vs Software & OS-Level StealthSales Engineer Mock Discovery Interview Practice with AIAccount Executive STAR Interview Practice with AI and Human FeedbackTechnical Interview Copilot: Hardware-Level Stealth & Human Training