Permalinks setting

It’s possible to have them share the same slug, but you need to manually resolve conflicts yourself. You have to check if the end of the requested URL is an existing term, and reset the query vars accordingly if it’s not found:

function wpd_post_request_filter( $request ){
    if( array_key_exists( 'category_name' , $request )
        && ! get_term_by( 'slug', basename( $request['category_name'] ), 'category' ) ){
            $request['name'] = basename( $request['category_name'] );
            $request['post_type'] = 'post';
            unset( $request['category_name'] );
    }
    return $request;
}
add_filter( 'request', 'wpd_post_request_filter' );

The obvious downsides to this are an extra trip to the database for every post or category view, and the inability to have a category slug that matches a post slug.