는지(요) especially at the end of the sentence can be used in various meanings.
1) when you have a doubt about something
: 그게 맞는지.= (I’m not sure) if that’s right.
그게 맞는지요 = Is that right?
(if you add 요 at the end it becomes a question.)
그녀가 나를 좋아하는지. = (I’m not sure) if she likes me
그녀가 저를 좋아하는지요? = Does she like me?
2) to check facts in the past
: 저녁은 먹었는지. = I wonder if you had dinner.
저녁은 드셨는지요? = Did you have dinner?
거기까지 가는데 오래 걸리지는 않았는지. = I wonder if it took too long to get there.
거기까지 가는데 오래 걸리지는 않았는지요?
= Did it take long to get there?
3) to ask whether she/he did something
~했는지 안했는지 = Whether you did it or not
니가 먹었는지 안먹었는지 = Whether you ate it or not