Phase 1: Beginner (28 problems)
Total: 28 problems
Problem 1: Simple Calculator ⭐
Concepts: Variables, Arithmetic Operators, Switch Statement, User Input
What You'll Learn:
How to declare and use variables
Reading user input with
Console.ReadLine()Using switch statements for menu logic
Basic error handling with try-catch
Requirements:
Ask user to enter two numbers
Display a menu:
+,-,*,/Perform the selected operation
Display the result
Handle division by zero
Bonus Challenges:
Add modulo
%operationValidate numeric input using
int.TryParse()Allow continuous calculations (loop until user exits)
Keep a history of last 5 calculations
Sample Output:
Problem 2: Grade Calculator ⭐
Concepts: If-Else Chains, Comparison Operators, Input Validation
What You'll Learn:
Using if-else-if ladder for range checking
Validating input boundaries
Converting numbers to letter grades
Requirements:
Accept a numeric score (0-100)
Convert to letter grade:
90-100: A
80-89: B
70-79: C
60-69: D
Below 60: F
Reject invalid scores (negative or >100)
Bonus Challenges:
Add plus/minus grades (A+, B-, etc.)
Calculate GPA (A=4.0, B=3.0, etc.)
Handle multiple students
Calculate class average
Problem 3: Even/Odd Checker ⭐
Concepts: Modulo Operator, Loops, Boolean Logic
What You'll Learn:
Using
%operator to check divisibilityCreating a loop for repeated checks
Breaking out of loops
Requirements:
Ask user for a number
Determine if even or odd
Display result
Allow checking multiple numbers
Bonus Challenges:
Check for prime numbers
Find next even/odd number
Count even and odd numbers in a range
Problem 4: Swap Numbers (3 Ways) ⭐
Concepts: Variables, Arithmetic Operations, XOR Operator
What You'll Learn:
Using a temporary variable
Arithmetic swap without temp
Bitwise XOR swap
Requirements: Implement three different methods to swap two numbers:
Using temporary variable
Using arithmetic operations (a = a + b; b = a - b; a = a - b)
Using XOR bitwise operation
Bonus Challenges:
Compare performance of each method
Swap three variables in one line
Implement swap as a generic method
Problem 5: Temperature Converter ⭐
Concepts: Methods, Parameters, Return Values, Formatting
What You'll Learn:
Creating methods with parameters
Returning calculated values
String formatting with
$interpolation
Requirements: Create methods for:
CelsiusToFahrenheit(double c)FahrenheitToCelsius(double f)CelsiusToKelvin(double c)Display results with 2 decimal places
Bonus Challenges:
Create a conversion table (0-100°C)
Add Kelvin to all other conversions
Validate temperature ranges (Kelvin can't be negative)
Problem 6: Number Properties Analyzer ⭐
Concepts: Math Operations, Multiple Conditions, Boolean Methods
What You'll Learn:
Checking multiple properties of a number
Using boolean methods
Combining logical operators
Requirements: For a given number, determine:
Is it even or odd?
Is it positive, negative, or zero?
Is it divisible by 3?
Is it divisible by 5?
Is it a perfect square?
Bonus Challenges:
Check if it's a perfect cube
Find all divisors
Classify as abundant, perfect, or deficient number
Problem 7: Simple Interest Calculator ⭐
Concepts: Arithmetic, Formula Application, Validation
What You'll Learn:
Applying mathematical formulas
Using decimal for financial calculations
Validating realistic inputs
Requirements: Calculate Simple Interest: SI = (P × R × T) / 100
Accept Principal (P), Rate (R), Time (T)
Calculate and display SI
Display total amount = P + SI
Bonus Challenges:
Add compound interest calculation
Compare simple vs compound interest
Calculate monthly EMI
Problem 8: Time Format Converter ⭐
Concepts: String Parsing, Validation, Formatting
What You'll Learn:
Parsing time strings
Converting between 12-hour and 24-hour formats
Handling AM/PM
Requirements:
Accept time in 12-hour format (e.g., "2:30 PM")
Convert to 24-hour format (e.g., "14:30")
Handle edge cases (12:00 AM, 12:00 PM)
Bonus Challenges:
Reverse conversion (24-hour to 12-hour)
Add time zone conversion
Validate time format
Problem 9: Bill Calculator with Discount ⭐
Concepts: Arithmetic, Conditional Logic, Multiple Operations
What You'll Learn:
Calculating percentages
Applying conditional discounts
Chaining calculations
Requirements:
Accept item price and quantity
Calculate subtotal
Apply discount rules:
5% if subtotal > $100
10% if subtotal > $500
Add tax (8%)
Display itemized bill
Bonus Challenges:
Handle multiple items
Different tax rates by category
Apply loyalty points
Problem 10: BMI Calculator ⭐
Concepts: Formula Application, Classification, Formatting
What You'll Learn:
Using formulas with real-world data
Classifying results into categories
Displaying health-related output
Requirements:
Accept weight (kg) and height (m)
Calculate BMI = weight / (height²)
Classify:
< 18.5: Underweight
18.5-24.9: Normal
25-29.9: Overweight
≥ 30: Obese
Bonus Challenges:
Accept imperial units (lbs, inches)
Calculate ideal weight range
Track BMI over time
Section 1.2: Loops & Iterations
Focus: Mastering for, while, do-while loops, and iteration patterns
Problem 11: Multiplication Table Generator ⭐
Concepts: For Loop, Formatting, String Interpolation
What You'll Learn:
Using for loops effectively
String formatting for aligned output
Nesting loops for complex patterns
Requirements:
Accept a number from user
Print multiplication table from 1 to 12
Format output nicely
Sample Output:
Bonus Challenges:
Generate tables for multiple numbers
Create a full 12×12 multiplication grid
Allow custom range (e.g., 5 to 20)
Problem 15: Factorial Calculator ⭐
Concepts: Loops, Accumulation, Large Numbers
What You'll Learn:
Using loops for accumulation
Handling large numbers with long
Understanding factorial growth
Requirements:
Calculate factorial using a loop
Handle 0! = 1
Display result
Bonus Challenges:
Use recursion instead
Compare loop vs recursion performance
Calculate using BigInteger for very large numbers
Problem 17: Digit Sum Calculator ⭐
Concepts: While Loop, Integer Math
What You'll Learn:
Extracting individual digits
Using modulo and integer division
Processing digits one by one
Requirements:
Accept a number
Calculate sum of its digits
Example: 1234 → 1+2+3+4 = 10
Bonus Challenges:
Calculate product of digits
Count number of digits
Find largest and smallest digit
Problem 18: Reverse a Number ⭐
Concepts: Loop, Math Operations
What You'll Learn:
Building numbers from digits
Reversing without strings
Handling negative numbers
Requirements:
Reverse digits of a number
Example: 1234 → 4321
Handle negative numbers
Bonus Challenges:
Check if number equals its reverse (palindrome)
Reverse and add until palindrome
Handle trailing zeros
Problem 21: Right-Angled Triangle ⭐
Concepts: Nested Loops, Pattern Logic
What You'll Learn:
Using nested loops for 2D patterns
Controlling row and column iteration
Building patterns incrementally
Requirements: Print right-angled triangle of stars:
Bonus Challenges:
Inverted triangle
Right-aligned triangle
Hollow triangle
Problem 27: Word Counter ⭐
Concepts: String Methods, Split, Loops
What You'll Learn:
Using String.Split()
Handling multiple spaces
String array manipulation
Requirements: Create method int CountWords(string sentence):
Handle multiple spaces between words
Ignore leading/trailing spaces
Return word count
Bonus Challenges:
Count unique words
Find longest word
Calculate average word length
Problem 36: Car Class with Methods ⭐
Concepts: Class Definition, Objects, Methods
What You'll Learn:
Creating a class with fields and methods
Instantiating objects
Calling methods on objects
Requirements: Create a Car class with:
Fields:
brand,model,year,mileageMethods:
DisplayInfo(),Drive(int miles)Create 3 car objects with different data
Problem 37: Constructors Demo ⭐
Concepts: Default Constructor, Parameterized Constructor
Requirements: Enhance the Car class with:
Default constructor (sets default values)
Parameterized constructor (accepts all fields)
Constructor overloading (partial parameters)
Demonstrate all three constructors
Bonus: Add a copy constructor
Problem 40: Access Modifiers Demo ⭐
Concepts: public, private, protected, internal
Requirements: Create a class demonstrating all access modifiers:
Create another class to test which fields are accessible.
Problem 44: Animal Hierarchy ⭐
Concepts: Base Class, Derived Classes, Method Overriding
Requirements:
Test polymorphic behavior with Animal references.
Problem 47: Method Overloading Demo ⭐
Concepts: Method Overloading, Signature Differences
Requirements: Create Calculator class with overloaded Add methods:
Demonstrate all variants.
Problem 51: Sealed Class Usage ⭐
Concepts: sealed keyword, Preventing Inheritance
Requirements:
Demonstrate when and why to use sealed.
Section 2.3: Advanced OOP (9 Problems)
Problem 61: Reverse Array In-Place ⭐
What You'll Learn: Array manipulation, in-place algorithms
Requirements: Reverse array without creating new array:
Bonus: Reverse only a portion of array
Problem 62: Find Min/Max in Array ⭐
Problem 71: List vs Array Comparison ⭐
What You'll Learn: When to use List vs arrays
Requirements: Create side-by-side comparison showing:
Dynamic sizing (List wins)
Performance (Array wins for known size)
Methods available (List wins)
Memory efficiency (Array wins)
Problem 72: Dynamic List Operations ⭐
Problem 94: Static Utility Library ⭐
Concepts: Static Classes, Static Methods, Math Utilities, Encapsulation
What You'll Learn:
Creating static classes
When to use static vs instance
Static utility methods
Math helper libraries
Static constructors
Requirements: Create a static MathHelper class with:
Common math operations
Validation methods
Conversion utilities
Cannot be instantiated
Complete Implementation:
Static vs Instance Comparison:
When to Use Static: ✅ Utility methods (no state needed) ✅ Math libraries ✅ Extension methods ✅ Factory methods ✅ Configuration helpers
When NOT to Use Static: ❌ Need to maintain state ❌ Need polymorphism ❌ Need inheritance ❌ Testing is harder (can't mock easily)
Bonus Challenges:
⭐⭐ Add string utility methods (static class StringHelper)
⭐⭐ Add validation utilities (static class Validator)
⭐⭐⭐ Create extension methods using static class
⭐⭐⭐ Add thread-safe singleton using static
Problem 95: Partial Class Implementation ⭐
Concepts: Partial Classes, Code Organization, File Splitting, Auto-Generated Code
What You'll Learn:
Splitting class definition across files
Organizing large classes
Working with auto-generated code
Partial methods
When partial classes are useful
Requirements: Create an Employee class split across multiple files:
File 1: Properties and basic info
File 2: Business logic and calculations
Demonstrate they compile into single class
Implementation - File 1 (Employee.Properties.cs):
Implementation - File 2 (Employee.BusinessLogic.cs):
Demonstration:
When to Use Partial Classes:
✅ Large Classes: Split into logical files
✅ Auto-Generated Code: Keep generated code separate
✅ Team Collaboration: Different files for different developers
✅ Separation of Concerns:
Partial Methods:
Real-World Example - WinForms:
Test Cases:
Bonus Challenges:
⭐ Split into 3 files (add Validation.cs)
⭐⭐ Use partial methods for logging
⭐⭐ Create partial interface (advanced C# 13)
Interview Tips: 💡 Mention: "Partial classes are used in auto-generated code (WinForms, WPF)" 💡 Explain: "All parts must have 'partial' keyword" 💡 Know limitation: "All parts must be in same assembly and namespace"
Last updated