Going for an indefinite article seems to be the better choice for both of those sentences. [But trust me, articles are actually difficult!].
Here is why...
You certainly defined that there are books. This means you have introduced the books. Grammar rules now allow you to mention those books with the definite article 'the'. Said that...
There are books on the (the-because there's only one table on which books are lying) table. The books are about the World War II.
But then, the moment you say any book from that lot, you still don't define that particular book. This is the reason, it'll take indefinite article'.
There are the books... and when you take a (any of those) books, check out its cover.
Now, if there is a pile of books and imagine, you are talking about the book on the top; it'll then take the definite article. Because you are now talking about the specific book on the top.
There are the books. The first one talks about Adolf Hitler.
The same thing with the second example. You can encounter many problems with your device. But then, how you deal with any problem, you'll have to learn.
can may encounter (unspecific) problems with any device. (Tell me) how will you deal with a problem?"
You are talking about some unspecific problem on some device. You are approaching a problem in a general way. It takes indefinite article. Something like... how do you fix a problem of your cellphone.
Imagine you are talking about some specific problem. It'll then take the indefinite article 'the'
My phone has the calendar problem (the device has some specific problem with the app -calendar, it might hang when you open it, for example). How do I deal with the problem will refer to the problem of calendar and nothing else.