Hi, I think Jesus asked this question so that Bartimaeus could express his belief and faith that He could heal him. In Matthew 13:58, in that particular situation, it says that Jesus did not do many miracles there because of their unbelief:
Matthew 13:58 "And He did not do many miracles there because of their unbelief." (NASB)
Here with Bartimaeus, I believe Jesus knew he was blind. But, Jesus also wanted him to express his belief and faith. So, to draw that belief and faith out, Jesus asked him this question. With his answer, "...Rabbi, let me recover my sight" (ESV), he expressed his faith in
believing that Jesus could heal him.
To prove this, go to the very next verse:
Mark 10:52 "And Jesus said to him, “Go your way; your
faith has made you well.” And immediately he recovered his sight and followed him on the way." (ESV)
So, overall, I think that Jesus just wanted to draw out his faith. It might also be asked, didn't Jesus know that he had enough faith? To answer this, I believe that yes, Jesus did know! But, he had to ask him the question to get Bartimaeus to use the faith that he already had to believe that He could heal him.
Also, I believe that God delights in fellowship and communication with us.
I hope this answers your question.
All glory to God!