-는지 turns a question into something a person can know: know what it's basking in, know why it takes so long, know where it is, know what someone is thinking. 알겠다 in these lines is 'now I get it', a realization arriving, not a plan. 있는지 없는지 알다 is knowing whether a thing exists at all.