# dbt - ฟีเจอร์ขั้นสูง (Data Engineering) > Jinja macros, custom tests, packages, hooks, snapshots (SCD), incremental models, dbt Cloud, CI/CD - 20 คำถามสัมภาษณ์ - Senior - [คำถามสัมภาษณ์: Data Engineering](https://sharpskill.dev/th/technologies/data-engineering/interview-questions.md) ## 1. ใน dbt วัตถุประสงค์หลักของ Jinja macros คืออะไร? **คำตอบ** Jinja macros ช่วยให้ใช้โค้ดซ้ำได้ในหลาย dbt models โดยทำงานเหมือนฟังก์ชันที่รับพารามิเตอร์และส่งคืน SQL ที่สร้างขึ้นแบบไดนามิก ซึ่งช่วยหลีกเลี่ยงการซ้ำซ้อนของโค้ดและทำให้บำรุงรักษาการแปลงที่ซับซ้อนทั่วทั้งโปรเจกต์ได้ง่ายขึ้น ## 2. จะกำหนด dbt macro ที่ใช้ซ้ำได้ในไฟล์อย่างไร? **คำตอบ** dbt macro ถูกกำหนดโดยใช้ไวยากรณ์ Jinja macro/endmacro ในไฟล์ .sql ภายในโฟลเดอร์ macros ชื่อมาโครถูกระบุหลังคำสำคัญ macro ตามด้วยพารามิเตอร์ในวงเล็บ มาโครนี้สามารถเรียกใช้จากโมเดลใดๆ ในโปรเจกต์ได้ ## 3. ความแตกต่างระหว่างกลยุทธ์ 'timestamp' และ 'check' สำหรับ dbt snapshots คืออะไร? **คำตอบ** กลยุทธ์ timestamp เปรียบเทียบคอลัมน์วันที่อัปเดต (updated_at) เพื่อตรวจจับการเปลี่ยนแปลง ซึ่งให้ประสิทธิภาพดีกว่าเพราะเปรียบเทียบเพียงคอลัมน์เดียว กลยุทธ์ check เปรียบเทียบค่าของคอลัมน์ที่ระบุ (check_cols) เพื่อตรวจจับการเปลี่ยนแปลงใดๆ มีประโยชน์เมื่อไม่มีคอลัมน์ timestamp ที่เชื่อถือได้ ## มีอีก 17 คำถาม - คอลัมน์ใดบ้างที่ dbt เพิ่มโดยอัตโนมัติเมื่อสร้าง snapshot? - จะกำหนดค่า incremental model ด้วยกลยุทธ์ 'merge' ใน dbt อย่างไร? สมัครฟรี: https://sharpskill.dev/th/login ## หัวข้อสัมภาษณ์ Data Engineering อื่นๆ - [Linux & Shell - พื้นฐาน](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/linux-shell-basics.md): 20 คำถาม, Junior - [Git & GitHub - พื้นฐาน](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/git-github-fundamentals.md): 20 คำถาม, Junior - [Python ขั้นสูงสำหรับ Data Engineering](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/python-advanced-de.md): 25 คำถาม, Junior - [Docker - พื้นฐาน](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/docker-fundamentals.md): 25 คำถาม, Junior - [Google Cloud Platform - พื้นฐาน](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/gcp-fundamentals.md): 20 คำถาม, Junior - [CI/CD และคุณภาพโค้ด](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/ci-cd-code-quality.md): 20 คำถาม, Mid-Level - [Docker Compose](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/docker-compose.md): 20 คำถาม, Mid-Level - [FastAPI - Data API](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/fastapi.md): 20 คำถาม, Mid-Level - [SQL ขั้นสูงสำหรับ Data Engineering](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/sql-advanced-de.md): 20 คำถาม, Mid-Level - [Data Lake - สถาปัตยกรรมและการนำเข้าข้อมูล](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/data-lake.md): 20 คำถาม, Mid-Level - [BigQuery สำหรับ Data Engineering](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/bigquery-de.md): 20 คำถาม, Mid-Level - [PostgreSQL - การดูแลระบบ](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/postgresql-admin.md): 20 คำถาม, Mid-Level - [Data Modeling สำหรับ Data Engineering](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/data-modeling-de.md): 20 คำถาม, Mid-Level - [Fivetran & Airbyte - การนำเข้าข้อมูล](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/fivetran-airbyte.md): 20 คำถาม, Mid-Level - [dbt - พื้นฐาน](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/dbt-fundamentals-de.md): 20 คำถาม, Mid-Level - [Apache Airflow - พื้นฐาน](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/airflow-fundamentals.md): 20 คำถาม, Mid-Level - [Kubernetes - พื้นฐาน](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/kubernetes-fundamentals.md): 20 คำถาม, Mid-Level - [รูปแบบ ETL / ELT / ETLT](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/etl-elt-patterns.md): 20 คำถาม, Senior - [Apache Airflow - ขั้นสูง](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/airflow-advanced.md): 20 คำถาม, Senior - [Airflow + dbt - การจัดการ Pipeline](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/airflow-dbt-integration.md): 20 คำถาม, Senior - [PySpark - การประมวลผลขนาดใหญ่](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/pyspark.md): 20 คำถาม, Senior - [Google Pub/Sub - การสตรีมข้อมูล](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/pubsub-streaming.md): 20 คำถาม, Senior - [Apache Beam & Dataflow](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/apache-beam-dataflow.md): 20 คำถาม, Senior - [Kubernetes - Production และ Scaling](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/kubernetes-advanced.md): 20 คำถาม, Senior - [Terraform - Infrastructure as Code](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/terraform.md): 20 คำถาม, Senior - [ฐานข้อมูล NoSQL](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/nosql-databases.md): 20 คำถาม, Senior - [Data Architecture สมัยใหม่](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/data-architecture.md): 20 คำถาม, Senior - [การมอนิเตอร์และการสังเกตการณ์](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/monitoring-observability.md): 20 คำถาม, Senior - [IAM และความปลอดภัยของข้อมูล](https://sharpskill.dev/th/technologies/data-engineering/interview-questions/iam-security-de.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/data-engineering/interview-questions/dbt-advanced-de