Type hinting - which is better, UserInterface or AccountInterface? Recently I've finally begun shifting my focus from D7 to D8, and I'm converting a site over to D8. In D7, I type-hinted my account objects as \stdClass, since they were not members of any class. However in D8, they are now members of the User class.

That said, I'm finding in some code on the net that people are typehinting as Drupal\Core\Session\AccountInterface, and in other places as Drupal\user\UserInterface. How should we be determining which one to use for our typehints, and what is the difference between the two types of objects?
UserInterface extends ContentEntityInterface, EntityChangedInterface, and AccountInterface. This means there are methods an object implementing UserInterface needs to have but objects implementing AccountInterface don't need to have. For example, there is UserInterface::hasRole(), but AccountInterface::getRoles(); in the first case, there is a helper method allowing to check the object has a specific role, while in the second case you would need to write your code for that, getting the list of the roles with AccountInterface::getRoles().
Which hint should be used is given from the documentation. For example, hook_user_logout() gets an object implementing \Drupal\Core\Session\AccountProxyInterface, since it gets the object returned from Drupal::currentUser(). See user_logout(), the function invoking hook_user_logout().
  $user = \Drupal::currentUser();

  \Drupal::logger('user')-&gt;notice('Session closed for %name.', array('%name' =&gt; $user-&gt;getAccountName()));

  \Drupal::moduleHandler()-&gt;invokeAll('user_logout', array($user));

Sometime the documentation for a hook doesn't show a specific hint, such as in the case of hook_user_login(). In this case, it could help to see which hint is used from the implementations of that hook, for example system_user_login(), which uses UserInterface as hint for its argument.
When you aren't sure about the correct interface implemented by the object passed to a function (including a hook), use the most generic one as hint. In the case you describe, that would be AccountInterface.