Public repo of coding challenges practice
I'm trying out doing all the old fashioned interview coding questions in a browser based IDE (CodeSpaces). I just want to get a handle on how far along these environments are for developing in.
All coding challenges will be written in TypeScript. I'm going to make an effort to use Deno and Node and document how I feel about them all.
I'll also be using a test driven development approach to these tests.
I'm also going to be documenting all solutions in Solutions.md
Write a function that prints "Hello, World!"Write tests to ensure that the function correctly prints "Hello, World!"
Write a function that takes two numbers and returns their sum.Write tests to ensure that it works as expected.
Write a function to reverse a string.Write tests for various cases including palindromes and empty strings.
Write a function to check if a string is a palindrome.Write tests for this function.
Implement the classic FizzBuzz problem.Write tests that check for 'Fizz', 'Buzz', and 'FizzBuzz'.
Write a function that returns then-th
Fibonacci number.Write tests for this function.
Write a function to calculate the factorial of a given number.Write tests to ensure the function works correctly.
- Write a function that finds the maximum number in an array.
- Write tests for this function.
- Write a function that calculates the average of an array of numbers.
- Write tests for this function.
- Write a function that removes duplicate values from an array.
- Write tests for this function.
- Write a function to merge two sorted arrays into a new sorted array.
- Write tests for this function.
- Implement basic operations for a singly linked list:
insert
,delete
,search
. - Write tests for these operations.
- Implement a stack with methods
push
,pop
, andpeek
. - Write tests for these methods.
- Implement a queue with methods
enqueue
,dequeue
, andpeek
. - Write tests for these methods.
- Given an array and a target, find the indices of two numbers that add up to the target.
- Write tests for this function.
- Write a function to find the minimum element in a rotated sorted array.
- Write tests for this function.
- Write a function to find the length of the longest substring without repeating characters.
- Write tests for this function.
- Write a function to validate if the input string has valid open and close parentheses.
- Write tests for this function.
- Write a function to find the contiguous subarray with the largest sum.
- Write tests for this function.
- Implement the
strStr()
function to locate a substring within a string. - Write tests for this function.
- Write a function to check if two strings are anagrams of each other.
- Write tests for this function.
As a VSCode user I find that it genuinely works near seemlessly. I was honestly surprised because I've used codeSandbox in the past and I wasn't that impressed.
I did have an issue where syntax highlighting wasn't working but changing my theme to Light(Visual Studio)
fixed that. I also ran into a pretty typical ESLint not working issues that VSCode also sometimes has but reloading the page actually helps.
I appreciate not having to clone a repo and have such a neatly organised environment on my Mac.
I also appreciate that CodeSpaces encourages you to always commit your code or else they'll keep your CodeSpace active, which costs a small fee.