Are class skills picked before or after your character’s Background is selected?

In the Backgrounds section:

Each background gives a character proficiency in two skills. Skills are described in chapter 7. In addition, most backgrounds give a character proficiency with one or more tools. Tools and tool proficiencies are detailed in chapter 5. If a character would gain the same proficiency from two different sources, he or she can choose a different proficiency of the same kind (skill or tool) instead.

Could a Barbarian character being created, for instance, pick Athletics and Survival as his class skills, and then when selecting a background, pick Outlander (which grants proficiency in these two skills), and then using this rule, instead pick two skills from the whole skill list?

Or is your background chosen before class skill-proficiencies?