C# Programming Questions
Click on "Show Answer" to reveal the solution.
1. Find Items: Implement methods to look up items by sold count, get min/max sold items, and sort items by sold count.
Max Time: 12 minutes
Explanation: Builds sorted dictionary operations for lookup, min/max selection, and ascending sorting.
2. Calculate Numbers: Add numbers, compute GPA, and return a grade for the GPA.
Max Time: 10 minutes
Explanation: Uses a list to calculate GPA and map the GPA to a letter grade.
3. Movie Stock: Add movies, filter by genre, and sort by ratings.
Max Time: 12 minutes
Explanation: Parses a comma-separated string into a Movie object and returns sorted or filtered lists.
4. Yoga Meditation: Store member details, compute BMI, and calculate the membership fee.
Max Time: 15 minutes
Explanation: Tracks yoga members, computes BMI, and returns a fee based on goal and BMI.
5. Ecommerce Application: Create a payment method that throws an exception when the wallet balance is insufficient.
Max Time: 12 minutes
Explanation: Uses a custom exception to enforce wallet balance validation.
6. User Authentication: Validate passwords and throw a mismatch exception when they differ.
Max Time: 12 minutes
Explanation: Creates a User model and validates the password confirmation with a custom exception.
7. Construction Estimate: Validate construction area and throw an exception when it exceeds site area.
Max Time: 10 minutes
Explanation: Returns EstimateDetails when valid, otherwise throws a ConstructionEstimateException.
8. User Verification: Validate phone number length and throw an exception on invalid input.
Max Time: 8 minutes
Explanation: Ensures the phone number length is 10 before returning the User object.