Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lucas-erkana/algorithms

This is just a repo for practicing coding challenges
https://github.com/lucas-erkana/algorithms

coding-challenges javascript ruby

Last synced: about 1 month ago
JSON representation

This is just a repo for practicing coding challenges

Awesome Lists containing this project

README

        

# Succeeding at live coding challenges (algorithms & data structures)

## Learning objectives

- Solve simple interview-like coding challenges.
- Demonstrate ability to deal with common issues during the live coding session part of a technical interview.
- Provide feedback to a peer after a mock interview.

### **Estimated time**: 2h

## Description

In this lesson, you will practice your **live coding skills** focusing on one out of the following list of data structures and algorithms per round:

- Data structure: Array
- Data structure: String
- Data structure: Linked List
- Algorithm: Recursion
- Algorithm: Sorting & Searching

## Preparatory work

In order to do this exercise well you need to make sure you:

- Have a good understanding of the fundamental data structures: arrays, strings and linked lists
- Have a good understanding of the most important algorithms: recursion, sorting & searching
- Have [GitHub Copilot](https://github.com/features/copilot) turned off

Take a look at the following resources to refresh your mind!

### Data structures

Data structures are the **building blocks of applications**. They allow us to **most efficiently store data** in order to create fast and cheap algorithms.

- [What is a Data Structure?](https://www.simplilearn.com/tutorials/data-structure-tutorial/what-is-data-structure)

#### Data structure: Array

An `array` is a data structure that **collects elements of the same data type** and **stores them in contiguous** memory locations.

- [Definition of Array](https://www.youtube.com/watch?v=55l-aZ7_F24)
- [Array cheatsheet](https://www.techinterviewhandbook.org/algorithms/array/)

#### Data structure: String

A `string` (or string literal) is an **array of characters** (i.e. any combination of numbers, letters, symbols).

- [Basics of String Literals](https://www.youtube.com/watch?v=IlqiTmcK1Eg)
- [String cheatsheet](https://www.techinterviewhandbook.org/algorithms/string/)

#### Data structure: Linked List

A `Linked List` is a user-defined data structure that consists of **nodes** that point to either in one direction (singly Linked List) or both directions (doubly Linked List).

- [Introduction to Linked List](https://www.youtube.com/watch?v=R9PTBwOzceo)
- [Linked Lists for Technical Interviews](https://www.youtube.com/watch?v=Hj_rA0dhr2I)
- [Linked list cheatsheet](https://www.techinterviewhandbook.org/algorithms/linked-list/)

### Algorithms

An algorithm is a **set of instructions** that (when executed in order)** solves a computational problem**.

- [What is an Algorithm?](https://www.youtube.com/watch?v=vVYG8TNN7hg)

#### Algorithm technique: Recursion

While technically not an algorithm, recursion is an algorithm technique used to help break down an algorithm into a `base case` and `recursive cases`. While these algorithms can also be implemented using loops, they tend to be more readable.

- [Recursion cheatsheet](https://www.techinterviewhandbook.org/algorithms/recursion/)
- [Recursion - FreeCodeCamp](https://www.youtube.com/watch?v=IJDJ0kBx2LM)

#### Algorithm: Sorting and searching

Sorting and searching are two fundamental operations that are performed on most data structures. Sorting serves to **order elements** in a particular way, while searching deals with **finding the desired element in a particular data structure**.

There are various strategies (in other words, algorithms) to implement sorting and searching that you have to know.

- [Sorting and searching cheatsheet](https://www.techinterviewhandbook.org/algorithms/sorting-searching/)
- [Understanding sorting algorithms - FreeCodeCamp](https://www.youtube.com/watch?v=l7-f9gS8VOs)
- [Searching and Sorting - MIT lecture](https://www.youtube.com/watch?v=6LOwPhPDwVc)

## Exercise

> 💡 Please make use of the [following rubric](https://docs.google.com/document/d/18oP47pnzkLsy01T6220CvaxQhbhh061XmC8tTqVkYOQ) while you go through the exercise.

The best way to improve your live coding skill is to practice often. When better than in a mock interview? Together with a peer you are instructed to **choose one data structure to focus on** and then solve the challenge **using our recommended 4 step approach**. Select one person and follow the instructions:

1. Choose a data structure or algorithm to focus on
[Add two numbers](https://github.com/Lucas-Erkana/Algorithms/tree/main/Add%20Two%20Numbers)
[Add Binary](https://github.com/Lucas-Erkana/Algorithms/tree/main/Add%20binary)
[Award Budget Cuts](https://github.com/Lucas-Erkana/Algorithms/tree/main/Award%20Budget%20Cuts)
[Basic Calculator IV](https://github.com/Lucas-Erkana/Algorithms/tree/main/Basic%20Calculator%20IV)
[Remove Duplicates from Sorted Array](https://github.com/Lucas-Erkana/Algorithms/tree/main/Remove%20Duplicates%20from%20Sorted%20Array)

2. Pick 1 **easy** coding challenge from the list
3. Solve the challenge using our **recommended approach** - **(25 min total)**
- 💡 Understand - Make sure that you understand what the inputs and outputs should be, as well as potential edge cases - **(5 min)**
- 🗺 Plan - Create a plan of action (in pseudocode) - **(5 min)**
- 💬 Report - Communicate what you are doing while you're solving the problem - **(10 min)**
- 🤔 Reflect- Analyze the algorithm and (1) share its efficiency using Big O and/or (2) propose how you could've solved it differently - **(5 min)**
4. Interview gives feedback on structure and content - **(5 min)**
5. _Switch roles and repeat for 2 times total per person_

⏰ **Time**: 30 minutes per person per round

**Guiding questions:**

- Does this challenge match any patterns you've seen before?
- Are there any well-known algorithms (i.e. recursion or sorting) you can use?

---

_If you spot any bugs or issues in this activity, you can [open an issue with your proposed change](https://github.com/microverseinc/curriculum-transversal-skills/blob/main/git-github/articles/open_issue.md)._