Python Challenges
- Simple Calculator - Write a Python script that takes two numbers and a basic arithmetic operation (add, subtract, multiply, divide) as input and outputs the result.
- List Comprehensions - Use list comprehensions to generate a list of squares of the first 10 positive integers.
- File Operations - Read a text file, count the frequency of each word, and write the results to a new file.
- Decorator Function - Implement a decorator that measures the execution time of a function.
- Generators - Create a generator function that yields an infinite sequence of Fibonacci numbers.
C/C++ Challenges
- Memory Management - Write a C++ program that dynamically allocates an array of integers, modifies it, and then properly deallocates it.
- Class Inheritance - Implement a simple class hierarchy representing geometric shapes with methods to compute area and perimeter.
- Template Functions - Create a template function in C++ that can accept any numerical data type and return its square.
- Multithreading - Write a C++ program that uses multiple threads to parallelize a simple computational task, like calculating factorial of different numbers.
- Smart Pointers - Refactor a legacy C++ code that uses raw pointers to use smart pointers instead.
JavaScript/TypeScript Challenges
- DOM Manipulation - Create a simple HTML/CSS page and write JavaScript to dynamically change the content when a user clicks a button.
- Asynchronous Fetch - Use
fetch
to retrieve user data from a public API and display it on a webpage.
- TypeScript Interfaces - Define a TypeScript interface for a
User
object and write a function that takes a User
object and logs a specific greeting.
- Promises and Async/Await - Convert a series of nested callbacks into clean code using Promises and then refactor it to use async/await.
- Functional Programming - Write a TypeScript function that takes an array of numbers and returns a new array containing only the numbers that are divisible by a given divisor, using functional programming concepts like
filter
.
Go Challenges
- Hello World API - Write a simple HTTP server in Go that responds to
/hello
route with a "Hello, World!" message.
- Goroutines and Channels - Implement a Go program that uses goroutines and channels to perform a concurrent calculation, such as summing the elements of an array.
- Interface Implementation - Define an interface for a vehicle, and implement it in different structs representing different types of vehicles.
- Error Handling - Write a Go program that opens a file and reads its contents, properly handling any errors that might occur using idiomatic Go error handling.
- Dependency Injection - Implement a simple dependency injection pattern in Go to manage dependencies in a small application.
Warm-up Challenges (1-5)
- C/ C++: Write a function that takes an integer
n
as input and returns the nth
Fibonacci number.
- Python: Implement a simple calculator with basic arithmetic operations (+, -, *, /)
using a dictionary-based approach.
- JavaScript/ TypeScript: Create a recursive function
factorial
that calculates the
factorial of a given integer n
.
- Go: Write a program that prints the first 10 prime numbers.
Medium-Challenge Zone (6-15)
-
C/ C++: Implement a simple queue data structure using structs and pointers.
-
Python: Write a function max_subarray_sum
that takes an array of integers as input
and returns the maximum sum of a subarray.
-
JavaScript/ TypeScript: Create a class Graph
with methods for adding edges, finding
neighbors, and performing BFS/Dijkstra's algorithm.
-
Go: Implement a simple chat server using TCP sockets.
-
C/ C++: Write a function merge_sort
that implements the merge sort algorithm for
sorting an array of integers.
-
Python: Implement a simple decision tree classifier using a dictionary-based
approach.
-
JavaScript/ TypeScript: Create a function binary_search
that performs
binary search on a sorted array of integers.
-
Go: Write a program that calculates the average of three numbers entered by the user.
-
C/ C++: Implement a simple stack data structure using structs and pointers.
-
Python: Write a function flatten_list
that takes an nested list as input and
returns a flattened list.
-
JavaScript/ TypeScript: Create a class HashTable
with methods for adding key-value
pairs, looking up values by key, and resizing the table.
Challenge Zone (16-20)
-
C/ C++: Implement a simple heap data structure using structs and pointers.
-
Python: Write a function find_closest_pair
that takes an array of 2D points as
input and returns the closest pair of points.
-
JavaScript/ TypeScript: Create a function generate_random_walk
that generates a
random walk (sequence of random steps) on a graph with given nodes and edges.
-
Go: Write a program that implements a simple priority queue using a binary heap.
-
C/ C++ (or your choice): Implement a simple, command-line-based game like Tic-Tac-Toe
or Hangman using the language of your choice.