Skip to content

Repository with the purpose to testing (Programmers's Test/Unit Tests) with katas and solutions from HackerHank, Edabit and Leetcode.

Notifications You must be signed in to change notification settings

dheysonalves/languages-kata-showcase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Languages Kata Showcase

A multi-language playground for practicing programming katas and coding challenges from various platforms including Exercism, LeetCode, HackerRank, and Edabit.

A code kata is an exercise in programming which helps programmers hone their skills through practice and repetition

Project Structure

This repository contains implementations of coding challenges in multiple programming languages:

languages-kata-showcase/
├── c/                          # C programming challenges
│   └── exercism/
│       ├── difference_of_squares/
│       └── grains/
├── go/                         # Go programming challenges
│   └── exercism/
│       └── difference_of_squares/
├── javascript/                 # JavaScript challenges with TDD
│   └── src/
│       ├── Edabit/            # Edabit challenges
│       ├── HackerRank/        # HackerRank challenges
│       └── LeetCode/          # LeetCode challenges
└── .vscode/                   # VS Code configuration

Supported Languages

C

  • Exercism Challenges: Implementation of classic programming problems
  • Features: Unit testing with custom test runner, header files, Makefile build system
  • Current Challenges:

Go

  • Exercism Challenges: Go implementations with standard testing
  • Features: Go modules, table-driven tests
  • Current Challenges:

JavaScript

  • Multiple Platforms: LeetCode, HackerRank, and Edabit challenges
  • Features: TDD with Mocha/Chai, ES6+ syntax, comprehensive test coverage
  • Platforms Covered:
    • LeetCode: Array manipulation, binary operations
    • HackerRank: Interview preparation problems
    • Edabit: Various difficulty levels from beginner to advanced

Getting Started

Prerequisites

  • C: GCC compiler, Make
  • Go: Go 1.21+
  • JavaScript: Node.js, npm/yarn

Running C Challenges

cd c/exercism/difference_of_squares
make test

Running Go Challenges

cd go/exercism/difference_of_squares
go test -v

Running JavaScript Challenges

cd javascript

# Install dependencies
npm install

# Run all tests
npm test

# Run specific kata
npm test "kata-name"

# Run tests in watch mode
npm run test:tdd

Featured Challenges

Difference of Squares

Available in: C, Go

Calculate the difference between the square of the sum and the sum of the squares of the first N natural numbers.

  • Square of sum: (1 + 2 + ... + N)²
  • Sum of squares: 1² + 2² + ... + N²
  • Difference: Square of sum - Sum of squares

Example: For N=10

  • Square of sum: (1+2+...+10)² = 55² = 3025
  • Sum of squares: 1²+2²+...+10² = 385
  • Difference: 3025 - 385 = 2640

JavaScript Challenges

LeetCode Examples:

Edabit Examples:

HackerRank Examples:

Testing

C

Custom test runner with assertions:

assert(square_of_sum(10) == 3025);
printf("✓ test_square_of_sum_ten passed\n");

Go

Table-driven tests:

tests := []struct {
    name     string
    input    int
    expected int
}{
    {"ten", 10, 3025},
}

JavaScript

Mocha with Chai for BDD-style testing:

describe('FizzBuzz', () => {
  it('should return "Fizz" if divisible by 3', () => {
    expect(calculate(9)).to.be.equal('Fizz');
  });
});

Development Setup

VS Code Configuration

The project includes VS Code settings for:

  • C/C++ IntelliSense configuration
  • Language-specific formatting
  • Integrated terminal support

Code Quality

  • JavaScript: ESLint with Airbnb config, Babel for ES6+ support
  • C: Wall, Wextra compiler flags for strict compilation
  • Go: Built-in formatting and testing tools

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b my-new-kata
  3. Add your solution with tests
  4. Commit your changes: git commit -m 'Add solution for XYZ kata'
  5. Push to the branch: git push origin my-new-kata
  6. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Acknowledgments

  • Exercism: For providing excellent programming exercises
  • LeetCode: For algorithm and data structure challenges
  • HackerRank: For interview preparation problems
  • Edabit: For diverse coding challenges

About

Repository with the purpose to testing (Programmers's Test/Unit Tests) with katas and solutions from HackerHank, Edabit and Leetcode.

Topics

Resources

Stars

Watchers

Forks