Oracle/SMTS/IC3
Summary
I recently interviewed at Oracle for an SMTS IC3 role where I was asked a specific algorithmic problem called 'Biological Hazards' which involved analyzing bacteria interactions.
Full Experience
I recently had an interview at Oracle for an SMTS IC3 position. The interview revolved around a single, specific algorithmic problem. The problem, titled 'Biological Hazards', challenged me to analyze interactions between bacteria samples arranged in a row. The core task was to identify contiguous intervals where all bacteria could coexist without any being poisonous to another within that segment.
Interview Questions (1)
A biological researcher is studying bacteria interactions where certain bacteria are poisonous to others. The samples are arranged consecutively in a row, numbered from 1 to n.
You are given two integer arrays allergic and poisonous of equal length m, where:
poisonous[i]is poisonous toallergic[i].
Your task is to determine the number of contiguous intervals [l, r] within the row such that all bacteria in that interval are capable of coexisting (i.e., no bacterium in the interval is poisonous to another bacterium in the same interval).
Example 1
Input:
n = 3
allergic = [2, 1, 3]
poisonous = [3, 3, 1]
Output:
4
Explanation:
The bacteria are arranged as [1, 2, 3].
All possible intervals are: (1), (2), (3), (1,2), (2,3), (1,2,3).
Valid intervals are (1), (2), (3), (1,2).
Total valid intervals = 4