let x = ref 100 in
let f () = !x in
let x = ref 50 in
??? ; f ()
You are supposed to get the answer to be 50 by plugging something into the ??? (not shadowing). But I don’t know how to change the value of your original ref now, considering x := 50 is going to apply to the SECOND x now….
If it really is a “beginner question”, that’s probably not the expected answer. But I don’t know what the “expected answer” is, so let’s hack around instead.
relevant link