Whodunit (trope)
From Book Trigger Warnings
The "Whodunit" trope is when a crime occurs (often a murder) and the characters seek to discover what happened. Usually, the reader is also unaware of the solution.
For a list of books on BTW with this trope, click here.