TEKION Hiring Challenge | Efficient Sequence Detection Using Hash-Based Lookup Optimization | SDE OA (2024)

Tekion · Question · Posted Jun 2026

Q1. Longest Consecutive Elements Sequence Problem Statement Given an unsorted integer array nums, return the length of the longest sequence of consecutive integers. A consecutive sequence consists of numbers that appear one after another without gaps. Your solution must run in: O(n) time complexity. Example 1 Input nums = [100,4,200,1,3,2] Output 4 Explanation The consecutive sequence is: 1, 2, 3, 4 Length: 4 Example 2 Input nums = [0,3,7,2,5,8,4,6,0,1] Output 9 Explanation The longest consecutive sequence is: 0,1,2,3,4,5,6,7,8 Length: 9 ...

The full answer & interview discussion are available to premium members.

Log in Create a free account