Oracle Application Software Developer

oracle logo
oracle
application software developer
May 19, 202428 reads

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.

Full Experience

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.

Interview Questions (1)

Q1
Longest Consecutive Sequence in Unsorted Array
Data Structures & AlgorithmsHard

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, 5 is the longest consecutive sequence. The count is 7, so the output is 7.

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!