A rule change in 2001 eventually permitted zone defense but also specified that a defender who is standing inside the key is limited to not guarding an offensive player at arm's length for no more than three seconds.
This makes it difficult for NBA teams to play zone since such defenses usually position a player in the middle of the key to stop penetration.
He is positioned halfway between the ball and the basket and may be angled in one direction or another depending on the defensive scheme of that defender's team.
The defender's knees should be bent at roughly a ninety-degree angle with the bottom of his thighs parallel to the ground.
It is ok to play a little farther back or even a little closer, it would just depend on how confident the player is in his abilities and the skill of the attacker.