Qualcomm SDE Interview Question 2024 March | Advanced Pattern Matching | On-campus

Qualcomm · Question · Posted Jun 2026

Question 1: Find the Index of the First Occurrence in a String Problem Statement Given two strings needle and haystack, return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Crucial Constraint: You are not allowed to use built-in string searching functions (like indexOf or contains). You must implement an algorithm that runs in strictly O(N) linear time. Constraints 1 <= haystack.length, needle.length <= 105 haystack and needle consist of ...

The full answer & interview discussion are available to premium members.

Log in Create a free account