LCA problem doubt regarding test cases

in this problem, can there be any case where p is present but q is not present in the tree, or vice-versa.
is it possible?

@sounakume
Usually both are present
If they may be absent then it is usually mentioned in the question that they may be absent
If your doubt is resolved please close it