Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Solar Panel Efficiency Calculation

EasyPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Solar Panel Efficiency Calculation. Start with the requirements on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

A panel operating on a Nextracker NX Horizon tracker receives solar energy based on the measured irradiance and its surface area. Write a function that calculates the panel's conversion efficiency as a percentage.

Use the formula:

efficiency = output_power / (irradiance * panel_area) * 100

The function should return the result as a floating-point number. Do not round the result unless required by the caller.

Formal Specification

Implement calculate_efficiency(irradiance, panel_area, output_power), where all three parameters are positive or zero numeric values measured as follows:

  • irradiance: incident solar power in watts per square meter (W/m²)
  • panel_area: panel surface area in square meters (m²)
  • output_power: electrical power produced by the panel in watts (W)

Return the efficiency percentage as a float. Inputs will satisfy irradiance > 0 and panel_area > 0.

Constraints

  • 0 < irradiance <= 2000
  • 0 < panel_area <= 1000
  • 0 <= output_power <= irradiance * panel_area
  • All inputs are numeric values
  • Return the unrounded floating-point percentage

Function Signature

def calculate_efficiency(irradiance, panel_area, output_power):
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output