Interactive Demo

Try a Challenge Right Now!

Experience our interactive coding environment with this simple Go challenge. See how our platform helps you learn and practice Go programming.

Challenge 1
Sum of Two Numbers
Challenge 1: Sum of Two Numbers
Beginner

Problem Statement

Write a function Sum that takes two integers and returns their sum.

Function Signature

func Sum(a int, b int) int

Sample Input and Output

Sample Input 1

2, 3

Sample Output 1

5

Sample Input 2

-5, 10

Sample Output 2

5

Constraints

  • -10^9 <= a, b <= 10^9
Demo Mode
Click "Run Simulation" to test your solution.
Progressive Hints

Click "Show Next Hint" to reveal hints one by one

0 of 3 hints revealed

📚 Learning Resources

Go Functions

Functions in Go are declared using the func keyword followed by the function name, parameters, and return type.

func functionName(param1 type1, param2 type2) returnType {
    // function body
    return value
}

Function Parameters

Go functions can have zero or more parameters. If consecutive parameters have the same type, you can omit the type from all but the last:

func add(a, b int) int {
    return a + b
}

Return Values

Functions can return multiple values. This challenge requires returning a single integer.

💡 Pro Tip

Go's syntax is designed to be simple and readable. The sum function you're implementing is one of the most basic operations in programming!

🔗 Additional Resources

Try Full Version

Ready to Master Go Programming?

This was just a taste! Get access to all 30+ challenges with automated testing, submissions, leaderboards, AI interview simulation, and much more.

⭐ Free forever • 500+ GitHub stars • 30+ challenges • Active community