Recent interview experience with British Petroleum (BP) for Data Analyst Role (21 LPA)

Had an interesting experience in a recent interview with British Petroleum (BP) for a Data Analyst role that I felt was worth sharing.
One of the questions looked simple on the surface:
“In an array that increases and then decreases, how do you find the peak element - even if duplicates exist?”

Like many of us, my instinct immediately went to binary search.
But the twist was in the word: duplicates.
That completely changes the nature of the problem.

As I walked through it, I realized something important:
with plateaus or repeated values before the real peak, a binary search can’t always decide which direction is safe. No matter how smart the branching logic is, certain duplicate-heavy structures force you into a situation where you must scan more elements.
In simpler terms — not every problem that looks like it should be O(log n) can actually be solved that way.

And acknowledging that honestly is part of being a good analyst.
What I loved about this question is that it wasn’t just about coding.
It was about understanding:
the limits of algorithms,
how data patterns affect complexity, and
when it’s smarter to switch strategies instead of forcing an optimization.

Comments (1)