# 위젯 생명주기 (Flutter) > StatefulWidget 생명주기, initState, setState, dispose, didUpdateWidget, build 최적화 - 20 면접 질문 - Junior - [면접 질문: Flutter](https://sharpskill.dev/ko/technologies/flutter/interview-questions.md) ## 1. StatefulWidget을 생성할 때 가장 먼저 호출되는 메서드는 무엇입니까? **답변** createState() 메서드는 StatefulWidget을 인스턴스화할 때 가장 먼저 호출됩니다. 이 메서드는 위젯과 연결된 State 객체를 생성합니다. 위젯이 위젯 트리에 처음 삽입될 때 Flutter 프레임워크에 의해 자동으로 호출됩니다. ## 2. StatefulWidget가 생성될 때 라이프사이클 메서드의 올바른 순서는 무엇입니까? **답변** 올바른 순서는 다음과 같습니다. createState()가 State 객체를 생성하고, 그다음 initState()가 상태를 초기화하며, didChangeDependencies()는 initState 이후와 의존성이 변경될 때마다 호출되고, 마지막으로 build()가 UI를 구성합니다. 이 순서는 렌더링 전에 상태가 올바르게 초기화되도록 보장합니다. ## 3. initState() 메서드의 주요 목적은 무엇입니까? **답변** initState()는 컨텍스트에 의존하는 데이터를 초기화하거나 리스너, 애니메이션 컨트롤러, 구독을 설정하는 데 사용됩니다. 이 메서드는 State 객체가 생성될 때 한 번만 호출되므로 일회성 초기화에 이상적인 위치입니다. ## 17개 추가 질문 이용 가능 - initState() 안에서 super.initState()를 호출하는 것이 필수인 이유는 무엇입니까? - StatefulWidget에서 setState()가 호출되면 어떤 일이 발생합니까? 무료로 가입하기: https://sharpskill.dev/ko/login ## 기타 Flutter 면접 주제 - [Dart 기초](https://sharpskill.dev/ko/technologies/flutter/interview-questions/dart-basics.md): 25개 질문, Junior - [Dart 언어 핵심](https://sharpskill.dev/ko/technologies/flutter/interview-questions/dart-language-essentials.md): 15개 질문, Junior - [Flutter 기초](https://sharpskill.dev/ko/technologies/flutter/interview-questions/flutter-fundamentals.md): 18개 질문, Junior - [로컬 스토리지](https://sharpskill.dev/ko/technologies/flutter/interview-questions/local-storage.md): 20개 질문, Junior - [애플리케이션 생명주기](https://sharpskill.dev/ko/technologies/flutter/interview-questions/app-lifecycle.md): 20개 질문, Junior - [Layouts & Constraints](https://sharpskill.dev/ko/technologies/flutter/interview-questions/layouts-constraints.md): 24개 질문, Mid-Level - [ListView & GridView](https://sharpskill.dev/ko/technologies/flutter/interview-questions/listview-gridview.md): 25개 질문, Mid-Level - [내비게이션 및 라우팅](https://sharpskill.dev/ko/technologies/flutter/interview-questions/navigation-routing.md): 22개 질문, Mid-Level - [기본 상태 관리](https://sharpskill.dev/ko/technologies/flutter/interview-questions/state-management-basics.md): 22개 질문, Mid-Level - [Provider 패턴](https://sharpskill.dev/ko/technologies/flutter/interview-questions/provider-pattern.md): 18개 질문, Mid-Level - [Networking & HTTP](https://sharpskill.dev/ko/technologies/flutter/interview-questions/networking-http.md): 20개 질문, Mid-Level - [JSON 직렬화](https://sharpskill.dev/ko/technologies/flutter/interview-questions/json-serialization.md): 20개 질문, Mid-Level - [로컬 데이터베이스](https://sharpskill.dev/ko/technologies/flutter/interview-questions/local-database.md): 22개 질문, Mid-Level - [폼과 유효성 검사](https://sharpskill.dev/ko/technologies/flutter/interview-questions/forms-validation.md): 20개 질문, Mid-Level - [애니메이션](https://sharpskill.dev/ko/technologies/flutter/interview-questions/animations.md): 20개 질문, Mid-Level - [Firebase 통합](https://sharpskill.dev/ko/technologies/flutter/interview-questions/firebase-integration.md): 18개 질문, Mid-Level - [유닛 테스트](https://sharpskill.dev/ko/technologies/flutter/interview-questions/unit-testing.md): 20개 질문, Mid-Level - [위젯 테스트](https://sharpskill.dev/ko/technologies/flutter/interview-questions/widget-testing.md): 18개 질문, Mid-Level - [빌드 및 배포](https://sharpskill.dev/ko/technologies/flutter/interview-questions/build-deployment.md): 16개 질문, Mid-Level - [패키지 관리](https://sharpskill.dev/ko/technologies/flutter/interview-questions/package-management.md): 16개 질문, Mid-Level - [메모리 및 성능](https://sharpskill.dev/ko/technologies/flutter/interview-questions/memory-performance.md): 22개 질문, Senior - [Streams & RxDart](https://sharpskill.dev/ko/technologies/flutter/interview-questions/streams-rxdart.md): 24개 질문, Senior - [고급 State Management](https://sharpskill.dev/ko/technologies/flutter/interview-questions/advanced-state-management.md): 26개 질문, Senior - [Flutter Design Patterns](https://sharpskill.dev/ko/technologies/flutter/interview-questions/flutter-design-patterns.md): 24개 질문, Senior - [성능 최적화](https://sharpskill.dev/ko/technologies/flutter/interview-questions/performance-optimization.md): 26개 질문, Senior - [Platform Channels](https://sharpskill.dev/ko/technologies/flutter/interview-questions/platform-channels.md): 20개 질문, Senior - [Custom Painting](https://sharpskill.dev/ko/technologies/flutter/interview-questions/custom-painting.md): 22개 질문, Senior - [Flutter 애플리케이션 아키텍처](https://sharpskill.dev/ko/technologies/flutter/interview-questions/flutter-app-architecture.md): 22개 질문, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ko/technologies/flutter/interview-questions/widget-lifecycle