
Answer-first summary for fast verification
Answer: Design a customizable function that allows users to specify the type of moving average (simple or exponential) and its parameters (window size or decay factor), providing flexibility and adaptability to various scenarios.
Option D is the most flexible and versatile approach, as it allows the user to specify the type of moving average and the parameters for the calculation. This enables the function to be used in a variety of scenarios and to accommodate different user requirements, including scalability and compliance with data governance policies. While Options A and B provide specific implementations of moving averages, they lack flexibility and may not be suitable for all use cases. Option C, while offering both types of moving averages, does not allow for parameter customization, limiting its applicability.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
As a Microsoft Fabric Analytics Engineer Associate, you are tasked with implementing a function in a lakehouse to calculate the moving average of a time series dataset containing daily stock prices for a company. The solution must be flexible to accommodate various user requirements, including the ability to specify the type of moving average (simple or exponential) and its parameters (window size or decay factor). Additionally, the solution should be scalable to handle large datasets efficiently and comply with data governance policies. Which of the following approaches BEST meets these requirements? (Choose one option)
A
Implement a fixed function that calculates only the simple moving average with a predefined window size, ensuring simplicity and quick deployment.
B
Develop a function that exclusively calculates the exponential moving average using a default decay factor, optimizing for performance with large datasets.
C
Create a comprehensive function that computes both simple and exponential moving averages with fixed parameters, offering users a choice between two predefined methods.
D
Design a customizable function that allows users to specify the type of moving average (simple or exponential) and its parameters (window size or decay factor), providing flexibility and adaptability to various scenarios.