What or which : which one should be used?
What/which medicine is good for boosting immunity of children?
What/which is the longest river in the world?
I think both are correct. But I am not sure.
Which is used when there is some defined set of possible answers.
What is used when there is not such a set.
Where the set is very large, either may be acceptable. Both of your examples are very large sets, unless the context restricts that set in some way.
To answer your question I would say:
Which medicine is good for boosting immunity of children?
Which is the longest river in the world?