Notice the Egyptian coloring of the dream story. Cows come up out of the Nile. That is where cattle often resort to escape heat and flies. Notice also that Joseph shaves. Hebrews would let their beards grow, but Egyptians shaved them.
What I have wondered is: how did Joseph know that he would be able to interpret Pharaoh’s dream?
On the one hand, he had interpreted dreams before, but only once (to the butler and baker). Then again, perhaps he felt that, after over two years in prison, he had nothing to lose.
But I really think that Joseph believed God always had him in mind. When he interpreted the dreams of the butler and baker, he believed God had given him the answers, and he lived his life as one who believed God was directing him.
His example is an important one. To confidently believe God has your back, even when things are going wrong, and to move forward as best you can, taking advantage of every opportunity and making the most of every circumstance – even when the circumstances are poor. This is faith, and one of the reasons we have such examples in the Bible.