に聞いたの

asked …?

→ に
phrase Uncommon #16,693
asked …? に marks the person being asked. の makes this a casual question; 聞く can also mean “hear,” depending on context.
JA: 先生に聞いたの?
EN: Did you ask the teacher?

なぜ大佐に聞いたの?

Why did you ask the colonel?

— ア・フュー・グッドメン (1992)

「奥さんに聞いたの?」

Did you ask your wife?

トムに聞いたの?

Did you ask Tom?

彼はもうあなたに聞いたの?

Has he asked you yet?

— ウィキッド ふたりの魔女 (2024)

誰に聞いたの?

Who did you hear that from?

— 箪笥<たんす> (2003)

マルファばあちゃんに聞いたの?

Did you ask Grandma Marfa?

— 動くな、死ね、甦れ! (1990)

そのやり方、誰に聞いたの?

Who did you learn that method from?