Question bank › Math
Dsa Math Easy

Weighted Average Calculator

You are tasked with calculating the weighted average of a list of grades for students. Each student has a grade and a weight associated with that grade. Input consists of an integer N followed by N pairs of integers where the first integer is the grade and the second integer is the weight. The output should be a single float representing the weighted average rounded to two decimal places. Example: Input: 3 80 2 90 3 70 5 Output: 79.38

Key concepts

mathaveragelist

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.