Loading…
Find Pivot Index is a easy coding interview question covering arrays — the kind asked at FAANG (Facebook/Meta, Apple, Amazon, Netflix, Google) and AI-first companies like Anthropic, OpenAI, and Nvidia.
Given an integer array nums, return the pivot index: the leftmost index where the sum of all numbers to the left equals the sum of all numbers to the right.
Example: [1,7,3,6,5,6] -> 3 (left sum=11, right sum=11) Example: [1,2,3] -> -1 (no pivot) Example: [2,1,-1] -> 0 (left sum=0, right sum=0)
If no pivot exists return -1. Use O(n) time and O(1) space.
Solution walkthrough on Pro
Upgrade to Pro to unlock the guided hints, the step-by-step walkthrough, solutions in Python, C++, Java, and Go, and complexity analysis.
What's inside this guide
Fully unlocked, no account needed — solutions, walkthroughs and follow-up answers included.
Or start the Study Plan — a week-by-week order for your loop, and week 1 is entirely free.
A full interview loop is more than one round. These are the others, each with what is on the site for it.