Below is a structured coding exam for data engineers, covering a range of skills typically required in the field. This exam includes both theoretical questions and practical coding challenges. Please note, due to the format constraints, the "coding" part will be more about providing a detailed approach or pseudo-code rather than an executable code block, unless specified otherwise.
Data Engineer Coding Exam
Duration: 4 hours
Instructions:
Theoretical Questions (40 points): Choose the most appropriate answer for multiple-choice questions. For open-ended questions, keep your answers concise yet informative.
Coding Challenges (60 points): Provide a detailed approach, pseudo-code, or actual code (if a specific platform is mentioned) for each challenge. Ensure your solutions are well-structured and readable.
Theoretical Questions (40 points)
1. Multiple Choice (5 points)
What is the primary advantage of using a column-family NoSQL database over a traditional relational database for storing large amounts of sensor data?
A) Better support for ACID transactions
B) Improved data retrieval speed for analytics
C) Enhanced support for joins and subqueries
D) Simplified database schema design
Answer: B) Improved data retrieval speed for analytics
2. Open-Ended (10 points)
Describe the differences between a Data Lake and a Data Warehouse, focusing on data structure, processing, and typical use cases. (Max 200 words)
3. Multiple Choice (5 points)
Which of the following big data processing frameworks is primarily designed for batch processing?
A) Apache Storm
B) Apache Spark
C) Apache Hadoop MapReduce
D) Apache Flink
Answer: C) Apache Hadoop MapReduce
4. Open-Ended (10 points)
Explain the concept of data skew in MapReduce and provide two strategies to mitigate its impact on job performance. (Max 200 words)
5. Multiple Choice (10 points)
Select all that apply: What are benefits of using Apache Airflow for workflow management?
A) Fine-grained access control
B) Support for distributed task execution
C) Built-in support for ML model deployment
D) Web-based UI for workflow visualization and monitoring
E) All of the above
Answer: E) All of the above
Coding Challenges (60 points)
Challenge 1: Data Pipeline with Apache Beam (20 points)
Task: Design a data pipeline using Apache Beam (preferably in Python) that reads JSON files from GCS, applies a simple transformation (converting all string fields to lowercase), and writes the output to BigQuery. Assume the JSON structure includes fields like name, email, and message.
Deliverable: Provide pseudo-code highlighting the key steps and transformations.
Challenge 2: SQL Optimization (15 points)
Task: Given a slow-performing SQL query below, identify bottlenecks and propose an optimized version. Assume the database is PostgreSQL and orders is a table with millions of rows, and customers has an index on id and country.
sql
SELECT *
FROM orders o
JOIN customers c ON o.customer_id = c.id
WHERE o.order_date > '2022-01-01'
AND c.country = 'USA';
Deliverable: Explain bottlenecks and provide the optimized SQL query. Consider indexing strategies and query restructuring.
Challenge 3: Data Quality Check Script (25 points)
Task: Write a Python script using Pandas to perform the following data quality checks on a CSV file (data.csv):
Check for missing values in any column.
Validate if a specific column (email) contains properly formatted email addresses.
Ensure another column (age) only contains integers between 18 and 100.
Challenge 4: Real-Time Data Stream Processing (Optional, 10 points)
Task: Propose an architecture for processing real-time user interaction logs (e.g., clicks, scrolls) from a web application. Use Apache Kafka for data ingestion, Apache Spark Structured Streaming for processing, and store aggregated metrics (e.g., clicks per minute) in Redis. Provide a high-level design and key configuration considerations.
Deliverable: Submit a concise architecture diagram and a brief description (max 1 page).
Submission Guidelines:
Theoretical questions: Submit answers in a single PDF document named Theoretical_Questions_[YourName].pdf.
Coding Challenges: Submit each challenge in a separate file (e.g., Challenge1_ApacheBeam.txt, Challenge2_SQL_Optimization.sql, Challenge3_DataQualityCheck.py).
Ensure your name and the exam title are included in all submissions.
If completing the optional Challenge 4, submit the architecture design as Challenge4_RealTimeProcessing_[YourName].pdf.
Note: Depending on the actual exam setup, the submission guidelines might vary (e.g., online form, repository upload). Always check with the exam administrators for specific instructions.