Question bank › Two Pointers
Dsa Two Pointers Easy

Sensor Drift Correlation

Two sensors record timestamps of specific seismic events. Both sensors provide timestamps in sorted order. Due to positioning, timestamps for the same event might differ slightly. Your task is to find the minimum absolute time difference between any event recorded by Sensor A and any event recorded by Sensor B. Input Format: Line 1: Space-separated integers representing timestamps from Sensor A. Line 2: Space-separated integers representing timestamps from Sensor B. Output Format: A single integer representing the minimum absolute difference. Example: Input: 1 5 10 15 3 8 12 Output: 2 (Explanation: The closest pair is (1, 3) or (10, 12) or (10, 8), all have a difference of 2.)

Key concepts

two_pointerssearch

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.