They are similar in your two sentences in that they both refer to two alternatives, however they are not interchangeable. You cannot use whether in sentence 1. Whether works well with the state of uncertainty in sentence 2.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.