You need to find a substring in linear time and the interviewer will not accept a library call. What do you compute, and what goes wrong on a collision?
Rabin-Karp computes a polynomial hash of the pattern and a rolling hash of each text window, updated in constant time per step modulo a large prime. Equal hashes only nominate a candidate, so you compare characters before reporting it. Skip that check and a collision is a wrong answer; keep it and collisions cost time.