Question 1: Price to Sell (Custom)
Description:
A real estate agent is advising a seller on the price to ask for a home. To do this, the agent will look at homes that have sold in the area and base the valuation on this data. The only factors that will be considered are square footage and sale price.
The agent starts by removing any outliers from the list of comparable homes. To determine the outliers:
- Select the home to test.
- Create a list of prices of other homes of the same size (referred to as
compList
in the examples). - If there are no other homes of the same size, the house being tested is not an outlier.
- Otherwise:
- Calculate the mean price P[m]P[m]P[m] and the standard deviation σσσ for the homes in
compList
. - If ∣price[i]−P[m]∣>3∗σ|price[i] - P[m]| > 3 * σ∣price[i]−P[m]∣>3∗σ, the house is considered an outlier.
- Calculate the mean price P[m]P[m]P[m] and the standard deviation σσσ for the homes in
Valuation Rules: The valuation is calculated based on the resulting list using the following rules:
- If there are no houses in the list, use 1000 per square foot as the price.
- If there is only 1 house in the list, its square foot price is used.
- If there are 7 or more houses in the list with the exact square footage of the house to price, use the mean of those prices.
- If the required square footage is between the square footage of two houses in the list, interpolate the square foot price using the means of the closest higher- and lower-priced homes.
- If the required square footage is outside the range of houses listed, extrapolate the price based on the means of the two square footage values that are closest to the home to value.
Boundary Cases:
- If the final price is less than 1000 or greater than 1,000,000, the price will be adjusted to 1000 and 1,000,000, respectively.
- For any square footage, the "square foot price" is the mean of the prices at that square footage. Return an integer representing the valuation of the seller's house (the rounded "square foot price").
我们长期稳定承接各大科技公司如TikTok、Google、Amazon等的OA笔试代写服务,确保满分通过。如有需求,请随时联系我们。
We consistently provide professional online assessment services for major tech companies like TikTok, Google, and Amazon, guaranteeing perfect scores. Feel free to contact us if you're interested.