Being able to test the code you have written is an important part of coding. For a lot of the projects, I have worked on when I wrote some code for an app I would then test the code by going into the app and checking everything is working as expected and that I haven’t broken anything. …


Backtracking is a general algorithm that can be used to find one or multiple solutions to some computational problems. Basically, how we use backtracking we make some sort of choice if that choice is wrong we ‘backtrack’ to where we can make a different choice and move forward from there until we get a correct solution or run out of options in a case where there is no solution.

From this, we can see how backtracking is very often associated with recursion where we recursively call a function to move through the different options until we break out of the…


For most of the projects I created while attending the Flatiron Software Engineering program and since have used Ruby/Ruby on Rails as the backend and JavaScript as the Frontend. I have since been learning Node JS as a backend language and using Express as it is a popular framework for Node JS. In this post, I will write about validating the information being sent when a form is submitted.

When we work with and have forms online there are often validations in the form to ensure you are filling out the form correctly and with valid information. A popular form…


When coding and working through algorithms and code challenges, if I needed to loop over or iterate through something we can use a loop. I wrote an earlier post on using a for loop which is a common loop where we loop while a condition is met and then do something so the condition changes each time. A while loop is similar to this in that we keep looping while a certain condition is true, unlike the for loop which usually has 3 parts the while loop just contains the condition that while true the loop will run. …


With Ruby and Ruby on Rails we can create and generate full-stack applications. If we want to we can also just use Ruby for the backend or the API with a different front-end and we can use Rails to do this. To start in our terminal we create a new rails app (provided you have rails installed) with the code:

rails new app-name-api -d=postgresql --api

This will generate all the rails files, the added flags of d is to select the database as a PostgreSQL database (Rails defaults to SQLite if this flag isn’t put in) and the api flag…


In programming, we can work with Matrices, which can be created with a 2d Array which is simply arrays nested inside an array (it is also possible to create greater multi-dimensional arrays 3d, 4d by further nesting).

A 2d array would simply look something like this.

[[1,3,9,4],
[5,7,9,5],
[1,1,1,2],
[6,3,8,4]]

We can access elements in this 2d array the same way that we would a regular array with [] just another level deeper so array[i][j] with the i representing the row and the j representing the column. So if we wanted to access the 1 in the top left corner…


In programming, there are several different data structures each with its own benefits and drawbacks. One of these data structures is called a Linked List, within linked lists, there are Singly-linked lists and Doubly linked lists. As the names suggest the difference between the two is singly linked lists have one link between two nodes going in one direction. Whereas, doubly linked lists have two links between nodes one link going to the next node and one link to the previous node. Below is a visualization of the difference between the two:

A linked list can be created and used…


Working through data structure and algorithm problems it’s important to come up with solutions that are efficient and continue to work efficiently even as the data set gets larger. This means having a good Big O time complexity, and for certain problems sets one way to do this is with Hash Maps.

A hash map stores key-value pairs in JavaScript a hash map can be a Javascript object or JavaScript’s built-in Map object. Other languages have their own versions of this too, for example in Python it’s a dictionary or in Ruby, it’s a hash, the main idea is the…


Recursion in Computer Science is a method for solving problems. More specifically in programming, you can create recursive functions to solve problems.

Above you can see Google’s definition of recursion with a ‘Did you mean: recursion’ which unlike other ‘Did you mean:’ links usually on Google when you have a spelling error this link just puts you in an endless (recursive) link to the same page.

So, above is the definition for recursion. But to define recursion in programming and for functions, there are two cases we need to think about the recursive case and the base case.

The recursive…


In programming, the sliding window is a technique or method that can be used to help solve problems. It can be used to make solutions more efficient normally by reducing the time complexity down to O(n).

Like all algorithms or techniques, it is useful with certain problems but obviously not all. If we are looking for a window of values with constraints on the values we want in that window. We also use left and right pointers to be the left and right of the window, it slides along the string or array. The window can also get bigger or…

Ronan McClorey

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store