# Architecture Patterns (React Native) > สถาปัตยกรรมคอมโพเนนต์, atomic design, โครงสร้างแบบ feature-based, clean architecture, SOLID - 22 คำถามสัมภาษณ์ - Senior - [คำถามสัมภาษณ์: React Native](https://sharpskill.dev/th/technologies/react-native/interview-questions.md) ## 1. สถาปัตยกรรมแบบคอมโพเนนต์ในแอปพลิเคชัน React Native คืออะไร? **คำตอบ** สถาปัตยกรรมแบบคอมโพเนนต์คือการจัดโครงสร้างแอปพลิเคชันให้เป็นองค์ประกอบที่นำกลับมาใช้ใหม่ได้และเป็นอิสระ โดยแต่ละองค์ประกอบมีความรับผิดชอบเพียงอย่างเดียว แนวทางนี้ส่งเสริมการนำโค้ดกลับมาใช้ใหม่ ทำให้ unit testing ง่ายขึ้น และเพิ่มความสามารถในการบำรุงรักษา แต่ละคอมโพเนนต์จะห่อหุ้ม state ตรรกะ และการแสดงผลของตนเอง ทำให้สามารถสร้างอินเทอร์เฟซที่ซับซ้อนจากบล็อกที่เรียบง่ายและประกอบกันได้ ## 2. ในรูปแบบ Atomic Design ห้าระดับของคอมโพเนนต์จากเล็กที่สุดไปใหญ่ที่สุดคืออะไร? **คำตอบ** Atomic Design ที่สร้างโดย Brad Frost จัดระเบียบคอมโพเนนต์เป็นห้าระดับ: Atoms (องค์ประกอบพื้นฐานเช่น Button, Text), Molecules (กลุ่มของ atoms เช่น SearchInput), Organisms (ส่วนที่สมบูรณ์เช่น Header), Templates (เลย์เอาต์ของหน้า) และ Pages (อินสแตนซ์ของ templates พร้อมข้อมูลจริง) วิธีการนี้ช่วยให้สร้าง design system ที่สอดคล้องและขยายขนาดได้ง่ายขึ้น ## 3. ข้อได้เปรียบหลักของโครงสร้างโปรเจกต์แบบ feature-based เมื่อเทียบกับโครงสร้างแบบอิงตามประเภทไฟล์คืออะไร? **คำตอบ** โครงสร้างแบบ feature-based จัดกลุ่มไฟล์ทั้งหมดที่เกี่ยวข้องกับฟังก์ชันหนึ่งไว้ในโฟลเดอร์เดียวกัน (คอมโพเนนต์ hooks services เทสต์) ซึ่งช่วยเพิ่มความเชื่อมโยงของโค้ดและทำให้การนำทางง่ายขึ้นเพราะทุกอย่างที่เกี่ยวกับ feature อยู่ในที่เดียว ต่างจากโครงสร้างแบบอิงตามประเภทที่ไฟล์กระจัดกระจาย แนวทางนี้ลดการสลับบริบทและทำให้การลบหรือแก้ไข feature ทั้งหมดง่ายขึ้น ## มีอีก 19 คำถาม - หลักการ SOLID 'S' (Single Responsibility Principle) ที่ใช้กับคอมโพเนนต์ React Native หมายถึงอะไร? - ใน Clean Architecture เลเยอร์ใดที่มีกฎทางธุรกิจของแอปพลิเคชัน? สมัครฟรี: https://sharpskill.dev/th/login ## หัวข้อสัมภาษณ์ React Native อื่นๆ - [พื้นฐาน JavaScript](https://sharpskill.dev/th/technologies/react-native/interview-questions/javascript-essentials.md): 25 คำถาม, Junior - [พื้นฐาน React](https://sharpskill.dev/th/technologies/react-native/interview-questions/react-fundamentals.md): 20 คำถาม, Junior - [พื้นฐาน React Native](https://sharpskill.dev/th/technologies/react-native/interview-questions/react-native-basics.md): 22 คำถาม, Junior - [React Hooks](https://sharpskill.dev/th/technologies/react-native/interview-questions/react-hooks.md): 20 คำถาม, Junior - [TypeScript สำหรับ React และ React Native](https://sharpskill.dev/th/technologies/react-native/interview-questions/typescript-for-react-native.md): 22 คำถาม, Junior - [คอมโพเนนต์และ API ของ React Native](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-components-api.md): 20 คำถาม, Junior - [การจัดสไตล์และเลย์เอาต์ใน React Native](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-styling-layout.md): 18 คำถาม, Junior - [การนำทางใน React Native](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-navigation.md): 22 คำถาม, Mid-Level - [การจัดการ State ใน React Native](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-state-management.md): 24 คำถาม, Mid-Level - [Networking และ API ใน React Native](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-networking-api.md): 20 คำถาม, Mid-Level - [การคงอยู่ของข้อมูล](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-data-persistence.md): 20 คำถาม, Mid-Level - [ฟอร์มและการตรวจสอบความถูกต้อง](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-forms-validation.md): 18 คำถาม, Mid-Level - [แอนิเมชัน React Native](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-animations.md): 22 คำถาม, Mid-Level - [Native Modules & Bridge](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-native-modules.md): 20 คำถาม, Mid-Level - [โค้ดเฉพาะแพลตฟอร์ม](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-platform-specific-code.md): 18 คำถาม, Mid-Level - [สิทธิ์และ Device API](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-permissions-apis.md): 20 คำถาม, Mid-Level - [Push Notifications](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-push-notifications.md): 18 คำถาม, Mid-Level - [การทดสอบ React Native](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-testing.md): 20 คำถาม, Mid-Level - [การ Debug React Native](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-debugging.md): 18 คำถาม, Mid-Level - [Build & Deployment](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-build-deployment.md): 20 คำถาม, Mid-Level - [Expo vs React Native Bare](https://sharpskill.dev/th/technologies/react-native/interview-questions/expo-vs-bare-rn.md): 18 คำถาม, Mid-Level - [การเพิ่มประสิทธิภาพ](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-performance-optimization.md): 24 คำถาม, Senior - [การจัดการหน่วยความจำ](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-memory-management.md): 20 คำถาม, Senior - [React Native New Architecture](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-new-architecture.md): 24 คำถาม, Senior - [แนวทางปฏิบัติที่ดีที่สุดด้านความปลอดภัย](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-security-best-practices.md): 20 คำถาม, Senior - [Offline-First Architecture](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-offline-first.md): 20 คำถาม, Senior - [CI/CD React Native](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-ci-cd.md): 20 คำถาม, Senior - [Monorepo และการแชร์โค้ด](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-monorepo-architecture.md): 18 คำถาม, Senior - [หัวข้อขั้นสูง](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-advanced-topics.md): 22 คำถาม, Senior - [วงจรชีวิตแอปและการทำงานเบื้องหลัง](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-app-lifecycle-background.md): 20 คำถาม, Mid-Level - [การยืนยันตัวตนและการจัดการเซสชัน](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-auth-session-management.md): 22 คำถาม, Mid-Level - [Monitoring & Crash Reporting](https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-monitoring-crash-reporting.md): 20 คำถาม, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/th/technologies/react-native/interview-questions/rn-architecture-patterns