Get User Role by ID

Get worpdress user by user ID in simple way like this:

$user_info = get_userdata($user_id);
$user_admin_role = $user_info->roles ? $user_info->roles[0] : false;