Oracle/SMTS/IC3
- Posted
- 18 Aug 2025
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.
How it went
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.
Questions asked (1)
- 01
Biological Hazards
Data Structures & Algorithms
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
allergicandpoisonousof equal lengthm, 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:
4Explanation:
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