Oracle Application Software Developer
- Posted
- 19 May 2024
Summary
During my interview for an Application Software Developer position at Oracle, I was asked to solve a problem involving finding the longest consecutive sequence in an unsorted array.
How it went
My interview experience for the Application Software Developer role at Oracle primarily focused on a technical question. The problem presented to me involved analyzing an unsorted array to determine the longest consecutive sequence within it, with specific constraints regarding sorting and duplicate handling.
Questions asked (1)
- 01
Longest Consecutive Sequence in Unsorted Array
Data Structures & Algorithms · Hard
Given an unsorted array, we have to find the length of the longest consecutive sequence.
Note: The solution should not sort the array or use any data structure which inherently sorts the array. The array may also contain duplicates, so each unique value should be counted only once.
Example:
Input:{100, 98, -1, 0, 99, 1, 3, 4, 2, 5, 67}
In this, the sequence-1, 0, 1, 2, 3, 4, 5is the longest consecutive sequence. The count is 7, so the output is 7.