โ† HSBC questions
CodingReported in a candidate post, Feb 2021

Find first index of substring

Filed under HSBC

Given two strings, haystack and needle, return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related HSBC questions

Collected from public candidate posts and coding forums. Updated Nov 2026.