Real interviews keep going. Your tutor listens to your answer, asks the next question, and helps you make your thinking clear.
Tutor
00:03Why would you use Redis in this system?
You
00:09To cache session data and take read load off Postgres.
Tutor
00:14What happens to sign-in when Redis drops at peak?
Short coding questions, clear explanations, and a little more confidence each time you practise.
// Two Sum — one pass, O(n)function twoSum(nums, target) {const seen = new Map();for (let i = 0; i < nums.length; i++) {const need = target - nums[i];if (seen.has(need)) {return [seen.get(need), i];}seen.set(nums[i], i);}return [];}
Why a hash map instead of two loops?
The nested version checks every pair, which is O(n²). Storing what you have already seen turns the lookup into one hash probe, so the whole scan is O(n).
What is `need` actually holding?
The complement — the number that would complete the pair. Rather than search for it, you ask the map whether you have passed it already.
Why store the value after the check?
Checking first means an element can never match itself. Store before the check and `[3, 3]` with a target of 6 returns the same index twice.
Get a quick answer first. When you want a person, we connect you with someone who has already solved it.
You hit a wall. That’s where we start.
Tell your tutor what you tried and where it stopped making sense. They meet you at the exact point you’re stuck.
Bring your experience, practise the story, and start your next conversation with a plan.