Executive function is a cognitive control system contributes uniquely to resilience (Greenberg, 2006; Obradovic, 2016).This study looked into resilience development during its controversial age period in cognitive perspective, aims to explorehow its components (i.e., cognitive flexibility, inhibitory control, and working memory) affect resilience in different agegroups. Data were collected in middle schools and universities (N=197). Participants were asked to join a series of labexperiments and questionnaires in a psychological lab. Results showed resilience as well as executive function in algorith-mic mind level develop from adolescence to emerging adulthood. Cognitive flexibility plays central role in functioningresilience with various cognitive mechanisms for different populations. With the identification of cognitive mechanismsunderlying the relation between cognitive flexibility subsets (i.e., reactive flexibility and spontaneous flexibility) and re-silience, this study contributes a cognitive perspective for better understanding of resilience before challenging eventshappen.