<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Autumn</title>
    <description>The latest articles on DEV Community by Autumn (@brandonskerritt).</description>
    <link>https://dev.to/brandonskerritt</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F139672%2F7d9dace8-d92a-4aa2-8d28-c0306eccfbab.png</url>
      <title>DEV Community: Autumn</title>
      <link>https://dev.to/brandonskerritt</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/brandonskerritt"/>
    <language>en</language>
    <item>
      <title>The Ultimate Guide to Writing Effective Commit Messages: Best Practices and Conventional Commits</title>
      <dc:creator>Autumn</dc:creator>
      <pubDate>Sun, 18 Jun 2023 07:48:46 +0000</pubDate>
      <link>https://dev.to/brandonskerritt/the-ultimate-guide-to-writing-effective-commit-messages-best-practices-and-conventional-commits-10hd</link>
      <guid>https://dev.to/brandonskerritt/the-ultimate-guide-to-writing-effective-commit-messages-best-practices-and-conventional-commits-10hd</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OTrjrW9E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/06/git_commit_2x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OTrjrW9E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/06/git_commit_2x.png" alt="The Ultimate Guide to Writing Effective Commit Messages: Best Practices and Conventional Commits" width="800" height="456"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Want to watch this as a video? Click below 👇&lt;/strong&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/uqJ1BgLfFsU"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Is writing good commit messages important?
&lt;/h1&gt;

&lt;p&gt;The code in a commit explains what's happening, but the message explains &lt;em&gt;why&lt;/em&gt; it's happening.&lt;/p&gt;

&lt;p&gt;Commits are a powerful tool to improve the maintainability of projects and create documentation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Good commit messages make it faster to review
&lt;/h2&gt;

&lt;p&gt;Imagine this. Your deadline is in 2 hours, all you need to do is merge some code.&lt;/p&gt;

&lt;p&gt;You submit your pull request.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--U0wM__IQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/06/Screenshot-2023-06-13-at-19.35.55.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--U0wM__IQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/06/Screenshot-2023-06-13-at-19.35.55.png" alt="The Ultimate Guide to Writing Effective Commit Messages: Best Practices and Conventional Commits" width="800" height="436"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Pretend it's more than 1 file, please. Like 3 or 4 files? and ~100 extra lines of code. I didn't put much effort into this lol&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;BUT! Your stupid silly teammates are not reviewing it fast enough!!!&lt;/p&gt;

&lt;p&gt;YOUR DEADLINE is in 2 HOURS!!!! if this isn't merged NOW you'll have to wait for the next release train, which means customers will be unhappy!!&lt;/p&gt;

&lt;p&gt;Now, now. Slow down! You see, the thing is... it's hard to review pull requests when your team is busy and they don't even know what your pull request &lt;em&gt;is&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;If I see a pull request like this, my reaction is...&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Ok, it adds code to make &lt;em&gt;it&lt;/em&gt; work. What's &lt;em&gt;it&lt;/em&gt;? And it's tested...? how? ok i love my team but i do not have time to review this and answer those questions, I will time-box it next week or something&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You see, in my head, I only have so much brain capacity before I must scream. I have already planned out my day, and my week to meet my own deadlines.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PbboDYP_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i0.wp.com/www.michigandaily.com/wp-content/uploads/2023/03/Cassidy-Brimer-1_Head-empty-1.png%3Ffit%3D1200%252C907%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PbboDYP_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i0.wp.com/www.michigandaily.com/wp-content/uploads/2023/03/Cassidy-Brimer-1_Head-empty-1.png%3Ffit%3D1200%252C907%26ssl%3D1" alt="The Ultimate Guide to Writing Effective Commit Messages: Best Practices and Conventional Commits" width="800" height="605"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm not sure how long this would take for me to review, figure out how it's tested, and what it's meant to do. So, I must delay it until my Brain Capacity™️ frees up.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://who-t.blogspot.com/2009/12/on-commit-messages.html?ref=skerritt.blog"&gt;Peter Hutterer&lt;/a&gt;explains it better than I can:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Re-establishing the context of a piece of code is wasteful. We can’t avoid it completely, so our efforts should go to &lt;a href="http://www.osnews.com/story/19266/WTFs_m?ref=skerritt.blog"&gt;reducing it&lt;/a&gt; [as much] as possible. Commit messages can do exactly that and as a result, &lt;strong&gt;&lt;em&gt;a commit message shows whether a developer is a good collaborator&lt;/em&gt;.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Commits are Git native, and GitHub pull requests are not
&lt;/h2&gt;

&lt;p&gt;Ok so like we all learned &lt;em&gt;git&lt;/em&gt; right? well, we probably learned it from GitHub or maybe Phabricator, or that weird Facebook one that uses stacked commits...&lt;/p&gt;

&lt;p&gt;But here's a fun fact, GitHub pull requests, diffs, whatever you want to call them. &lt;strong&gt;They are not native to git.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Actually there is &lt;code&gt;git request-pull&lt;/code&gt; but when people say "pull request" they are almost always talking about GitHub-style pull requests. The &lt;a href="https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project?ref=skerritt.blog"&gt;Git version is email only&lt;/a&gt; and I have never seen anyone use this.&lt;/p&gt;

&lt;p&gt;When you move from Phabricator to GitHub, the pull requests do not go with you.&lt;/p&gt;

&lt;p&gt;You can write the nicest pull requests on earth, but if the commits are ugly it does not matter.&lt;/p&gt;

&lt;p&gt;You may be thinking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;once a pull request is merged, why do I care?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Well, because...&lt;/p&gt;

&lt;h2&gt;
  
  
  Nicer commits let other programmers speed up the feedback loop
&lt;/h2&gt;

&lt;p&gt;Picture this. I'm a developer being onboarded to a new project. I need to migrate some logs from A to B.&lt;/p&gt;

&lt;p&gt;Ok, no problem. We've done this before. Let me look at my team's commits.&lt;/p&gt;

&lt;p&gt;I see the files they've changed and I similarly change them.&lt;/p&gt;

&lt;p&gt;Now time to push to a pull request.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dLy8lDDU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/06/Screenshot-2023-06-13-at-19.46.37.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dLy8lDDU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/06/Screenshot-2023-06-13-at-19.46.37.png" alt="The Ultimate Guide to Writing Effective Commit Messages: Best Practices and Conventional Commits" width="800" height="161"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Uh oh. There are &lt;em&gt;manual steps???&lt;/em&gt; Frantically I search documentation, Slack, and anything. I don't see this anywhere??&lt;/p&gt;

&lt;p&gt;If the commit originally included &lt;em&gt;all information&lt;/em&gt; related to the change like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How it's been tested (step-by-step)&lt;/li&gt;
&lt;li&gt;Any manual changes that have been made&lt;/li&gt;
&lt;li&gt;What environment it's on, and what environment it will be on&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I would not need to fight so hard to find out how to do this.&lt;/p&gt;

&lt;h2&gt;
  
  
  Git commits lets you use native Git tools
&lt;/h2&gt;

&lt;p&gt;Imagine we find a bug in a production system. Ok, not good.&lt;/p&gt;

&lt;p&gt;We know it landed in a commit at some point in the last 6 months.&lt;/p&gt;

&lt;p&gt;Thankfully we can use &lt;a href="https://git-scm.com/docs/git-bisect?ref=skerritt.blog"&gt;Git Bisect&lt;/a&gt; which performs a binary search over commits to find the issue.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--u8xyfGW1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.redd.it/g7r4mnsok78z.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--u8xyfGW1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.redd.it/g7r4mnsok78z.jpg" alt="The Ultimate Guide to Writing Effective Commit Messages: Best Practices and Conventional Commits" width="662" height="446"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;enjoy your 1 meme&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now, here's a problem. We can identify the commit, but that's all we really know from bisect.&lt;/p&gt;

&lt;p&gt;If the commit has a bad commit message we will not understand the context of the commit. Say the commit was made to fix a bug, obviously, we can't delete the commit.&lt;/p&gt;

&lt;p&gt;But, if the commit did not contain useful information, we might. And we might break things even more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Commits let us use Git native tooling which in turn improves our lives.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Other tools include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Git Squash&lt;/li&gt;
&lt;li&gt;Git Rebase&lt;/li&gt;
&lt;li&gt;Git Merge&lt;/li&gt;
&lt;li&gt;Git Blame&lt;/li&gt;
&lt;li&gt;Git Revert&lt;/li&gt;
&lt;li&gt;Git Log&lt;/li&gt;
&lt;li&gt;Git Shortlog&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;and so on.&lt;/p&gt;

&lt;p&gt;Ok, so git commits are important, Let's talk about how to write em starting with...&lt;/p&gt;

&lt;h1&gt;
  
  
  How to title a git commit message
&lt;/h1&gt;

&lt;p&gt;From the &lt;code&gt;git commit&lt;/code&gt; &lt;a href="https://www.kernel.org/pub/software/scm/git/docs/git-commit.html?ref=skerritt.blog#_discussion"&gt;manpage&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Though not required, it’s a good idea to begin the commit message with a single short (less than 50 character) line summarizing the change, followed by a blank line and then a more thorough description.   &lt;/p&gt;

&lt;p&gt;The text up to the first blank line in a commit message is treated as the commit title, and that title is used throughout Git. For example, Git-format-patch(1) turns a commit into email, and it uses the title on the Subject line and the rest of the commit in the body.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;it should:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Be concise&lt;/li&gt;
&lt;li&gt;72 characters or less (GitHub truncates this otherwise)&lt;/li&gt;
&lt;li&gt;Describe exactly what the commit is doing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first word of the title should be a verb, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fix -&amp;gt; Fixing a bug&lt;/li&gt;
&lt;li&gt;Feat -&amp;gt; A new feature&lt;/li&gt;
&lt;li&gt;Chore -&amp;gt; Often manual chore&lt;/li&gt;
&lt;li&gt;CI -&amp;gt; Updating continuous integration&lt;/li&gt;
&lt;li&gt;Docs -&amp;gt; Writing documentation&lt;/li&gt;
&lt;li&gt;Tests -&amp;gt; Writing tests&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This narrows down the scope even more so that instantly people know what you're trying to do. Like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8ZfSA8AR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/06/Screenshot-2023-06-14-at-07.39.01.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8ZfSA8AR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/06/Screenshot-2023-06-14-at-07.39.01.png" alt="The Ultimate Guide to Writing Effective Commit Messages: Best Practices and Conventional Commits" width="800" height="112"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;feat: add new api handler for burger-maker&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZAXnCNl8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/06/Screenshot-2023-06-14-at-07.39.34.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZAXnCNl8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/06/Screenshot-2023-06-14-at-07.39.34.png" alt="The Ultimate Guide to Writing Effective Commit Messages: Best Practices and Conventional Commits" width="800" height="127"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;CI: update CI image to 3.0.07&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If your pull request is a breaking change, we can suffix the verb with an &lt;code&gt;!&lt;/code&gt; like &lt;code&gt;feat!: change type def of /burger to Burger&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;A breaking change is a change which breaks how users expect our system to work and may cause bugs if they are not aware.&lt;/p&gt;

&lt;p&gt;We can also scope down our title, even more, using parathesis like &lt;code&gt;feat!(api): add handler for burger maker&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--C3Dv8q_r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/06/Screenshot-2023-06-14-at-07.40.06.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--C3Dv8q_r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/06/Screenshot-2023-06-14-at-07.40.06.png" alt="The Ultimate Guide to Writing Effective Commit Messages: Best Practices and Conventional Commits" width="800" height="112"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now when your team looks at the title, they know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What type of change is it&lt;/li&gt;
&lt;li&gt;Is it a breaking change or not?&lt;/li&gt;
&lt;li&gt;What scopes does it affect?&lt;/li&gt;
&lt;li&gt;What is it trying to do?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This method is called &lt;em&gt;conventional commits&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;And it's a nice convention we should follow for commits.&lt;/p&gt;

&lt;p&gt;If your commit is &lt;a href="https://www.freshconsulting.com/insights/blog/atomic-commits/?ref=skerritt.blog"&gt;atomic&lt;/a&gt; and quite small you can skip the rest of this article. Commits like &lt;code&gt;fix spelling in API docs&lt;/code&gt; do not need any more information.&lt;/p&gt;

&lt;h1&gt;
  
  
  Body
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Commits are documentation&lt;/strong&gt; so we should write a good body.&lt;/p&gt;

&lt;p&gt;Fun fact: If you use &lt;code&gt;git commit&lt;/code&gt; without the &lt;code&gt;-m&lt;/code&gt; it'll open the commit in the text editor your terminal is set to. The first line is the title, then a new line, then the rest is the body. GitHub will populate your pull request with the git commit body too, so you can get 2 birds with 1 stone.&lt;/p&gt;

&lt;h2&gt;
  
  
  How did you test it
&lt;/h2&gt;

&lt;p&gt;and more, how can I test it?&lt;/p&gt;

&lt;p&gt;Commits that say "I tested this" are not... helpful. Like how did you test it? Did you run the code and go "This works?" or test every edge case? Did you write automated tests, or is it manually tested?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--L1ZuhEwl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/06/Screenshot-2023-06-14-at-07.40.54.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--L1ZuhEwl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/06/Screenshot-2023-06-14-at-07.40.54.png" alt="The Ultimate Guide to Writing Effective Commit Messages: Best Practices and Conventional Commits" width="800" height="259"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Python code is only executed as the interpreter reaches it. You could definitely have a bug in a function that isn't &lt;em&gt;normally&lt;/em&gt; called and not notice it.&lt;/p&gt;

&lt;p&gt;When you say "I tested this" it means I have to trust you.&lt;/p&gt;

&lt;p&gt;In an ideal world, our tests will be automated. In some areas, this is the kind of dream Sleeping Beauty would have.&lt;/p&gt;

&lt;p&gt;I do trust you, but I would like not to. I'd like to read your commit and see you've tested it very well and I do not have to trust you.&lt;/p&gt;

&lt;p&gt;Alsooo... I may work on your code base in the future. And I may need to test the code. And when I need to test it, I'll learn how to test it either through:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The documentation (if it exists)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How previous commits were tested&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If neither of these things exists, it may take me a few hours to figure out how to test it, or worse! I may need to talk to you to figure out how to test it.&lt;/p&gt;

&lt;p&gt;Engineering hours are wasted this way.&lt;/p&gt;

&lt;p&gt;If we write how we tested things into the commit, we:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remove trust from the equation&lt;/li&gt;
&lt;li&gt;Se missed an edge case and someone calls it up&lt;/li&gt;
&lt;li&gt;Future engineers do not need to spend time figuring out how to test&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'd like to see the commit structured like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Dd6jX-tj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/06/Screenshot-2023-06-14-at-07.45.22.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Dd6jX-tj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/06/Screenshot-2023-06-14-at-07.45.22.png" alt="The Ultimate Guide to Writing Effective Commit Messages: Best Practices and Conventional Commits" width="800" height="641"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Where is this deployed?
&lt;/h2&gt;

&lt;p&gt;You can skip this if your company has a simple dev / prod environment. Read on if you have multiple dev / prod environments&lt;/p&gt;

&lt;p&gt;A small pet peeve of mine is when people say "This is deployed &lt;strong&gt;and&lt;/strong&gt; tested".&lt;/p&gt;

&lt;p&gt;ok, love that for you bestie.&lt;/p&gt;

&lt;p&gt;But uhm... where is "deployed"?&lt;/p&gt;

&lt;p&gt;If your tests involve calling an API endpoint or running the code in the environment, I want to be able to ssh into that environment and run it myself.&lt;/p&gt;

&lt;p&gt;I don't want to, but I like the option. Especially if I spot an edge case that was missed.&lt;/p&gt;

&lt;p&gt;And environments sometimes matter.&lt;/p&gt;

&lt;p&gt;If your change involves a database change, was it tested in &lt;code&gt;dev-59&lt;/code&gt; which is fucked up by all measures and has been left to rot, or is it tested in &lt;code&gt;dev-60&lt;/code&gt; which still resembles our production environment.&lt;/p&gt;

&lt;p&gt;Talking of production, some companies have multiple prod environments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where&lt;/strong&gt; will this code be deployed to? Is it deployed to our &lt;a href="https://www.fedramp.gov/?ref=skerritt.blog"&gt;FedRAMP&lt;/a&gt; environment which requires extreme scrutiny?&lt;/p&gt;

&lt;p&gt;Or is it deployed to the prod environment for our internal tooling, which if it breaks only affects like 20 people?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1vtSDkEZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/06/Screenshot-2023-06-14-at-08.10.02.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1vtSDkEZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/06/Screenshot-2023-06-14-at-08.10.02.png" alt="The Ultimate Guide to Writing Effective Commit Messages: Best Practices and Conventional Commits" width="800" height="103"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Footers
&lt;/h1&gt;

&lt;p&gt;Sometimes there is more info in a commit that we want people to know about, but we don't want to hide it in the body with a single sentence.&lt;/p&gt;

&lt;p&gt;For example, what's more readable?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In this commit, we introduce a new feature for user authentication that enhances security and improves the user experience. We have implemented robust encryption and hashing techniques to securely store passwords. Additionally, we offer optional two-factor authentication (2FA) for added protection. The login and registration processes have been revamped for a smoother user experience. This commit has undergone manual review by Sadiyah in our London office on Thursday, our security expert.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Or this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In this commit, we introduce a new feature for user authentication that enhances security and improves the user experience. We have implemented robust encryption and hashing techniques to securely store passwords. Additionally, we offer optional two-factor authentication (2FA) for added protection. The login and registration processes have been revamped for a smoother user experience.  &lt;/p&gt;

&lt;p&gt;Manually-reviewed-by: Sadiyah, our security expert, in the London office on Thursday.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Footers point out things in an extra obvious way.&lt;/p&gt;

&lt;p&gt;It's not that I don't read your descriptions, it's just if I am on your team it's likely I know roughly what you're working on, so I might skip some descriptions if I feel like I know it already.&lt;/p&gt;

&lt;p&gt;The "reviewed by Sadiyah" part is a bit buried, turning it into a footer makes it extra obvious for me.&lt;/p&gt;

&lt;p&gt;We can include other footers, too.&lt;/p&gt;

&lt;p&gt;If our pull request is related to a Slack channel, we can do &lt;code&gt;slack-channel: #testing-rbac&lt;/code&gt;. If it relates to an incident, we can link the incident too.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Liked this article?&lt;/strong&gt; Please subscribe to my newsletter or Youtube. It'll really help me out and it's free for you :) &amp;lt;3&lt;/p&gt;

</description>
      <category>programming</category>
    </item>
    <item>
      <title>Forcing a device to disconnect from WiFi using a deauthentication attack</title>
      <dc:creator>Autumn</dc:creator>
      <pubDate>Sun, 11 Jun 2023 16:11:39 +0000</pubDate>
      <link>https://dev.to/brandonskerritt/forcing-a-device-to-disconnect-from-wifi-using-a-deauthentication-attack-4h11</link>
      <guid>https://dev.to/brandonskerritt/forcing-a-device-to-disconnect-from-wifi-using-a-deauthentication-attack-4h11</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ozYaDcVG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/06/1_kRaZA3ZkIdj8XIsjt0K-7Q.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ozYaDcVG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/06/1_kRaZA3ZkIdj8XIsjt0K-7Q.jpeg" alt="Forcing a device to disconnect from WiFi using a deauthentication attack" width="800" height="578"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This post will show you how to disable a devices connection to WiFi using a detauthentication attack.&lt;/p&gt;

&lt;p&gt;A deauthentication attack is a type of attack which targets the communication between router and the device. Effectively disabling the WiFi on the device.&lt;/p&gt;

&lt;p&gt;The deauthentication attack isn’t some special exploit of a bug. It’s a created protocol and is being used in real world applications.&lt;/p&gt;

&lt;p&gt;Deauthencation attack’s use a &lt;em&gt;deauthenication frame&lt;/em&gt;. This frame sent from a router to a device forces the device to disconnect. In technical terms it’s called:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“sanctioned technique to inform a rogue station that they have been disconnected from the network”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This means that a device is on the network that shouldn’t be on the network. The router sends a deauthentication frame to the device telling it that it has been disconnected.&lt;/p&gt;

&lt;p&gt;I like to imagine the interaction goes something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eMbDEBoh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://hackernoon.imgix.net/hn-images/1%2AWjJWhfhyXkRoJ901xlSZ4A.png%3Fauto%3Dformat%26fit%3Dmax%26w%3D1920" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eMbDEBoh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://hackernoon.imgix.net/hn-images/1%2AWjJWhfhyXkRoJ901xlSZ4A.png%3Fauto%3Dformat%26fit%3Dmax%26w%3D1920" alt="Forcing a device to disconnect from WiFi using a deauthentication attack" width="800" height="228"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Laptop asking a router if it can go to Google.com&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IoNTWjoR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://hackernoon.imgix.net/hn-images/1%2Aat2w4MnmuK02d4XdcDiA1Q.jpeg%3Fauto%3Dformat%26fit%3Dmax%26w%3D1920" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IoNTWjoR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://hackernoon.imgix.net/hn-images/1%2Aat2w4MnmuK02d4XdcDiA1Q.jpeg%3Fauto%3Dformat%26fit%3Dmax%26w%3D1920" alt="Forcing a device to disconnect from WiFi using a deauthentication attack" width="800" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(this is the last bad comic you’ll see here I promise) Router denying the request and forcing the laptop to disconnect from the network&lt;/p&gt;

&lt;p&gt;In 2015, a &lt;a href="http://nymag.com/selectall/2017/11/you-should-probably-check-your-airbnb-for-hidden-cameras.html?ref=hackernoon.com"&gt;report&lt;/a&gt; showed that some AirBNB’s have hidden cameras which spy on their occupants.&lt;/p&gt;

&lt;p&gt;In response, a programmer created a simple shell script. This script auto-detected the cameras and kicked them from the network using the techniques you will learn:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://web.archive.org/web/20190319100631/https://julianoliver.com/output/log_2015-12-18_14-39"&gt;Detect and disconnect WiFi cameras in the AirBB You're staying in&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The same author wrote a script to auto-kick off Google Glass&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://web.archive.org/web/20150404233618/http://julianoliver.com/output/log_2014-05-30_20-52"&gt;Find a Google Glass and kick it from the network&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; You know the drill. Don’t do this to anyone else that isn’t you unless you have their permission. I am not advocating &lt;em&gt;illegal&lt;/em&gt; hacking.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do you perform a deauthentication attack?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The 2 important things we need to know are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The device we want to kick off of the network&lt;/li&gt;
&lt;li&gt;The router that the device is connected to&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I will go over how to get both in this tutorial.&lt;/p&gt;

&lt;p&gt;This attack is done using Kali Linux but can be done on Mac OS, Linux or &lt;a href="https://docs.microsoft.com/en-us/windows/wsl/about?ref=hackernoon.com"&gt;Bash on Windows&lt;/a&gt;. For best results, use &lt;a href="https://www.kali.org/?ref=hackernoon.com"&gt;Kali Linux&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Firstly we need to install the aircrack-ng suite. Open up a Linux like terminal and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install aircrack-ng

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now run&lt;/p&gt;

&lt;p&gt;iwconfig&lt;/p&gt;

&lt;p&gt;This will show you what your wireless card is called.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lj3juiJ_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://hackernoon.imgix.net/hn-images/1%2AO-INqnxAs2usHvg4QWOPYQ.png%3Fauto%3Dformat%26fit%3Dmax%26w%3D1920" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lj3juiJ_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://hackernoon.imgix.net/hn-images/1%2AO-INqnxAs2usHvg4QWOPYQ.png%3Fauto%3Dformat%26fit%3Dmax%26w%3D1920" alt="Forcing a device to disconnect from WiFi using a deauthentication attack" width="800" height="261"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Image shows the command being run with 3 network cards, eth0, lo and wlan0. wlan0 is the only one with information.&lt;/p&gt;

&lt;p&gt;In this instance, my wireless card is called wlan0. iwconfig only shows you the wireless interfaces. lo and eth0 don’t come up since they are not wireless. This means we know for sure wlan0 is the wireless interface.&lt;/p&gt;

&lt;p&gt;Next run this command:&lt;/p&gt;

&lt;p&gt;airmon-ng start wlan0&lt;/p&gt;

&lt;p&gt;where wlan0 is your network card. This will put your card into &lt;em&gt;monitor mode&lt;/em&gt; which allows the card to monitor all traffic on the network.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pwjK82x_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://hackernoon.imgix.net/hn-images/1%2AhrNB3RNFwR2CNs5U3VN6LA.png%3Fauto%3Dformat%26fit%3Dmax%26w%3D1920" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pwjK82x_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://hackernoon.imgix.net/hn-images/1%2AhrNB3RNFwR2CNs5U3VN6LA.png%3Fauto%3Dformat%26fit%3Dmax%26w%3D1920" alt="Forcing a device to disconnect from WiFi using a deauthentication attack" width="800" height="275"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that the wireless card is in monitor mode we want to see every router around us. You will need to &lt;strong&gt;run iwconfig&lt;/strong&gt;  &lt;strong&gt;again&lt;/strong&gt; as this command will change your network card name. In most cases it changes it to mon0 but in mine it’s changed to wlan0mon.&lt;/p&gt;

&lt;p&gt;Run this command with your new network card name:&lt;/p&gt;

&lt;p&gt;airdump-ng wlan0mon&lt;/p&gt;

&lt;p&gt;And you should see something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--97580gR5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://hackernoon.imgix.net/hn-images/1%2A7QtWmeQawmc1RAU3GYT_Sw.png%3Fauto%3Dformat%26fit%3Dmax%26w%3D1920" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--97580gR5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://hackernoon.imgix.net/hn-images/1%2A7QtWmeQawmc1RAU3GYT_Sw.png%3Fauto%3Dformat%26fit%3Dmax%26w%3D1920" alt="Forcing a device to disconnect from WiFi using a deauthentication attack" width="800" height="231"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is every single router in range. We need to know what router the device is on. You can tell how close a router is by the PWR column. PWR is the signal strength, how close it is to you. The closer it is, the larger the signal strength.&lt;/p&gt;

&lt;p&gt;In this instance our victim (my laptop) is on TP-LINK_32F604. We want to take note of 2 things here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The BSSID (mac address) of the router&lt;/li&gt;
&lt;li&gt;The Channel of the router&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A wireless router broadcasts the WiFi signal on channels ranging from 1 to 11. In this case, our router is on channel 1.&lt;/p&gt;

&lt;p&gt;The BSSID (also called a mac (media access control) address) is an address which specifies the router’s network card. The MAC address is made up of 2 parts, xx:xx:xx:yy:yy:yy&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The first part is xx:xx:xx. In this case, it’s C4:E9:84 These groupings specify the maker of the network card.&lt;/li&gt;
&lt;li&gt;The last three groupings: yy:yy:yy. In this case, it’s 3F:26:04. These groupings specify the exact network card. Not the make or model but the exact network card, much like a license plate specifies the exact car.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each manufacture has a set of MAC addresses they’re allowed to use. These are the xx:xx:xx groupings. Within these mac addresses are the exact cards. You need both parts to find out the exact network card, but you only need the first grouping to find out the manufacturer.&lt;/p&gt;

&lt;p&gt;So far we have found out what the router is. Now we want to find out what the device is. To do this, run this command:&lt;/p&gt;

&lt;p&gt;airodump-ng wlan0mon --bssid [routers BSSID here]--channel [routers channel here]&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AuP0tWxb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://hackernoon.imgix.net/hn-images/1%2AZ37pES5gWN3tqWIict2wRQ.png%3Fauto%3Dformat%26fit%3Dmax%26w%3D1920" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AuP0tWxb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://hackernoon.imgix.net/hn-images/1%2AZ37pES5gWN3tqWIict2wRQ.png%3Fauto%3Dformat%26fit%3Dmax%26w%3D1920" alt="Forcing a device to disconnect from WiFi using a deauthentication attack" width="795" height="190"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Running the command with the previous output above it&lt;/p&gt;

&lt;p&gt;Now you should see something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Js4JIFLD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://hackernoon.imgix.net/hn-images/1%2ArALnFC9n51MIQ2iKubfraQ.png%3Fauto%3Dformat%26fit%3Dmax%26w%3D1920" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Js4JIFLD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://hackernoon.imgix.net/hn-images/1%2ArALnFC9n51MIQ2iKubfraQ.png%3Fauto%3Dformat%26fit%3Dmax%26w%3D1920" alt="Forcing a device to disconnect from WiFi using a deauthentication attack" width="800" height="192"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We need to know what specific device we want to boot off the network. We can see the router there. Luckily on this network there is only 1 device. If you wanted to find out what that device is you can run the first 3 groupings of the MAC address (called STATION here) into Google. I got back &lt;a href="https://hwaddress.com/oui-iab/98-5F-D3?ref=hackernoon.com"&gt;this,&lt;/a&gt; which is the correct device.&lt;/p&gt;

&lt;p&gt;So now we know the MAC address of the router and the MAC address of the device. Let’s initiate our attack.&lt;/p&gt;

&lt;p&gt;Run this command:&lt;/p&gt;

&lt;p&gt;aireplay-ng --deauth 0 -c [DEVICES MAC ADDRESS] -a [ROUTERS MAC ADDRESS] wlan0mon&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The 0 represents an infinite amount of deauth attacks. If you wanted to only run 3 deauth attacks you’ll change this to 3.&lt;/li&gt;
&lt;li&gt;-c is the client, what you’re attacking. This is the devices MAC address.&lt;/li&gt;
&lt;li&gt;-a is the router, what is the router the victim is connected to.&lt;/li&gt;
&lt;li&gt;wlan0mon is the name of the network card still in monitor mode.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tOGUBf4Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://hackernoon.imgix.net/hn-images/1%2AbNkuyRy6jZRqOkYNSv3epg.png%3Fauto%3Dformat%26fit%3Dmax%26w%3D1920" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tOGUBf4Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://hackernoon.imgix.net/hn-images/1%2AbNkuyRy6jZRqOkYNSv3epg.png%3Fauto%3Dformat%26fit%3Dmax%26w%3D1920" alt="Forcing a device to disconnect from WiFi using a deauthentication attack" width="800" height="617"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The device is now disconnected from the network!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vYJsZn8f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/06/dis--1-.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vYJsZn8f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/06/dis--1-.jpeg" alt="Forcing a device to disconnect from WiFi using a deauthentication attack" width="662" height="178"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the clients end it looks like this. The ping timed out and Windows disconnected from the router.&lt;/p&gt;

&lt;p&gt;These commands are simple but yet they are the cornerstone of most cyber security toolkits.&lt;/p&gt;

&lt;h4&gt;
  
  
  Phishing attacks
&lt;/h4&gt;

&lt;p&gt;A simple deauthentication attack will force a victim to reauthenticate. The attacker can than sniff the WPA 4-way handshake and perform a WPA bruteforce attack on the password.&lt;/p&gt;

&lt;p&gt;Another attack that relies heavily on this deauthentication attack is forcing the user to connect to an access point you made. You’ll clone the users router onto your device, then you’ll deauthenticate the user and make sure your router has a higher signal than the original router. The users device will automatically connect to your router since it is “closer”.&lt;/p&gt;

&lt;p&gt;Once the users device is connected to your fake AP you can easily sniff all of their outgoing and incoming connections.&lt;/p&gt;

&lt;p&gt;In the next tutorial, we’ll go over how to force a device to connect to a spoofed access point. Be sure to follow me to keep up to date with this.&lt;/p&gt;

</description>
      <category>hacking</category>
    </item>
    <item>
      <title>Over-engineering my document storage system with Paperless-ngx</title>
      <dc:creator>Autumn</dc:creator>
      <pubDate>Fri, 10 Feb 2023 13:51:08 +0000</pubDate>
      <link>https://dev.to/brandonskerritt/over-engineering-my-document-storage-system-with-paperless-ngx-1ked</link>
      <guid>https://dev.to/brandonskerritt/over-engineering-my-document-storage-system-with-paperless-ngx-1ked</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qNPMzi9x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://images.unsplash.com/photo-1675789652969-ffa422802499%3Fcrop%3Dentropy%26cs%3Dtinysrgb%26fit%3Dmax%26fm%3Djpg%26ixid%3DMnwxMTc3M3wwfDF8YWxsfDI5fHx8fHx8Mnx8MTY3NTk1MjA0OQ%26ixlib%3Drb-4.0.3%26q%3D80%26w%3D2000" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qNPMzi9x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://images.unsplash.com/photo-1675789652969-ffa422802499%3Fcrop%3Dentropy%26cs%3Dtinysrgb%26fit%3Dmax%26fm%3Djpg%26ixid%3DMnwxMTc3M3wwfDF8YWxsfDI5fHx8fHx8Mnx8MTY3NTk1MjA0OQ%26ixlib%3Drb-4.0.3%26q%3D80%26w%3D2000" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I think the first realisation that I was getting old was when I implemented a system to store physical + digital documents and was excited about it.&lt;/p&gt;

&lt;p&gt;My previous document system looked a little something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1KklEx21--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/image.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1KklEx21--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/image.png" alt="Over-engineering my document storage system with Paperless-ngx" width="612" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Whenever someone asked me "hey can you prove you got a C in GCSE Mathematics back in 2014?" I would flip through every single page to find the document. Actually, to be honest, most of the time I replied with "nah" and just took the hit. I am simply too lazy to flip through hundreds of documents.&lt;/p&gt;

&lt;p&gt;Then I discovered &lt;a href="https://github.com/paperless-ngx/paperless-ngx?ref=skerritt.blog"&gt;Paperless-NGX&lt;/a&gt; (which is a fork of &lt;a href="https://github.com/jonaswinkler/paperless-ng?ref=skerritt.blog"&gt;Paperless-NG&lt;/a&gt; which is a fork of &lt;a href="https://github.com/the-paperless-project/paperless?ref=skerritt.blog"&gt;Paperless&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Paperless-NGX promises to free you of the pain of maintaining physical documents.&lt;/p&gt;

&lt;h1&gt;
  
  
  Installation
&lt;/h1&gt;

&lt;p&gt;I have a homelab (read: ex-gaming PC I shove random software onto with a lil Kubernetes cluster). As such normally what I do is grab the &lt;a href="https://hub.docker.com/r/paperlessngx/paperless-ngx?ref=skerritt.blog"&gt;Docker image&lt;/a&gt; and force it to run. My docker compose looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;version: "3.4"
services:
  broker:
    image: docker.io/library/redis:7
    restart: unless-stopped
    volumes:
      - redisdata:/data

  webserver:
    image: ghcr.io/paperless-ngx/paperless-ngx:1.12
    container_name: paperless
    hostname: paperless
    restart: unless-stopped
    depends_on:
      - broker
      - gotenberg
      - tika
    ports:
      - 8000:8000
    healthcheck:
      test: ["CMD", "curl", "-fs", "-S", "--max-time", "2", "http://localhost:8000"]
      interval: 30s
      timeout: 10s
      retries: 5
    volumes:
      - /home/autumn/paperless-ngx/export:/usr/src/paperless/export
      - data:/usr/src/paperless/data
      - /mnt/ssd/paperless-ngx/media:/usr/src/paperless/media
      - /mnt/ssd/paperless-ngx/consume:/usr/src/paperless/consume
    env_file: docker-compose.env
    environment:
      PAPERLESS_REDIS: redis://broker:6379
      PAPERLESS_TIKA_ENABLED: 1
      PAPERLESS_TIKA_GOTENBERG_ENDPOINT: http://gotenberg:3000
      PAPERLESS_TIKA_ENDPOINT: http://tika:9998

  gotenberg:
    image: docker.io/gotenberg/gotenberg:7.8
    restart: unless-stopped

    # The gotenberg chromium route is used to convert .eml files. We do not
    # want to allow external content like tracking pixels or even javascript.
    command:
      - "gotenberg"
      - "--chromium-disable-javascript=true"
      - "--chromium-allow-list=file:///tmp/.*"

  tika:
    image: ghcr.io/paperless-ngx/tika:latest
    restart: unless-stopped

volumes:
  data:
  redisdata:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Note: A lot of this stuff (especially the extra containers) will make sense once you've read the rest of this article!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;And then I run &lt;code&gt;docker compose up&lt;/code&gt; and tada! It works! &lt;a href="https://docs.docker.com/compose/?ref=skerritt.blog"&gt;Docker compose&lt;/a&gt; truly is magical.&lt;/p&gt;

&lt;p&gt;I &lt;em&gt;could&lt;/em&gt; put it into Kubernetes, but I do not need any more things to talk to my therapist about. I also make the distinction between software I care about working [Paperless] and software I am playing around with [Minecraft on K8s].&lt;/p&gt;

&lt;h1&gt;
  
  
  Ingesting Documents
&lt;/h1&gt;

&lt;p&gt;There's a few ways to ingest documents into Paperless:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;There's a &lt;code&gt;consume&lt;/code&gt; folder where if you put stuff into it, Paperless will consume it. This is cool as mine is set up as a Samba share. My printer &lt;em&gt;should&lt;/em&gt; automatically place scanned documents into it for Paperless to consume.&lt;/li&gt;
&lt;li&gt;Email! You can set up an email address to consume new documents. Handy to have automatic rules in your email to send receipts to Paperless.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Or, you can do what I do. I use an app called &lt;a href="https://apps.apple.com/us/app/ocr-scanner-quickscan/id1513790291?ref=skerritt.blog"&gt;QuickScan&lt;/a&gt; which scans my documents via my phone.&lt;/p&gt;

&lt;p&gt;👽&lt;/p&gt;

&lt;p&gt;There's a nice Apple Shortcut which uses the Paperless API to upload documents. Take a picture or download a PDF, go to share and select "upload to Paperless"!  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.icloud.com/shortcuts/d234abc0885040129d9d75fa45fe1154"&gt;https://www.icloud.com/shortcuts/d234abc0885040129d9d75fa45fe1154&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I used to use my printer but HP won't let me complete the captcha to login so I actually cannot use my printer at all (god, I love printers! Please email me (&lt;a href="mailto:autumn@skerritt.blog"&gt;autumn@skerritt.blog&lt;/a&gt;) (or&lt;a href="https://twitter.com/bee_sec_san?ref=skerritt.blog"&gt;tweet me&lt;/a&gt;) with suggestions of printers that &lt;em&gt;just&lt;/em&gt; work without this IoT bullshit!)&lt;/p&gt;

&lt;p&gt;🌝&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fun fact&lt;/strong&gt; - Paperless converts your documents from regular PDFs to &lt;a href="https://en.wikipedia.org/wiki/PDF/A?ref=skerritt.blog"&gt;PDF/A&lt;/a&gt; which is a subset of the PDF standard. This subset is designed for long-term storage.&lt;/p&gt;

&lt;p&gt;Instead of like.... Having QuickScan set up to automatically push your scanned documents into the &lt;code&gt;consume&lt;/code&gt; Samba share (you can do this) I take the lazy route and airdrop it to my mac, where I then just drag and drop it into the UI.&lt;/p&gt;

&lt;p&gt;🤔&lt;/p&gt;

&lt;p&gt;Paperless's default mode is that if a PDF document already contains a layer of text (as it has been &lt;a href="https://aws.amazon.com/what-is/ocr/?ref=skerritt.blog"&gt;OCR'd&lt;/a&gt;) it will use that and not OCR the document. If your OCR tool isn't the best it is better to set &lt;strong&gt;&lt;code&gt;PAPERLESS_OCR_MODE=redo&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Tagging
&lt;/h1&gt;

&lt;p&gt;I highly suggest creating an &lt;code&gt;inbox&lt;/code&gt; tag. This means that all newly consumed documents are assigned the &lt;code&gt;inbox&lt;/code&gt; tag and you can then go through all the new documents and update their names, metadata, tags etc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wxnEQ2g6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-09-at-10.40.37.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wxnEQ2g6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-09-at-10.40.37.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="740"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's like those things you see in older movies except digital.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EkUYrxfm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/image-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EkUYrxfm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/image-1.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;((I also own one of these and I put my documents to be scanned on the middle shelf, and documents that I need to physically store in the bottom shelf. The top shelf is reserved for my &lt;a href="https://www.moomin.com/en/?ref=skerritt.blog"&gt;Moomin collection&lt;/a&gt;))&lt;/p&gt;

&lt;p&gt;You can then create a &lt;code&gt;Saved View&lt;/code&gt; which shows on your homepage of new documents so you have a little list.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NEbaiKPr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-09-at-10.42.58.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NEbaiKPr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-09-at-10.42.58.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="202"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's an example from my Paperless, looks like I need to classify my receipt for the &lt;a href="https://www.casetify.com/en_GB/co-lab/twice?ref=skerritt.blog"&gt;Twice x Casetify phone case&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Tagging
&lt;/h1&gt;

&lt;p&gt;Another Pro Tip™️ is you can create AI based tagging systems.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--H_8xHcjj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-09-at-10.46.32.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--H_8xHcjj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-09-at-10.46.32.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="747"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So for instance I have a tag for all of my NHS documents that's automatically applied (note: you need around ~20 examples before it starts auto-applying tags!)&lt;/p&gt;

&lt;p&gt;You can also do a "if it contains this word, tag it as this".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9rlIb0w5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-09-at-10.47.15.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9rlIb0w5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-09-at-10.47.15.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="937"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I do this for letters related to any of my main forms of ID.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Jbb7Pb9O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-09-at-10.48.13.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Jbb7Pb9O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-09-at-10.48.13.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="441"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There's a bunch of cool matching algorithms you can use!&lt;/p&gt;

&lt;h1&gt;
  
  
  Digital Only 😎
&lt;/h1&gt;

&lt;p&gt;Thanks to Paperless I shredded around ~300 physical documents, and I can easily search and find any of my paperwork (including PDFs).&lt;/p&gt;

&lt;h1&gt;
  
  
  Physical documents
&lt;/h1&gt;

&lt;p&gt;Ok this is all cool, but what if I have documents that have to remain physical like my university degree or more importantly the thousands of receipts for all of my kpop merchandise?&lt;/p&gt;

&lt;p&gt;The answer is ✨ Archive Serial Numbers ✨&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UQNzC8SD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-09-at-13.59.21.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UQNzC8SD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-09-at-13.59.21.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="161"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The concept is rather simple. For any documents you want to physically keep, increment the archive serial number (ASN) and label that onto your document. I use a fancy label maker for this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CYKVCcZN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/image-2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CYKVCcZN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/image-2.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And then store the documents into a binder in sequential order. Then when the binder is full, label the binder with the ASN's it stores (0 - 40, in my case) and store that somewhere.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DoPTBXlH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/image-3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DoPTBXlH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/image-3.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="875"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now when you want to find a physical document, you find its digital counterpart in Paperless, read the ASN number and then find the binder where that ASN is contained. Then simply perform a &lt;a href="https://en.wikipedia.org/wiki/Binary_search_algorithm?ref=skerritt.blog"&gt;binary search&lt;/a&gt; to find the document!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5lXBywA2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/image-4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5lXBywA2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/image-4.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="224"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;👽&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fun fact&lt;/strong&gt; : As of ~3 weeks ago Paperless-ngx supports barcode scanning on documents for ASNs (feature flag is &lt;code&gt;CONSUMER_ENABLE_BARCODES&lt;/code&gt;). So if you buy a &lt;a href="https://www.amazon.co.uk/Phomemo-Portable-Bluetooth-Barcodes-Compatible/dp/B09N8HW3G8?ref=skerritt.blog"&gt;barcode maker&lt;/a&gt; you can create barcodes like "ASN 064" and Paperless-ngx will automatically detect that and set the documents ASN to match the barcode.  &lt;/p&gt;

&lt;p&gt;Paperless also supports &lt;a href="https://github.com/paperless-ngx/paperless-ngx/pull/2554?ref=skerritt.blog"&gt;splitting documents on barcodes&lt;/a&gt;. If you have one long PDF with many documents in it, but each distinct document has its own PDF Paperless will split the document up according to the barcodes.&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;But I made a nice folder structure before using Paperless :(&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;Sooo Paperless bangs all of your files into one folder by default. Which is sad if you've organised your files before Paperless.&lt;/p&gt;

&lt;p&gt;I have a Very Beautiful File System™️ I created:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- 2021
    - January
        06-Payslip.pdf
        09-Receipt-Information.pdf
    - February
        06-Payslip.pdf
- 2022
    - October
        06-Payslip.pdf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Moving to Paperless means destroying my system... Or does it?&lt;/p&gt;

&lt;p&gt;Paperless has this concept of "storage paths". When it processes your file it stores it in a path you choose. Below I've recreated my system:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zihKj-ua--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-26-at-13.56.04.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zihKj-ua--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-26-at-13.56.04.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="147"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to you can make multiple storage paths which match on things in the document. Here's one I made specifically for payslips:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1M2SqBGY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-26-at-13.57.12.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1M2SqBGY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-26-at-13.57.12.png" alt="Over-engineering my document storage system with Paperless-ngx" width="790" height="922"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Paperless supports a myriad of variables for your path:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;{asn}&lt;/code&gt;: The archive serial number of the document, or "none".&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;{correspondent}&lt;/code&gt;: The name of the correspondent, or "none".&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;{document_type}&lt;/code&gt;: The name of the document type, or "none".&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;{tag_list}&lt;/code&gt;: A comma separated list of all tags assigned to the document.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;{title}&lt;/code&gt;: The title of the document.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;{created}&lt;/code&gt;: The full date (ISO format) the document was created.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;{created_year}&lt;/code&gt;: Year created only, formatted as the year with century.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;{created_year_short}&lt;/code&gt;: Year created only, formatted as the year without century, zero padded.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;{created_month}&lt;/code&gt;: Month created only (number 01-12).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;{created_month_name}&lt;/code&gt;: Month created name, as per locale&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;{created_month_name_short}&lt;/code&gt;: Month created abbreviated name, as per locale&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;{created_day}&lt;/code&gt;: Day created only (number 01-31).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;{added}&lt;/code&gt;: The full date (ISO format) the document was added to paperless.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;{added_year}&lt;/code&gt;: Year added only.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;{added_year_short}&lt;/code&gt;: Year added only, formatted as the year without century, zero padded.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;{added_month}&lt;/code&gt;: Month added only (number 01-12).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;{added_month_name}&lt;/code&gt;: Month added name, as per locale&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;{added_month_name_short}&lt;/code&gt;: Month added abbreviated name, as per locale&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;{added_day}&lt;/code&gt;: Day added only (number 01-31).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The full list can be seen &lt;a href="https://docs.paperless-ngx.com/advanced_usage/?ref=skerritt.blog#file-name-handling"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you have already imported all of your files you can add them all to a storage path by making a mass edit. And then any changes to the storage path will automatically update them, so you can change your path in the future automatically if you wanted!&lt;/p&gt;

&lt;p&gt;⚠️&lt;/p&gt;

&lt;p&gt;Do not manually move your files in the media folder. Paperless remembers the last filename a document was stored as. If you do rename a file, paperless will report your files as missing and won't be able to find them. From &lt;a href="https://docs.paperless-ngx.com/advanced_usage/?ref=skerritt.blog#file-name-handling"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Backups
&lt;/h1&gt;

&lt;p&gt;Managing your own documents also means having to manage the backups of documents.&lt;/p&gt;

&lt;p&gt;I wrote a script called &lt;code&gt;syncer.sh&lt;/code&gt; which backs up my files to an external hard drive and to the ✨ cloud ✨&lt;/p&gt;

&lt;p&gt;The first thing we need to do is to perform the backup.&lt;/p&gt;

&lt;p&gt;We can do this by running the below command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker exec paperless document_exporter /usr/src/paperless/export --zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This outputs a file called &lt;code&gt;export-2023-02-12.zip&lt;/code&gt; (the date changes). For my backups I do not want to store a linear archive of files, instead I just want to backup the current version and add new files if anything has changed.&lt;/p&gt;

&lt;p&gt;Because of the filename the archive will always be "different" so I need to change the name of the archive. I've submitted a &lt;a href="https://github.com/paperless-ngx/paperless-ngx/discussions/2652?ref=skerritt.blog"&gt;GitHub Discussion&lt;/a&gt; about choosing your own name with the &lt;code&gt;--zip&lt;/code&gt; option.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# CDs into our export directory and changes the name
cd /home/autumn/paperless-ngx/export
mv *.zip paperless_export.zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My cloud of choice is &lt;a href="https://www.cloudflare.com/en-gb/products/r2/?ref=skerritt.blog"&gt;Cloudflare R2&lt;/a&gt; for 3 reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It's blob based storage with the same API as AWS S3, so I am familar with it.&lt;/li&gt;
&lt;li&gt;It's 😍SHINY😍 and new technology.&lt;/li&gt;
&lt;li&gt;You get 10gb for free!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://developers.cloudflare.com/r2/learning/data-security/?ref=skerritt.blog"&gt;Cloudflare says they encrypt your files&lt;/a&gt;, but I want a little extra protection so I create another zip file with my own encryption.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;zip -e paperless_export_encrypted.zip paperless_export.zip -P no_password_for_you!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we begin the backing up part. Since I trust myself the external hard drive uses the non-encrypted version, and I use &lt;a href="https://www.rsync.net/?ref=skerritt.blog"&gt;rsync&lt;/a&gt; to back it up.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rsync -av paperless_export.zip /mnt/external_hdd/paperless
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If there is no changes between the files, nothing will happen. If there is a change, rsync will update the file on the hard drive with the new version.&lt;/p&gt;

&lt;p&gt;Next up I sync to Cloudflare R2 using &lt;a href="https://rclone.org/?ref=skerritt.blog"&gt;rclone&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rclone sync paperless_export_encrypted.zip r2:paperless-backup -v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And now I deleted the files I exported. This is because it'll get messy if I don't do this!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rm -rfv /home/autumn/paperless-ngx/export/*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My script finally looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker exec paperless document_exporter /usr/src/paperless/export --zip
# we now have a zip folder export
# CD's into the export folder and rename the file
# this is so we can overwrite it
cd /home/autumn/paperless-ngx/export
mv *.zip paperless_export.zip
# encrypt the zip file
zip -e paperless_export_encrypted.zip paperless_export.zip -P no_password_for_you!
# rsync to external hdd
rsync -av paperless_export.zip /mnt/external_hdd/paperless
# sync to cloudflare r2
rclone sync paperless_export_encrypted.zip r2:paperless-backup -v
rm -rfv /home/autumn/paperless-ngx/export/*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And finally I have a Systemd service to run this regularly.&lt;/p&gt;

&lt;p&gt;Here's the service descriptor file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Unit]
Description=syncer backup service
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=on-failure
RestartSec=1
User=autumn
ExecStart=/usr/bin/env sh /home/autumn/syncer/sync.sh

[Install]
WantedBy=multi-user.target
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And a basic timer file to run this regularly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Unit]
Description= Backs up my paperless

[Timer]
OnUnitActiveSec=60s
OnBootSec=60s
Unit= syncer.service

[Install]
WantedBy= basic.target
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  What if the backups fail?
&lt;/h1&gt;

&lt;p&gt;It's a truth universally acknowledged that backups that are not tested regularly will fail.&lt;/p&gt;

&lt;p&gt;What if my script suddenly stops and I lose my data? Then I'll have to restore from old data and lose my documents :(&lt;/p&gt;

&lt;p&gt;The Proper Way™️ to do this would be to install &lt;a href="https://github.com/prometheus-community/systemd_exporter?ref=skerritt.blog"&gt;systemd_metrics_exporter&lt;/a&gt; for &lt;a href="https://prometheus.io/?ref=skerritt.blog"&gt;Prometheus&lt;/a&gt;. That way when the service is failing too often I can get an alert from &lt;a href="https://prometheus.io/docs/alerting/latest/alertmanager/?ref=skerritt.blog"&gt;AlertManager&lt;/a&gt;. I have Prometheus, Grafana and AlertManager set up on my server so it wouldn't be &lt;em&gt;too&lt;/em&gt; hard.&lt;/p&gt;

&lt;p&gt;But, my thought process is "I want to play around and have fun. Why don't I create a script to alert me. That way in the future I can do more advanced alerts. Like making sure my script runs &lt;strong&gt;and&lt;/strong&gt; I can restore from the backups".&lt;/p&gt;

&lt;p&gt;For this reason I wrote a lovely little Rust program to alert me when my Systemd service (or timer) fails to run.&lt;/p&gt;

&lt;p&gt;🥱&lt;/p&gt;

&lt;p&gt;Don't like writing your own software? &lt;a href="https://github.com/healthchecks/healthchecks?ref=skerritt.blog"&gt;https://github.com/healthchecks/healthchecks&lt;/a&gt; is a self-hosted application which does exactly what my script does without the faff of writing Rust!&lt;/p&gt;

&lt;p&gt;Let's run through the code. Firstly, it grabs the status of the service from Systemd.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fn get_systemd_status(service_name: &amp;amp;str) -&amp;gt; bool {
    // systemctl is-active syncer.timer
    let output_timer = Command::new("systemctl")
                     .arg("is-active")
                     .arg(service_name)
                     .output()
                     .expect("failed to execute process");
    if !output_timer.status.success() {
        // Fail state for timer
        println!("Command failed with exit status: {:?}", output_timer.status.code());
        return false
    }
    return true
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It does this by running the command &lt;code&gt;systemctl is-active syncer.service&lt;/code&gt; and seeing if the output is a Success (exit code 0) or not.&lt;/p&gt;

&lt;p&gt;🌝&lt;/p&gt;

&lt;p&gt;Note: the &lt;code&gt;syncer.service&lt;/code&gt; will show as in-active if it hasn't been run in ~30 seconds (I believe). &lt;code&gt;syncer.timer&lt;/code&gt; should always show as active.&lt;/p&gt;

&lt;p&gt;If it's failing the next thing I'd want to see in the alert is the logs. &lt;em&gt;Why&lt;/em&gt; is it failing?&lt;/p&gt;

&lt;p&gt;I do this by calling &lt;code&gt;journalctl&lt;/code&gt; and parse the logs into a string.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fn grab_journalctl_logs(service_name: &amp;amp;str) -&amp;gt; String {
    let output = Command::new("journalctl")
        .arg("--unit")
        .arg(service_name)
        .arg("--since")
        .arg("1 minute ago")
        .arg("--reverse")
        .arg("--no-pager")
        .output()
        .expect("failed to execute process");

    if output.status.success() {
        let logs = String::from_utf8_lossy(&amp;amp;output.stdout).to_string();
        return logs
    } else {
        return "Failed to get logs".to_string();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since this Rust program runs once every 30 seconds we only need to worry about the last minute of logs.&lt;/p&gt;

&lt;p&gt;💡&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fun fact&lt;/strong&gt; : A "pager" is where a Linux command shows you a long list of text and you press enter (or down) to go down the page. &lt;code&gt;--no-pager&lt;/code&gt; disables this.&lt;/p&gt;

&lt;p&gt;With knowledge of which service is failing and why, I build a message to post:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let message = format!("Hey @here \n Service {} failing \n {}", service_name, logs);

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And then I call the Discord webhook using &lt;a href="https://github.com/serenity-rs/serenity?ref=skerritt.blog"&gt;Serenity.rs&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#[tokio::main]
async fn send_discord_message(message: &amp;amp;str) {
    // You don't need a token when you are only dealing with webhooks.
    let http = Http::new("");
    let webhook = Webhook::from_url(&amp;amp;http, "https://discord.com/api/webhooks/WEBHOOK_HERE").await.expect("Replace the webhook with your own");

    webhook
        .execute(&amp;amp;http, false, |w| w.content(message).username("Paperless Checker"))
        .await
        .expect("Could not execute webhook.");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now I can get alerts like this if my backups fail 🥳&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--v35i7Was--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-14-at-08.30.15.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v35i7Was--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-14-at-08.30.15.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="150"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;As your Friendly Neighbourhood Trans Rust Programmer™️ I just had to set the profile picture to Gawr Gura&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;👀 I also wrote some code to make sure my backup in Cloudflare R2 is the latest version.&lt;/p&gt;

&lt;p&gt;The below code will call the S3 API (not using the Rust SDK because AWS says it's a &lt;a href="https://aws.amazon.com/sdk-for-rust/?ref=skerritt.blog"&gt;developer preview&lt;/a&gt; and I don't want to update this too often. The &lt;a href="https://aws.amazon.com/cli/?ref=skerritt.blog"&gt;CLI is stable&lt;/a&gt;) and if the object hasn't been modified within the last 2 days, alert!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// returns false as it hasn't been updated in 2 days
fn check_object_in_r2_is_updated() -&amp;gt; bool {
    let output = Command::new("aws")
        .args(&amp;amp;["s3api", "list-objects-v2"])
        .args(&amp;amp;[
            "--endpoint-url",
            "cloud_storage_url",
        ])
        .args(&amp;amp;["--bucket", "paperless-backup"])
        .output()
        .expect("failed to execute command");

    let output_str = from_utf8(&amp;amp;output.stdout).unwrap();
    let json_obj: Value = serde_json::from_str(output_str).unwrap();

    if let Some(contents) = json_obj.get("Contents") {
        if let Some(object) = contents.get(0) {
            let last_modified_str = object.get("LastModified").unwrap().as_str().unwrap();
            let last_modified = DateTime::parse_from_rfc3339(last_modified_str)
                .unwrap()
                .with_timezone(&amp;amp;Utc);

            let two_days_ago = Utc::now() - Duration::days(2);

            if last_modified &amp;lt;= two_days_ago {
                println!("The object was last modified more than 2 days ago. Returning false.");
                return false;
            } else {
                return true;
            }
        } else {
            println!("Could not get 0th object of R2 API call");
            return false;
        }
    } else {
        println!("Could not get objects of R2 S3 Call");
        return false;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since the Cloudflare upload is the last part of my &lt;code&gt;sync&lt;/code&gt; script, if anything before that fails the entire script fails so Cloudflare won't update. You can say it's like a &lt;a href="https://en.wiktionary.org/wiki/canary_in_a_coal_mine?ref=skerritt.blog"&gt;canary&lt;/a&gt;  🦜&lt;/p&gt;

&lt;p&gt;Now it's just a case of making a service...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Unit]
Description=Make sure paperless backup works
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=on-failure
RestartSec=1
User=autumn
ExecStart=/usr/bin/env ./home/autumn/paperless_backup/target/release/paperless_backup

[Install]
WantedBy=multi-user.target
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And then a timer....&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Unit]
Description= Makes sure the backup script runs

[Timer]
OnUnitActiveSec=30s
OnBootSec=30s
Unit= paperless_backup.service

[Install]
WantedBy= basic.target
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we just enable them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;£ sudo systemctl enable paperless_backup.service
£ sudo systemctl enable paperless_backup.timer 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And it all works fine!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--z8Zcj_Tb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-14-at-08.25.04.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--z8Zcj_Tb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-14-at-08.25.04.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="80"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  🤔 A lot of my documents come in the form of emails
&lt;/h1&gt;

&lt;p&gt;Then good news! Paperless can read your emails and import any attachments sent to you.&lt;/p&gt;

&lt;p&gt;Figure out how to set up IMAP with your email provider. Fastmail users can go here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.fastmail.help/hc/en-us/articles/1500000278342?ref=skerritt.blog"&gt;https://www.fastmail.help/hc/en-us/articles/1500000278342&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And then create a new mail rule. This one adds every attachment to your paperless inbox.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wyUizhym--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-13-at-10.47.57.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wyUizhym--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-13-at-10.47.57.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And then when you reload Paperless all documents with attachments are sent to Paperless. The title of the file is the title of the email. And thanks to inbox tags I get to categorise them as they come in!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EyGNNgj1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-13-at-10.51.24.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EyGNNgj1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-13-at-10.51.24.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="314"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;BUTTTT.....&lt;/strong&gt; Not all of my receipts come in nicely attached documents. Take Amazon receipts:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XfSi2ZnI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-13-at-11.09.00.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XfSi2ZnI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-13-at-11.09.00.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="737"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's just plain old HTML! Ideally I'd like Paperless to...&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Match the subject line &lt;code&gt;Amazon.co.uk order&lt;/code&gt; and realise it's a receipt.&lt;/li&gt;
&lt;li&gt;Process this HTML email and import it into Paperless.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;How can we do that?&lt;/p&gt;

&lt;p&gt;Paperless-ngx supports this! We just need to add 2 new containers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  gotenberg:
    image: docker.io/gotenberg/gotenberg:7.8
    restart: unless-stopped

    # The gotenberg chromium route is used to convert .eml files. We do not
    # want to allow external content like tracking pixels or even javascript.
    command:
      - "gotenberg"
      - "--chromium-disable-javascript=true"
      - "--chromium-allow-list=file:///tmp/.*"

  tika:
    image: ghcr.io/paperless-ngx/tika:latest
    restart: unless-stopped
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Alternatively copy and paste my Docker compose at the start of the blog!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;These convert our HTML emails into PDFS 🤯&lt;/p&gt;

&lt;p&gt;😽&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fun fact&lt;/strong&gt; : Gotenberg, as well as being used for emails, can convert office documents (Excel sheets, Word documents, Markdown etc) into PDFs.  &lt;/p&gt;

&lt;p&gt;This means you can upload any document and it will be in Paperless, or people can email you a Word document invoice and it'll appear in Paperless!&lt;/p&gt;

&lt;p&gt;The way I have it set up is that I move emails I want to save to Paperless to a &lt;strong&gt;Paperless&lt;/strong&gt; folder.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FTJpyAnG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-13-at-20.24.32.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FTJpyAnG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-13-at-20.24.32.png" alt="Over-engineering my document storage system with Paperless-ngx" width="444" height="786"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And then I created a mail rule to match all emails in the Paperless folder:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aOMLdXB1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-13-at-20.25.11.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aOMLdXB1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-13-at-20.25.11.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="564"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And now the emails I want to keep appear in Paperless 🥳&lt;/p&gt;

&lt;p&gt;😥&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Did this not work for you?&lt;/strong&gt; Visit your Paperless logs at &lt;a href="http://192.168.0.1:80/logs"&gt;http://192.168.0.1:80/logs&lt;/a&gt; (change the IP and port out for your instance) and then click on &lt;code&gt;mail.log&lt;/code&gt;. You'll see the logs of Paperless trying to import your emails which can help you debug this 👻&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GutBqp9_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-13-at-20.26.05.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GutBqp9_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-13-at-20.26.05.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="351"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;My inbox is full of Valentines offers 😅&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;To top it off I added an email filter rule to automatically move certain emails (my Amazon receipts) into the Paperless email folder.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--w--0NsKa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-14-at-08.04.33.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--w--0NsKa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-14-at-08.04.33.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="756"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;If subject line is &lt;em&gt;Amazon.co.uk Order&lt;/em&gt;, move it to Paperless folder.&lt;/em&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  A backup for my backups
&lt;/h1&gt;

&lt;p&gt;Okay a backup system to 2 places is nice, and a backup backup checker service is nice. But I need more.&lt;/p&gt;

&lt;p&gt;What if I'm out in the Siberian wilderness with James Bond, but he won't save me until I can prove I am British™️ however at the exact same time my server is offline and accessing my R2 blob storage to get my documents is hassle.&lt;/p&gt;

&lt;p&gt;If only I had YET ANOTHER BACKUP.&lt;/p&gt;

&lt;p&gt;What if this backup was accessible anywhere, anytime and it had a cool search feature so I can search the OCR'd PDFs?&lt;/p&gt;

&lt;p&gt;That's right, I'm talking about....&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UxKjDXCP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/image-5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UxKjDXCP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/image-5.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;((it helps that I pay for Google Drive and only use ~120gb out of 2 terabytes...))&lt;/p&gt;

&lt;p&gt;First we set up &lt;code&gt;rclone&lt;/code&gt; with &lt;a href="https://rclone.org/drive/?ref=skerritt.blog"&gt;Google Drive&lt;/a&gt; support. It wasn't &lt;em&gt;too&lt;/em&gt; hard. I made an oauth token for Drive and had to copy and paste some URLs to authorise it.&lt;/p&gt;

&lt;p&gt;I told &lt;code&gt;rclone&lt;/code&gt; it can only access files it's created too :)&lt;/p&gt;

&lt;p&gt;We want to sync the raw PDF files (not a zip archive) so we can search over them with Google Drive.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rclone sync /mnt/ssd/paperless-ngx/media/documents/archive drive:paperless -v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In Paperless there's 2 folders for documents:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Original - The original files unaltered&lt;/li&gt;
&lt;li&gt;Archive - The files converted to PDF/A and have a layer of OCR'd text.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Which means we want to sync our &lt;code&gt;archive&lt;/code&gt; version.&lt;/p&gt;

&lt;p&gt;Then we add it to our &lt;code&gt;sync&lt;/code&gt; script like so...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker exec paperless document_exporter /usr/src/paperless/export --zip
# we now have a zip folder export
# CD's into the export folder and rename the file
# this is so we can overwrite it
cd /home/autumn/paperless-ngx/export
mv *.zip paperless_export.zip
# encrypt the zip file
zip -e paperless_export_encrypted.zip paperless_export.zip -P no_password_for_you!
# rsync to external hdd
rsync -av paperless_export.zip /mnt/external_hdd/paperless
# sync to google drive
rclone sync /mnt/ssd/paperless-ngx/media/documents/archive drive:paperless -v
# sync to cloudflare r2
rclone sync paperless_export_encrypted.zip r2:paperless-backup -v
rm -rfv /home/autumn/paperless-ngx/export/*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And ta-da! We now have our documents stored in Google Drive. And better yet thanks to &lt;a href="https://docs.paperless-ngx.com/advanced_usage/?ref=skerritt.blog#storage-paths"&gt;Paperless' file storage paths&lt;/a&gt; our documents are neatly formatted by year, month and day.&lt;/p&gt;

&lt;p&gt;And to put the cherry on top 🎂 Google Drive can search our PDFs using the text layer Paperless has added with the OCR functionality 🥳&lt;/p&gt;

&lt;p&gt;Now if I am ever in the Siberian Wilderness with James Bond and need instant access to my documents &lt;strong&gt;and&lt;/strong&gt; my server is dead, so long as I have my phone or a PC I can access them 👻&lt;/p&gt;

&lt;h1&gt;
  
  
  🥳 Easier Consumption
&lt;/h1&gt;

&lt;p&gt;Earlier I mentioned I airdropped my files to my mac and then uploaded them into the UI.&lt;/p&gt;

&lt;p&gt;Sometimes when I have a lot of documents to upload (or they are large in size) like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mkwfBZWT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-24-at-11.50.02.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mkwfBZWT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-24-at-11.50.02.png" alt="Over-engineering my document storage system with Paperless-ngx" width="790" height="1164"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The UI will freeze up and I'll have to refresh. And when you refresh, well... The files are no longer uploading.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Q9uNiWmK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-24-at-11.50.47.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Q9uNiWmK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-24-at-11.50.47.png" alt="Over-engineering my document storage system with Paperless-ngx" width="796" height="344"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;consume&lt;/code&gt; folder will automatically retry for me until I give up, which is perfect. I tried to do this by setting up a &lt;a href="https://www.redhat.com/sysadmin/samba-file-sharing?ref=skerritt.blog"&gt;Samba network share&lt;/a&gt;, but my Mac would require me to reauthenticate every so often. Same with my phone :(&lt;/p&gt;

&lt;p&gt;Someone on Reddit mentioned using Syncthing instead:&lt;/p&gt;

&lt;p&gt;&amp;lt;!--kg-card-begin: html--&amp;gt;&amp;lt;!--kg-card-end: html--&amp;gt;&lt;/p&gt;

&lt;p&gt;So here's my adventure into using Syncthing!&lt;/p&gt;

&lt;p&gt;Firstly install Syncthing with &lt;code&gt;sudo apt install syncthing&lt;/code&gt; or however you want to do it.&lt;/p&gt;

&lt;p&gt;Next, on the server side, Syncthing starts with &lt;code&gt;127.0.0.1:8384&lt;/code&gt;. I want to access the GUI from my server, so you need to edit the config file. Run &lt;code&gt;syncthing&lt;/code&gt; to generate it, and then do a little &lt;code&gt;vim ~/.config/syncthing/config.xml&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Search for the word "GUI". You'll find a bit of code like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    &amp;lt;gui enabled="true" tls="false" debugging="false"&amp;gt;
        &amp;lt;address&amp;gt;127.0.0.1:8384&amp;lt;/address&amp;gt;
        &amp;lt;apikey&amp;gt;API_KEY_HERE&amp;lt;/apikey&amp;gt;
        &amp;lt;theme&amp;gt;default&amp;lt;/theme&amp;gt;
    &amp;lt;/gui&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change the address to &lt;code&gt;0.0.0.0&lt;/code&gt; like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    &amp;lt;gui enabled="true" tls="false" debugging="false"&amp;gt;
        &amp;lt;address&amp;gt;0.0.0.0:8384&amp;lt;/address&amp;gt;
        &amp;lt;apikey&amp;gt;API_KEY_HERE&amp;lt;/apikey&amp;gt;
        &amp;lt;theme&amp;gt;default&amp;lt;/theme&amp;gt;
    &amp;lt;/gui&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And rerun Syncthing. Now you can access it on &lt;code&gt;server_ip:8384&lt;/code&gt;!&lt;/p&gt;

&lt;p&gt;☣️&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WARNING&lt;/strong&gt; : if your device is accessible from the internet this means anyone will be able to access it! You can set it to a local IP like &lt;code&gt;192.168.0.1&lt;/code&gt; or a VPN internal IP or you can set up a username / password.&lt;/p&gt;

&lt;p&gt;Syncthing will not run in the background unless you tell it to. Let's make a quick service &lt;code&gt;sudo vim /etc/systemd/system/syncthing_runner.service&lt;/code&gt; and then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Unit]
Description=Runs Syncthing
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=on-failure
RestartSec=1
User=autumn
ExecStart=/usr/bin/env syncthing

[Install]
WantedBy=multi-user.target
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And then a quick &lt;code&gt;systemctl start syncthing_runner.service &amp;amp;&amp;amp; systemctl enable syncthing_runner.service&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Tada! Syncthing runs now.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---3_wMhwc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-24-at-11.05.25.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---3_wMhwc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-24-at-11.05.25.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="639"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we want to run this in the backgroud on our local machine. For macs do a quick &lt;code&gt;brew install syncthing&lt;/code&gt; and then &lt;code&gt;brew tap homebrew/services&lt;/code&gt; (this installs a background runner for homebrew) and then &lt;code&gt;brew services start syncthing&lt;/code&gt;. Now on your device go to &lt;a href="http://127.0.0.1:8384/?ref=skerritt.blog"&gt;http://127.0.0.1:8384/&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding your devices
&lt;/h2&gt;

&lt;p&gt;On your server click "add remote device".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--l804Jdct--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-24-at-11.09.08.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--l804Jdct--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-24-at-11.09.08.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="156"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It'll tell you to follow some instructions, copy and paste the ID for your local machine and you'll have added your first device!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sE57dZ65--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-24-at-11.09.44.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sE57dZ65--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-24-at-11.09.44.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="204"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding the consume folder
&lt;/h2&gt;

&lt;p&gt;Grab your consume folder's directory from the Docker compose file, and add a new folder to Syncthing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--H5SqhkTm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-24-at-11.10.57.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--H5SqhkTm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-24-at-11.10.57.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="469"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Make sure you share it with your device!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Xwk9vdts--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-24-at-11.11.27.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Xwk9vdts--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-24-at-11.11.27.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="160"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go back to your local device and Syncthing will now tell you about a new folder.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wqL1HHR_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-24-at-11.12.35.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wqL1HHR_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-24-at-11.12.35.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="541"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Accecpt the folder (make sure the path is where you want it to be). Now you have a local folder synced with the &lt;code&gt;consume&lt;/code&gt; folder on your server which Paperless will use.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--scQUALhM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-24-at-11.13.22.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--scQUALhM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-24-at-11.13.22.png" alt="Over-engineering my document storage system with Paperless-ngx" width="604" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And a couple of minutes later this happens...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KQPVVvmM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-24-at-11.19.47.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KQPVVvmM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-24-at-11.19.47.png" alt="Over-engineering my document storage system with Paperless-ngx" width="780" height="536"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now to upload documents my flow looks like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scan documents&lt;/li&gt;
&lt;li&gt;Send them to my mac&lt;/li&gt;
&lt;li&gt;Drag &amp;amp; drop into my consume folder on my laptop.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔜 soon I will find a scanner which can automatically add things to the folder and my life will be complete 🙇🏼‍♀️&lt;/p&gt;

&lt;p&gt;🐬&lt;/p&gt;

&lt;p&gt;Syncthing also has the added benefit of being your own personal Dropbox, this is so cool!&lt;/p&gt;

&lt;p&gt;I even managed to sync my Paperless archive with my local devices so I can access documents on the go if needed :)&lt;/p&gt;

&lt;h1&gt;
  
  
  Shredding
&lt;/h1&gt;

&lt;p&gt;I recently brought a nice shredder from Fellows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qXVDwkC---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/04/Screenshot-2023-04-29-at-11.30.48.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qXVDwkC---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/04/Screenshot-2023-04-29-at-11.30.48.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="510"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It works quite well, the bin is very useful, it hasn't clogged so far and it's managed to shred card.&lt;/p&gt;

&lt;p&gt;Previously I was using a £5 Lidl shredder which jammed all the time, did not have a bin and could &lt;em&gt;barely&lt;/em&gt; process 1 page at a time. This can handle around 6!&lt;/p&gt;

&lt;h1&gt;
  
  
  What's next?
&lt;/h1&gt;

&lt;p&gt;Like any great programmer I have implemented an MVP and added a bunch of features to the backlog. Up next on my list is...&lt;/p&gt;

&lt;h2&gt;
  
  
  Safely storing documents
&lt;/h2&gt;

&lt;p&gt;Right now my precious physical documents are stored in a cardboard box next to my Zippo lighter fluid.&lt;/p&gt;

&lt;p&gt;It's probably a good idea to buy a safe, I am thinking about this &lt;a href="https://www.amazon.co.uk/Master-Lock-LCHW20101-LCHW20101-Electronics/dp/B0158OFGPQ?ref=skerritt.blog"&gt;A4 safe&lt;/a&gt;.A real scanner&lt;/p&gt;

&lt;p&gt;Earlier I mentioned using my phone to scan things, it'd be way nicer if I had a real printer / scanner combination. &lt;a href="https://www.amazon.co.uk/gp/product/B078GQPRNN?ref=skerritt.blog"&gt;Brother&lt;/a&gt; is meant to be nice and without the bad IoT parts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wallace and Gromit Style Scanning
&lt;/h2&gt;

&lt;p&gt;Ok hear me out.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YToHbqAB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/image-8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YToHbqAB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/image-8.png" alt="Over-engineering my document storage system with Paperless-ngx" width="786" height="998"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're a venture capitalist reading this and looking to fund me, here's how I'll make profit from this revoluntry idea:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--i_uGyeKt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-26-at-12.52.14.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--i_uGyeKt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://skerritt.blog/content/images/2023/02/Screenshot-2023-02-26-at-12.52.14.png" alt="Over-engineering my document storage system with Paperless-ngx" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have printer / scanner recommendations please email me &lt;a href="mailto:autumn@skerritt.blog"&gt;autumn@skerritt.blog&lt;/a&gt; or tweet me &lt;a href="https://twitter.com/bee_sec_san?ref=skerritt.blog"&gt;https://twitter.com/bee_sec_san&lt;/a&gt; !&lt;/p&gt;

</description>
      <category>popular</category>
    </item>
    <item>
      <title>3 Tips For Making a Popular Open Source Project in 2021 [Ultimate Guide]</title>
      <dc:creator>Autumn</dc:creator>
      <pubDate>Mon, 28 Dec 2020 12:43:37 +0000</pubDate>
      <link>https://dev.to/brandonskerritt/3-tips-for-making-a-popular-open-source-project-in-2021-ultimate-guide-218c</link>
      <guid>https://dev.to/brandonskerritt/3-tips-for-making-a-popular-open-source-project-in-2021-ultimate-guide-218c</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;I have around ~10k GitHub stars.  I’ve come up with a bullet-pointed actionable list of how to make open-source projects popular.&lt;/p&gt;

&lt;p&gt;One of the projects I created had 67 lines of code and had only existed for 3 days before it hit 1.7k stars. &lt;/p&gt;

&lt;p&gt;Humans are predictable creatures when it comes to our attention. I’ll show you data-backed actionable insights that can help you create popular software.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why Bother? Popular Projects = More Contributors = Better Project
&lt;/h1&gt;

&lt;p&gt;What’s the point in getting more GitHub stars? They mean nothing. You can’t buy a coffee with exposure. If GitHub dies, so do the stars.&lt;/p&gt;

&lt;p&gt;The problem with open source is the &lt;a href="https://en.wikipedia.org/wiki/Network_effect" rel="noopener noreferrer"&gt;network effect.&lt;/a&gt; The more people that find your project, the more people that use it, the more that contribute to it and thus the better it becomes.&lt;/p&gt;

&lt;p&gt;The better the project, the more popular it becomes. It’s a self-fulfilling cycle.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fl35a5kmuep4c1gge1aoj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fl35a5kmuep4c1gge1aoj.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As this cycle continues, it becomes harder for it to continue. That’s a blog post for another day. But first, let’s talk about where we start. &lt;/p&gt;

&lt;p&gt;To start us on this cycle we need popularity. &lt;/p&gt;

&lt;p&gt;To get contributors to your project it has to be popular enough so people see it and contribute.&lt;/p&gt;

&lt;p&gt;Creating a popular open-source project isn’t just a want but a need. &lt;/p&gt;

&lt;p&gt;If a project has contributors but no popularity, it’s likely created by a company for internal use and was open-sourced.&lt;/p&gt;

&lt;p&gt;Otherwise, only popular open-source projects have contributors.&lt;/p&gt;

&lt;h1&gt;
  
  
  Well Designed README
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;README.md&lt;/code&gt; is the first thing anyone sees. Make sure to catch their eyes right away. &lt;/p&gt;

&lt;p&gt;It’s harder to gain traction based purely on the merit of the tool rather than on the presentation of the tool.&lt;/p&gt;

&lt;p&gt;For frontend applications, you should focus more on the design of the frontend rather than the &lt;code&gt;README&lt;/code&gt;. This is for CLI applications.&lt;/p&gt;

&lt;p&gt;A well-designed README answers these questions succinctly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What does this do?&lt;/li&gt;
&lt;li&gt;Does it solve my problem?&lt;/li&gt;
&lt;li&gt;Does it solve my problem better than the competitors (if they exist) do?&lt;/li&gt;
&lt;li&gt;How do I install it?&lt;/li&gt;
&lt;li&gt;What are the basic commands I need to know?&lt;/li&gt;
&lt;li&gt;Where can I go for more help?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is how a &lt;code&gt;README&lt;/code&gt; answers these questions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgzjzos83815k2v8m89d5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgzjzos83815k2v8m89d5.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We’ll go through each of these.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create a Header Summarising Your Project
&lt;/h2&gt;

&lt;p&gt;The first thing they see is your &lt;code&gt;README&lt;/code&gt;. The first thing they see on the &lt;code&gt;README&lt;/code&gt; is the header. Make it good.&lt;/p&gt;

&lt;p&gt;The header is the combination of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Logo.&lt;/li&gt;
&lt;li&gt;Slogan (short description).&lt;/li&gt;
&lt;li&gt;Badges.&lt;/li&gt;
&lt;li&gt;Quick Install.&lt;/li&gt;
&lt;li&gt;Quick Links (not always needed).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Beautiful Logo as simple as Canva.com
&lt;/h3&gt;

&lt;p&gt;The logo is the first thing users see and is the image used for social media sharing. &lt;br&gt;
When I first create a project, I’ll use something from &lt;a href="https://canva.com" rel="noopener noreferrer"&gt;Canva&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Canva allows you to &lt;strong&gt;quickly&lt;/strong&gt; create a logo from a template for free. &lt;/p&gt;

&lt;p&gt;Go to Canva and search for “Logo”&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdpaiq41abiphwveky54k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdpaiq41abiphwveky54k.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And then just select one of the many logos you come across. Edit it if you want. &lt;/p&gt;

&lt;p&gt;Typically, there are 2 things I look for in a logo:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Coolness factor 😎&lt;/li&gt;
&lt;li&gt;Slogan&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I should look at the logo and think &lt;em&gt;”wow, that’s cool”&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvbxszntm9h8q3j5ytes3.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvbxszntm9h8q3j5ytes3.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It’s a gif! Isn’t that cool? I made it on Canva in about ~45 seconds. ~30 seconds were spent searching for it!&lt;/p&gt;

&lt;p&gt;Secondly, the slogan. The first thing people see will be the logo which contains the name and slogan, instantly they will know what the project is about.&lt;/p&gt;

&lt;p&gt;For some of my larger projects, I hire a designer, specifically &lt;a href="https://twitter.com/Vargnaar" rel="noopener noreferrer"&gt;Varg&lt;/a&gt;. Designers are great! Especially ones that can understand the project at hand, which aids creating a well-conceived logo.&lt;/p&gt;

&lt;p&gt;In short: don’t spend too long picking a logo. If you’re not hiring a designer, perhaps ~5 minutes playing around on Canva. &lt;/p&gt;
&lt;h3&gt;
  
  
  Slogan (description) of your project in 1 simple line
&lt;/h3&gt;

&lt;p&gt;When thinking about the design of your project, think about &lt;em&gt;how&lt;/em&gt; people found it. There are 2 major ways people can find your project:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Someone recommends it to them.&lt;/li&gt;
&lt;li&gt;It’s posted on Twitter / HackerNews / LinkedIn / other social media or news aggregators.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When someone recommends something it’s because that something solves their problem. This means that they already have an idea of &lt;em&gt;how&lt;/em&gt; this project solves their problem, of what the project does.&lt;/p&gt;

&lt;p&gt;When posted, Twitter will make a social card for it. This card is the title, description, and an image.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fy1jh5pghzrcsizddw2oi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fy1jh5pghzrcsizddw2oi.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Both of the main methods of sharing your project include a description already. This means 2 things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;We don’t need to spend time describing &lt;em&gt;what&lt;/em&gt; our project is in the &lt;code&gt;README&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;GitHub’s Description will be used everywhere and is the first thing people see.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3l6dn0xlhlfuhmqlxpe4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3l6dn0xlhlfuhmqlxpe4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One sentence or two will be adequate to explain our project in the &lt;code&gt;README&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This is why I include the &lt;em&gt;quick install&lt;/em&gt; section in the &lt;code&gt;README&lt;/code&gt;. Users who come to your project already have an idea of what it is. Since they do, provide a way for them to quickly install it and try it out for themselves.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Talk is cheap. Show me the code.” - Linus Torvalds&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Good descriptions are hard to write. Very hard.&lt;/p&gt;

&lt;p&gt;It needs to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Describe the project.&lt;/li&gt;
&lt;li&gt;Be eye-catching.&lt;/li&gt;
&lt;li&gt;Show why the user needs it.&lt;/li&gt;
&lt;li&gt;Show why it’s better than the rest.&lt;/li&gt;
&lt;li&gt;Be easy enough for someone that only knows the subject matter in passing to understand.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is copywriting. It’s an important skill to learn as copywriting is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Writing in such a way to convince someone to do something.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;My favourite resource is &lt;a href="https://backlinko.com/copywriting-guide" rel="noopener noreferrer"&gt;Brian Dean’s Copywriting Guide&lt;/a&gt;.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/gohugoio" rel="noopener noreferrer"&gt;
        gohugoio
      &lt;/a&gt; / &lt;a href="https://github.com/gohugoio/hugo" rel="noopener noreferrer"&gt;
        hugo
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      The world’s fastest framework for building websites.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;&lt;a href="https://gohugo.io/" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fgohugoio%2FgohugoioTheme%2Fmaster%2Fstatic%2Fimages%2Fhugo-logo-wide.svg%3Fsanitize%3Dtrue" alt="Hugo" width="565"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;A fast and flexible static site generator built with love by &lt;a href="https://github.com/bep" rel="noopener noreferrer"&gt;bep&lt;/a&gt;, &lt;a href="https://github.com/spf13" rel="noopener noreferrer"&gt;spf13&lt;/a&gt;, and &lt;a href="https://github.com/gohugoio/hugo/graphs/contributors" rel="noopener noreferrer"&gt;friends&lt;/a&gt; in &lt;a href="https://go.dev/" rel="nofollow noopener noreferrer"&gt;Go&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://godoc.org/github.com/gohugoio/hugo" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/c62f57b770dd47a68e9022c676f50f3f314226b36f587561e69e76fb45af0abd/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f676f6875676f696f2f6875676f3f7374617475732e737667" alt="GoDoc"&gt;&lt;/a&gt;
&lt;a href="https://github.com/gohugoio/hugo/actions?query=workflow%3ATest" rel="noopener noreferrer"&gt;&lt;img src="https://github.com/gohugoio/hugo/workflows/Test/badge.svg" alt="Tests on Linux, MacOS and Windows"&gt;&lt;/a&gt;
&lt;a href="https://goreportcard.com/report/github.com/gohugoio/hugo" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/59d9b28ab9a05db50c03ec9fb349df2a95efb49e489acddd102431e943e8e809/68747470733a2f2f676f7265706f7274636172642e636f6d2f62616467652f6769746875622e636f6d2f676f6875676f696f2f6875676f" alt="Go Report Card"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://gohugo.io" rel="nofollow noopener noreferrer"&gt;Website&lt;/a&gt; | &lt;a href="https://gohugo.io/installation" rel="nofollow noopener noreferrer"&gt;Installation&lt;/a&gt; | &lt;a href="https://gohugo.io/documentation" rel="nofollow noopener noreferrer"&gt;Documentation&lt;/a&gt; | &lt;a href="https://discourse.gohugo.io" rel="nofollow noopener noreferrer"&gt;Support&lt;/a&gt; | &lt;a href="https://github.com/gohugoio/hugoCONTRIBUTING.md" rel="noopener noreferrer"&gt;Contributing&lt;/a&gt; | &lt;a href="https://fosstodon.org/@gohugoio" rel="nofollow noopener noreferrer"&gt;Mastodon&lt;/a&gt; | &lt;a href="https://x.com/gohugoiov2" rel="nofollow noopener noreferrer"&gt;X&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Overview&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Hugo is a &lt;a href="https://en.wikipedia.org/wiki/Static_site_generator" rel="nofollow noopener noreferrer"&gt;static site generator&lt;/a&gt; written in &lt;a href="https://go.dev/" rel="nofollow noopener noreferrer"&gt;Go&lt;/a&gt;, optimized for speed and designed for flexibility. With its advanced templating system and fast asset pipelines, Hugo renders a complete site in seconds, often less.&lt;/p&gt;
&lt;p&gt;Due to its flexible framework, multilingual support, and powerful taxonomy system, Hugo is widely used to create:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Corporate, government, nonprofit, education, news, event, and project sites&lt;/li&gt;
&lt;li&gt;Documentation sites&lt;/li&gt;
&lt;li&gt;Image portfolios&lt;/li&gt;
&lt;li&gt;Landing pages&lt;/li&gt;
&lt;li&gt;Business, professional, and personal blogs&lt;/li&gt;
&lt;li&gt;Resumes and CVs&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Use Hugo's embedded web server during development to instantly see changes to content, structure, behavior, and presentation. Then deploy the site to your host, or push changes to your Git provider for automated builds and deployment.&lt;/p&gt;
&lt;p&gt;Hugo's fast asset pipelines include:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;…&lt;/li&gt;&lt;/ul&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/gohugoio/hugo" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;The world’s fastest framework for building websites.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This explains what the project is well. It is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Succinct.&lt;/li&gt;
&lt;li&gt;Answers the question “Why are you better than the rest?” with &lt;em&gt;”world’s fastest”&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Answers what it does, &lt;em&gt;”framework for building websites.”&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Easy enough to understand for non-experts, &lt;em&gt;”building websites”&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Uses eye-catching words such as &lt;em&gt;”worlds largest”&lt;/em&gt; and the succinctness imply “we can read this, it’ll only take a second of our time to process this.”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You should spend a few weeks experimenting with the description on-and-off.&lt;/p&gt;

&lt;p&gt;Come up with many descriptions, about ~20. And continually improve upon it. When you lie down in bed, think &lt;em&gt;”If I had never seen my project before, what would I want to see to make me use it?”&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The description is the hardest, but most important part of the whole design. &lt;strong&gt;It’s the first thing people see.&lt;/strong&gt; Invest time into this. Learn copywriting. Even when you think it’s perfect, it can always be improved.&lt;/p&gt;

&lt;p&gt;Ask your users what they think of it. Iterate until you can no longer iterate.&lt;/p&gt;

&lt;h3&gt;
  
  
  Badges
&lt;/h3&gt;

&lt;p&gt;Badges are links/images that sum up the project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fsiz3v7ec320muhz3qf4i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fsiz3v7ec320muhz3qf4i.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;They explain where to find documentation, is the current branch stable? How clean is the code?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fm8u2zsdu9zx937dav3wj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fm8u2zsdu9zx937dav3wj.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How active is the project? How many downloads? The license? Any chatrooms?&lt;br&gt;
Mostly, badges are just cool stickers you can include. I like reading them, some people may not.&lt;br&gt;
You can find a list of badges on &lt;a href="http://shields.io/" rel="noopener noreferrer"&gt;shields.io&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  Quick Installation guide
&lt;/h3&gt;

&lt;p&gt;The user understands what the application does from seeing it in the social cards or being told by a friend.&lt;/p&gt;

&lt;p&gt;Sometimes, they want to install it as fast as possible to play around. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Talk is cheap, show me the code.” - Linus Torvalds&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The quick install guide allows users to install the software immediately. &lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;p&gt;&lt;a href="https://pypi.org/project/ciphey" rel="noopener noreferrer"&gt;🐍 Python&lt;/a&gt;&lt;/p&gt;&lt;/th&gt;
&lt;th&gt;&lt;p&gt;&lt;a href="https://pypi.org/project/ciphey" rel="noopener noreferrer"&gt;🐋 Docker (Universal)&lt;/a&gt;&lt;/p&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FCiphey%2FCiphey%2Fraw%2Fmaster%2FPictures_for_README%2Fpython.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FCiphey%2FCiphey%2Fraw%2Fmaster%2FPictures_for_README%2Fpython.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FCiphey%2FCiphey%2Fraw%2Fmaster%2FPictures_for_README%2Fdocker.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FCiphey%2FCiphey%2Fraw%2Fmaster%2FPictures_for_README%2Fdocker.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;python3 -m pip install ciphey --upgrade&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;docker run -it --rm remnux/ciphey&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Users do not need to scour the &lt;code&gt;README&lt;/code&gt; for information on installation if they are already knowledgeable and want to use the project. &lt;/p&gt;

&lt;p&gt;The style above is clean. The package manager’s name, the logo of the operating system and a short installation to copy/paste. &lt;/p&gt;
&lt;h3&gt;
  
  
  Quick Links
&lt;/h3&gt;

&lt;p&gt;This isn’t required in all READMEs. &lt;/p&gt;

&lt;p&gt;Linking to all the resources the user needs in one neat place allows the user to quickly understand &lt;em&gt;anything&lt;/em&gt; they want.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmm5pd2i2zex1msacwnmy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmm5pd2i2zex1msacwnmy.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The order of these matters. As the user reads left-to-right (assuming English &lt;code&gt;README&lt;/code&gt;), the further away items are the less likely they will see it. You want them to see your Twitter first? Include that at the first item.&lt;/p&gt;

&lt;p&gt;While this is a flat list separated by pipes, it is an ordered list in the sense that users will only read so far.&lt;/p&gt;

&lt;p&gt;I include my quick links at the top of the page, above the fold (the logo).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwgd4f5dku2j6e0yczo6z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwgd4f5dku2j6e0yczo6z.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The user will already have a rough idea of what the project is. They may only want 3 things from the README:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Documentation.&lt;/li&gt;
&lt;li&gt;Support (the Discord link).&lt;/li&gt;
&lt;li&gt;The Installation Guide.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By being at the top, we reduce the friction of finding them.&lt;/p&gt;
&lt;h3&gt;
  
  
  Example Images to show off your project
&lt;/h3&gt;

&lt;p&gt;The header is also a great place to show &lt;em&gt;how&lt;/em&gt; your project works. You can use gifs (discussed later in more depth) or images.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fk39w9f9zxddflg9t1mg2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fk39w9f9zxddflg9t1mg2.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9rhzrm2r4zgr4v7y6zga.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9rhzrm2r4zgr4v7y6zga.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This depends on your project, but having images in your header may make sense.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Inspiration for designing your header&lt;/strong&gt;&lt;br&gt;
Let’s look at some inspiration &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwvft6mn7ni488v64e3be.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwvft6mn7ni488v64e3be.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fxhqt9plold0l8jx71z7y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fxhqt9plold0l8jx71z7y.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fztbxc0s1ecr5u11efkql.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fztbxc0s1ecr5u11efkql.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fo60m4ql20h23vvnixvyt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fo60m4ql20h23vvnixvyt.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcyvn32zfefz07j1po8e0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcyvn32zfefz07j1po8e0.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fsqn3apaoofwlu6qdnav2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fsqn3apaoofwlu6qdnav2.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  What Is This? Describing Your Project Succinctly.
&lt;/h2&gt;

&lt;p&gt;This section explains the features of your product.&lt;/p&gt;

&lt;p&gt;Short explanations. A gif that demonstrates your project. Essential features you think someone would want to see. &lt;/p&gt;

&lt;p&gt;Look at the Starship prompt.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fsqn3apaoofwlu6qdnav2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fsqn3apaoofwlu6qdnav2.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;They have a table with 2 columns but without borders. In the left column is the list of essential features. Each feature is bolded with a short explanation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bold feature&lt;/strong&gt;: I am explaining the feature&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And in the right column is a gif showing how the program works, preferably detailing the features mentioned.&lt;/p&gt;

&lt;p&gt;To create a gif of a CLI app, use &lt;a href="https://github.com/faressoft/terminalizer" rel="noopener noreferrer"&gt;Terminalizer&lt;/a&gt;. Clean up your terminal before you record, as it can look messy. &lt;/p&gt;

&lt;p&gt;When thinking of what features to show, &lt;strong&gt;do not show them all.&lt;/strong&gt; Only show the features that the user wants to see. And in words that a user can understand.&lt;/p&gt;
&lt;h2&gt;
  
  
  X vs Y, Comparisons With Competitors
&lt;/h2&gt;

&lt;p&gt;If your project is competing with a lot of other projects, you’re going to need to show the user exactly why they should use your project over the competitors.&lt;/p&gt;

&lt;p&gt;Convincing someone to leave their current tool for yours is hard. Make it as easy as possible for them to see the advantages over their current tooling.&lt;/p&gt;

&lt;p&gt;In &lt;a href="https://www.goodreads.com/book/show/10127019-the-lean-startup?from_search=true&amp;amp;from_srp=true&amp;amp;qid=zKpCYP3FEY&amp;amp;rank=1" rel="noopener noreferrer"&gt;The Lean Startup&lt;/a&gt; the author talks about why at the beginning of a startup we should focus on the early adopters over the average customers.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The point is not to find the average customer but to find &lt;strong&gt;early adopters&lt;/strong&gt;: the customers who feel the need for the product most acutely. Those customers tend to be more forgiving of mistakes and are especially eager to give feedback." &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The early adopters are those that wouldn’t mind switching out their current tooling for a less tested, less mainstream option if it means it has better functionality.&lt;/p&gt;

&lt;p&gt;The only way to get the average customer to use your product is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No competitors must exist.&lt;/li&gt;
&lt;li&gt;Their current solution to the problem is extremely convoluted compared to yours.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Otherwise, your best bet is to appeal to the early adopters and overtime slowly appeal to the average customer as your project becomes more mainstream.&lt;/p&gt;

&lt;p&gt;The easiest way to compare your projects to others is to include a table of popular features. Use statistics here. It’s harder to believe words than it is numbers, even if the words are just as truthful as the numbers.&lt;/p&gt;

&lt;p&gt;For Ciphey we compared our program to our largest possible competitor, CyberChef’s Magic function.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fnpg0jpfmi3sb2trbxjjn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fnpg0jpfmi3sb2trbxjjn.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see we used gifs to demonstrate this. We explain how long each one takes and the setup of both, which can all be seen in the gifs. &lt;/p&gt;

&lt;p&gt;We also leave footnotes on some things. Such as gifs loading at different times, the function (at the time) failing to decode. &lt;/p&gt;

&lt;p&gt;Later on, we compare again with a table this time of features.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fc83rf2mfbhm2ewuk0ann.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fc83rf2mfbhm2ewuk0ann.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Create Great Documentation
&lt;/h2&gt;

&lt;p&gt;Do not put all your documentation into your &lt;code&gt;README&lt;/code&gt;  because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It’s harder to update.&lt;/li&gt;
&lt;li&gt;It’s harder for users to find things.&lt;/li&gt;
&lt;li&gt;It makes the &lt;code&gt;README&lt;/code&gt; unbearably long and ugly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We don’t write all of our code in one file, why have all of our documentation in our README?&lt;/p&gt;

&lt;p&gt;Don’t make the documentation section long. Since we have already explained how to install quickly, we should show:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How to run the program.&lt;/li&gt;
&lt;li&gt;How to find the documentation.&lt;/li&gt;
&lt;li&gt;How to find support.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2owinwhnqc3ndlw473o0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2owinwhnqc3ndlw473o0.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I included a gif here showing all the different ways there are to run Ciphey. Gifs are magical and easy to make.&lt;/p&gt;
&lt;h2&gt;
  
  
  Contributing, Thanking &amp;amp; Welcoming Contributors
&lt;/h2&gt;

&lt;p&gt;The final section is about contributing.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How to contribute.&lt;/li&gt;
&lt;li&gt;Thanking past contributors.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We need contributors to our project to fulfil the cycle. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4c3zdmptf6zxfaobc7ph.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4c3zdmptf6zxfaobc7ph.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Therefore, our README needs to display how to contribute. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgkmu6ggn4b1c8wb03ek0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgkmu6ggn4b1c8wb03ek0.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A short paragraph describing how to contribute, where to ask for help if they are stuck, the &lt;code&gt;contributing.md&lt;/code&gt; file and any potential rewards for contributing (name added to the &lt;code&gt;README&lt;/code&gt; and the chance to work on a growing project).&lt;/p&gt;

&lt;p&gt;And then you want to thank your contributors. We use &lt;a href="https://github.com/all-contributors/all-contributors" rel="noopener noreferrer"&gt;all-contributors&lt;/a&gt; which makes it easy to thank them. It shows their profile picture, a link to their websites along with emoji defining &lt;em&gt;what&lt;/em&gt; they did. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgrn0q229nifrs50bbpd4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgrn0q229nifrs50bbpd4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Design is subjective and you may like something, you may not. It’s down to you to decide on what looks good. &lt;/p&gt;

&lt;p&gt;I hope the design principles I shared, along with the &lt;code&gt;README&lt;/code&gt;s included here will inspire you to create something beautiful.&lt;/p&gt;

&lt;p&gt;One thing I didn’t talk about here is creating documentation. It is your job as a programmer to create documentation. Your project is not done until it has documentation. You can use &lt;a href="https://docs.github.com/en/free-pro-team@latest/github/building-a-strong-community/about-wikis" rel="noopener noreferrer"&gt;GitHub Wiki&lt;/a&gt; and &lt;a href="https://www.python.org/dev/peps/pep-0257/" rel="noopener noreferrer"&gt;DocStrings&lt;/a&gt; to automatically generate &lt;em&gt;some&lt;/em&gt; documentation (you’ll still need to write documentation for installation, usage, etc).&lt;/p&gt;

&lt;p&gt;Remember — the &lt;code&gt;README&lt;/code&gt; is one of the most important parts of an open-source project (along with the documentation).&lt;/p&gt;
&lt;h1&gt;
  
  
  Creating Something People Want
&lt;/h1&gt;

&lt;p&gt;A good &lt;code&gt;README&lt;/code&gt; will get people interested, a working project that solves their problems will get people talking.&lt;/p&gt;

&lt;p&gt;This chapter is based on &lt;a href="https://en.wikipedia.org/wiki/Zero_to_One" rel="noopener noreferrer"&gt;Zero to One by Peter Thiel&lt;/a&gt;, but will feature inspiration from other places.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Every moment in business happens only once. The next Bill Gates will not build an operating system. The next Larry Page or Sergey Brin won’t make a search engine. And the next Mark Zuckerberg won’t create a social network. If you are copying these guys, you aren’t learning from them.”&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  Problem First, Product Second
&lt;/h2&gt;

&lt;p&gt;For your project to grow, it has to solve a problem. It’s better to find a solution to a problem that people have rather than creating a project for the sake of it.&lt;/p&gt;

&lt;p&gt;Let’s compare 2 ideas.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A recipe app&lt;/li&gt;
&lt;li&gt;A digital platform for artists to share their work, get feedback and start selling to gallery owners.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The first one doesn’t solve any problems. There are millions of recipe apps in the world and unless there is something &lt;strong&gt;truly&lt;/strong&gt; unique it won’t take off.&lt;/p&gt;

&lt;p&gt;The second one is a unique &amp;amp; novel idea that aims to solve the problem of:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“I’m an artist wanting to get paid for my work and improve.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We have a problem, artists not getting paid, and we solve the problem. &lt;/p&gt;

&lt;p&gt;Some people come up with the project first, but doing this means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We aren’t solving one specific problem from the start.&lt;/li&gt;
&lt;li&gt;We don’t have a well-defined target market.&lt;/li&gt;
&lt;li&gt;It’s likely already been done before.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As Walter Isaacson said in &lt;a href="https://www.goodreads.com/book/show/21856367-the-innovators" rel="noopener noreferrer"&gt;The Innovators:&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“But the main lesson to draw from the birth of computers is that innovation is usually a group effort, involving collaboration between visionaries and engineers and that creativity comes from drawing on many sources. Only in storybooks do inventions come like a thunderbolt, or a lightbulb popping out of the head of a lone individual in a basement or garret or garage.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It’s unlikely for our project to be innovative if we don’t solve a small problem first. In the same book, Isaacson says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Progress comes not only in great leaps but also from hundreds of small steps.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Solving the problem will bring us closer to a unique &amp;amp; novel project. &lt;/p&gt;
&lt;h2&gt;
  
  
  Living With the Problem
&lt;/h2&gt;

&lt;p&gt;You cannot solve a problem you do not have. In &lt;a href="https://www.goodreads.com/book/show/10127019-the-lean-startup" rel="noopener noreferrer"&gt;The Lean Startup&lt;/a&gt;, Eric Ries states:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“In my Toyota interviews, when I asked what distinguishes the Toyota Way from other management approaches, the most common first response was genchi gembutsu—whether I was in manufacturing, product development, sales, distribution, or public affairs. &lt;strong&gt;You cannot be sure you really understand any part of any business problem unless you go and see for yourself firsthand&lt;/strong&gt;. It is unacceptable to take anything for granted or to rely on the reports of others.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Unless you have the problem, you cannot effectively solve the problem. &lt;/p&gt;

&lt;p&gt;It also helps with idea generation. Pay attention to the minor inconveniences in your life, in the lives of people around you and build products that solve those problems.&lt;/p&gt;

&lt;p&gt;It’s a lot easier to observe the problems present in your own life than it is to generate random ideas that might work.&lt;/p&gt;

&lt;p&gt;If you have the problem, you know 2 things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The problem exists.&lt;/li&gt;
&lt;li&gt;Other people have the problem.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The first point is important. &lt;strong&gt;Many people create solutions for problems that do not exist.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/LqTdoN4y36U"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;This product essentially injects the potato with oil and other foods. This problem does not exist. No one has ever had this problem. If you watch the video, you can see that the Potato Doctor cuts the potato open. What is the point? There isn’t one.&lt;/p&gt;

&lt;p&gt;The second point is less obvious, but a good indicator. Humans are not unique. We mostly share the same problems.  If the problem directly affects my life, I know that it must affect other people too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding Problems in Communities
&lt;/h2&gt;

&lt;p&gt;You don’t have to be the one to find the problem, others can too. If you pay attention to a community, these people will reveal the problems they are facing.&lt;/p&gt;

&lt;p&gt;Listening to a community exponentially grows your rate of ideas vs being on your own.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Flr8fdheb9bvoyqlffh68.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Flr8fdheb9bvoyqlffh68.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The more people there are, the more you listen, the more ideas you can generate over time compared to thinking on your own.&lt;/p&gt;

&lt;p&gt;Build a minimal viable product that solves the problem the community is facing.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A &lt;strong&gt;minimum viable product&lt;/strong&gt;, or &lt;strong&gt;MVP&lt;/strong&gt;, is a &lt;strong&gt;product&lt;/strong&gt; with enough features to attract early-adopter customers and validate a &lt;strong&gt;product&lt;/strong&gt; idea early in the &lt;strong&gt;product&lt;/strong&gt; development cycle.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fd6fxoxqlcz56q50j70ct.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fd6fxoxqlcz56q50j70ct.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Share with the community. Measure its effectiveness, learn how to do better and re-build it (or add more) to improve upon it.&lt;/p&gt;

&lt;p&gt;Over time, it will eventually leak out of the community into other similar communities.&lt;/p&gt;

&lt;p&gt;You have around 2 weeks before you lose motivation to work on something. Create the smallest possible minimum viable product that the community can use. Their thanks, if provided, will give you the motivation to continue working on it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Solving the Problem Well
&lt;/h2&gt;

&lt;p&gt;Here’s the thing.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You have a problem you can solve.&lt;/li&gt;
&lt;li&gt;You have a community that’ll help you solve this problem and provides feedback.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But that doesn’t mean your problem is solved &lt;em&gt;well&lt;/em&gt;. Take a look at &lt;a href="https://en.wikipedia.org/wiki/Juicero" rel="noopener noreferrer"&gt;Juicero&lt;/a&gt;. Juicero solved a problem that many people have.&lt;/p&gt;

&lt;p&gt;We want to create our juice drinks, but to do that we have to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Buy Fruit &amp;amp; Vegetables.&lt;/li&gt;
&lt;li&gt;Wash them.&lt;/li&gt;
&lt;li&gt;Cut them.&lt;/li&gt;
&lt;li&gt;Juice them.&lt;/li&gt;
&lt;li&gt;Clean up.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Juicero’s solution was to (ignoring hardware):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Insert packet into Juicero to get the juice.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a good idea, but it was poorly executed. &lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/mlfAHrpm3C8"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;There are many talks about why Juicero failed — all out of the scope of this article.&lt;/p&gt;

&lt;p&gt;The point is that you could have a great idea, but if it’s poorly executed it may have too many downsides to be used as the solution.&lt;/p&gt;

&lt;p&gt;The way to solve this is via the minimum viable product loop. Instead of spending 3 years creating a project, we release as soon as possible, gather feedback, improve and loop.&lt;/p&gt;

&lt;p&gt;We are continuously heading towards what people want, and each iteration will solve the problem better than the last. If it doesn’t, the next iteration we solve the problem differently and so on.&lt;/p&gt;

&lt;h1&gt;
  
  
  Getting the Word Out
&lt;/h1&gt;

&lt;p&gt;If we never show off our project, why would we expect anyone to see it? It’s not good enough to build it and hope they come. We have to get the word out.&lt;/p&gt;

&lt;p&gt;The good news is that if you’ve been following along in Creating Something People Want we already have the word out. The community we are in know about the project and use it.&lt;/p&gt;

&lt;p&gt;That helps us immensely. Going from 10 GitHub stars to 100 is easy. Going from 0 to 1 is hard.&lt;/p&gt;

&lt;p&gt;Once we get a few stars we will get more stars. Stars beget stars ⭐.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sharing With a Community
&lt;/h2&gt;

&lt;p&gt;If we have been following the Build, Measure, Learn loop and regularly publishing minimal viable products than we will already have the word out in our community.&lt;/p&gt;

&lt;p&gt;When it comes time to publish, make sure your community knows that it’s the first &lt;strong&gt;real&lt;/strong&gt; release. They’d be more likely to share with their friends this way.&lt;/p&gt;

&lt;h2&gt;
  
  
  News Aggregators
&lt;/h2&gt;

&lt;p&gt;Your next port of call is news aggregators. These are places that collate news. You should post to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Subreddit of your choosing.&lt;/li&gt;
&lt;li&gt;HackerNews.&lt;/li&gt;
&lt;li&gt;Lobste.rs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not read the comments. Those places are incredibly toxic and can’t see a good product even if it &lt;a href="https://news.ycombinator.com/item?id=8863" rel="noopener noreferrer"&gt;hit them in the face&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Awesome Lists
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1o2qdk0rse688l3b65zc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1o2qdk0rse688l3b65zc.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;An &lt;a href="https://github.com/sindresorhus/awesome" rel="noopener noreferrer"&gt;Awesome list&lt;/a&gt; is a list of awesome things about some topic. There are lists such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rust&lt;/li&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;li&gt;Hacking&lt;/li&gt;
&lt;li&gt;Web&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And more.&lt;/p&gt;

&lt;p&gt;Find some lists that apply to you and submit PRs. In the worst case, they don’t accept it.&lt;/p&gt;

&lt;h2&gt;
  
  
  GitHub Trending
&lt;/h2&gt;

&lt;p&gt;If all goes well, you should hit GitHub trending at some point. This will provide monumental traffic.&lt;/p&gt;

&lt;p&gt;Once you hit trending, pay attention to social media and thank anyone that shares your project. If they follow you they may re-tweet your project again in the future.&lt;/p&gt;

&lt;p&gt;This is the snowball effect. You need about ~50 stars to hit trending page for your language, ~100 stars to hit the overall trending. Once you do this, trending will give you more stars and it will continually snowball.&lt;/p&gt;

&lt;h2&gt;
  
  
  Leverage an Existing Following or Past Popularity
&lt;/h2&gt;

&lt;p&gt;The easiest way to gain stars is by leveraging your existing following. Post on social media, other GitHub repos and the likes.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion - Throw the Rule Book Away
&lt;/h1&gt;

&lt;p&gt;Like all things, this is not an exact science, more like art. And you can’t become good at art by following other peoples guidance. You’ve got to discover your unique style. &lt;/p&gt;

&lt;p&gt;The Mona Lisa was painted once, but the thousands of people that painted the Mona Lisa afterwards were never recognised. &lt;/p&gt;

&lt;p&gt;I suggest you throw some of the rules away, experiment yourself. Create new rules and understand what works for you.&lt;/p&gt;

&lt;p&gt;What works for me, won’t necessarily work for you. So go ahead, throw the rule book away!&lt;/p&gt;

&lt;p&gt;Let’s go over some things we learnt.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Well designed READMEs are essential.&lt;/li&gt;
&lt;li&gt;Creating something people want.&lt;/li&gt;
&lt;li&gt;Get the word out there.&lt;/li&gt;
&lt;li&gt;Discover your unique style and what works for you.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Follow me on Twitter for more!&lt;br&gt;
&lt;iframe class="tweet-embed" id="tweet-1342574587750580226-740" src="https://platform.twitter.com/embed/Tweet.html?id=1342574587750580226"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1342574587750580226-740');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1342574587750580226&amp;amp;theme=dark"
  }



&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>beginners</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>People spending Christmas alone, what are you doing?</title>
      <dc:creator>Autumn</dc:creator>
      <pubDate>Sun, 20 Dec 2020 19:25:00 +0000</pubDate>
      <link>https://dev.to/brandonskerritt/people-spending-christmas-alone-what-are-you-doing-4830</link>
      <guid>https://dev.to/brandonskerritt/people-spending-christmas-alone-what-are-you-doing-4830</guid>
      <description>&lt;p&gt;Hey! Like some people, I'm spending Christmas alone and I was looking for some ideas on what to do :) &lt;/p&gt;

</description>
      <category>watercooler</category>
    </item>
    <item>
      <title>Can Artificial Intelligence ever replace penetration testers?</title>
      <dc:creator>Autumn</dc:creator>
      <pubDate>Tue, 01 Dec 2020 01:50:34 +0000</pubDate>
      <link>https://dev.to/brandonskerritt/can-artificial-intelligence-ever-replace-penetration-testers-1go3</link>
      <guid>https://dev.to/brandonskerritt/can-artificial-intelligence-ever-replace-penetration-testers-1go3</guid>
      <description>&lt;p&gt;In this blog post we’ll explore &lt;em&gt;if&lt;/em&gt; machines can fully replace pe&lt;/p&gt;

&lt;p&gt;Something to note is that predicting the future is hard and this is all entirely my opinion. Many people will have differing ideologies.&lt;/p&gt;




&lt;h2&gt;
  
  
  Machine Learning
&lt;/h2&gt;

&lt;p&gt;Typically when we think of artificial intelligence, we may think of machine learning. Specifically, supervised machine learning.&lt;/p&gt;

&lt;h3&gt;
  
  
  Supervised Learning
&lt;/h3&gt;

&lt;p&gt;In supervised learning, we have follow the formula:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Labelled input -&amp;gt; machine learns -&amp;gt; machine outputs&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The labelled input is the largest part here. We have to provide the machine learning algorithm with a table like:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Label&lt;/th&gt;
&lt;th&gt;4 Legs&lt;/th&gt;
&lt;th&gt;Barks&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;True&lt;/td&gt;
&lt;td&gt;True&lt;/td&gt;
&lt;td&gt;True&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;False&lt;/td&gt;
&lt;td&gt;True&lt;/td&gt;
&lt;td&gt;False&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This table answers the question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Is that a dog?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We give it features. That’s the &lt;em&gt;4 legs&lt;/em&gt; and &lt;em&gt;Barks&lt;/em&gt; features.&lt;/p&gt;

&lt;p&gt;And we label it True / False if it is a dog or not. Humans have to label it true / false, machines cannot. This is wwhy supervised learning is quite slow. But also, we face 2 problems with supervised learning:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We need &lt;strong&gt;a lot&lt;/strong&gt; of data (millions of data points with billions of features) for high accuracy&lt;/li&gt;
&lt;li&gt;We need the labels to be accurate &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As you can tell, in the real world these 2 points are hard to find combined. So hard in fact, IBM once said:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Anyone can build an AI with 99.9% accuracy. The issue is building the dataset.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Our labels are often binary, True and False. They can be other things such as categories or classifications.&lt;/p&gt;

&lt;p&gt;But something important to note is that supervised learning is &lt;strong&gt;only for classification&lt;/strong&gt;. That means it won’t be able to “hack” things like we imagined.&lt;/p&gt;

&lt;p&gt;However our supervised learning algorithm will learn what exploits &lt;em&gt;might&lt;/em&gt; work given a port scan, but it won’t be able to hack it for us.&lt;/p&gt;

&lt;p&gt;This idea of Human + Machine synthesis is something we’ll explore later.&lt;/p&gt;

&lt;h3&gt;
  
  
  Unsupervised Learning
&lt;/h3&gt;

&lt;p&gt;We’ve seen supervised, but what about unsupervised?&lt;/p&gt;

&lt;p&gt;Given data, our algorithm attempts to find patterns.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;4 Legs&lt;/th&gt;
&lt;th&gt;Barks&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;True&lt;/td&gt;
&lt;td&gt;True&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;True&lt;/td&gt;
&lt;td&gt;False&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Our algorithm may say:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Things that bark are dogs, but not all things with 4 legs are dogs&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This requires a monumental amount of data, but it can find patterns much better than humans can provided the data is correct.&lt;/p&gt;

&lt;p&gt;A good use case is disease symptoms. Given a bunch of patients, what symptoms do they all share in common?&lt;/p&gt;

&lt;p&gt;This methodology is unsuited for a machine that can replace a penetration tester.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It can’t hack&lt;/li&gt;
&lt;li&gt;All it’d say is something like “hackers typically use Metasploiit”.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Although in a blue team environment, if you are repeatedly hacked and you’re unsure as to why it may be helpful. But it’d be quicker to read the logs!&lt;/p&gt;

&lt;h3&gt;
  
  
  Reinforcement Learning
&lt;/h3&gt;

&lt;p&gt;This brings us onto the last type of artificial intelligence. The one I just so happened to study for 3 years and write a dissertation on! Reinforcement learning.&lt;/p&gt;

&lt;p&gt;According to &lt;a href="http://incompleteideas.net/book/the-book.html" rel="noopener noreferrer"&gt;Sutton &amp;amp; Barto&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Of all the forms of machine learning, reinforcement learning is the closest to the kind of learning that humans and other animals do, and many of the core algorithms of reinforcement learning were originally inspired by biological learning systems.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Reinforcement learning is doing things by reinforcement. Humans learn not to touch the hot stove because it’s hot.&lt;/p&gt;

&lt;p&gt;&lt;a href="/static/bb3e8eb6a6df26b53433009e39fd0a28/7bc0b/loop.png"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpolymath.cloud%2Fstatic%2Fbb3e8eb6a6df26b53433009e39fd0a28%2F7bc0b%2Floop.png" title="Agent performs an action on the environment which returns a state (of the agent in the environment) and a reward." alt="Agent performs an action on the environment which returns a state (of the agent in the environment) and a reward."&gt;&lt;/a&gt;Agent performs an action on the environment which returns a state (of the agent in the environment) and a reward.&lt;/p&gt;

&lt;p&gt;We perform an action (take our the rubbish) on our environment (the rubbish bin). This returns a reward (our mum gives us sweets and a “thank you”) and a state (we are now cold, outside by our bins).&lt;/p&gt;

&lt;p&gt;Reinforcement Agents learn the same way. This is called the action-reward loop.&lt;/p&gt;

&lt;p&gt;Rewards can also be negative, which can discourage behaviour.&lt;/p&gt;

&lt;p&gt;In fact, it is common to include both positive &amp;amp; negative rewards in the same system.&lt;/p&gt;

&lt;p&gt;My hypothesis is that reinforcement agents &lt;em&gt;can&lt;/em&gt; learn to replace penetration testers. Let’s explore this in more depth.&lt;/p&gt;

&lt;h4&gt;
  
  
  AlphaGo
&lt;/h4&gt;

&lt;p&gt;Let’s explore how Google’s Deep Mind teaches their agents to learn how to play games.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/WXuK6gekU1Y"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;This video is very good, but I’ll explain roughly how it learns as well.&lt;/p&gt;

&lt;p&gt;Firstly, Go is a game where the space of possible moves is vastly larger than in chess. Meaning that using any sort of exhaustive search (calculating all possible moves) is out of the question.&lt;/p&gt;

&lt;p&gt;Our algorithm has to &lt;em&gt;learn&lt;/em&gt;.&lt;/p&gt;

&lt;h5&gt;
  
  
  Learning from the greats
&lt;/h5&gt;

&lt;p&gt;Our algorithm &lt;strong&gt;watches&lt;/strong&gt; how the best players play and &lt;em&gt;learns&lt;/em&gt; from them. The idea of &lt;a href="https://www.slashgear.com/nvidia-powered-robot-ai-learns-by-watching-humans-20531321/" rel="noopener noreferrer"&gt;AI learning by watching&lt;/a&gt; isn’t new. But the fact that the greatest Go players have played so many games allows the AI to learn all the tricks and tips of the masters.&lt;/p&gt;

&lt;p&gt;This is a good idea to match the masters, but not a good idea to surpass them.&lt;/p&gt;

&lt;p&gt;Humans make mistakes all the time. Our AI has to be perfect, so matching humans is not enough.&lt;/p&gt;

&lt;p&gt;How do we get AlphaGo to be better than the masters?&lt;/p&gt;

&lt;h5&gt;
  
  
  Teaching itself
&lt;/h5&gt;

&lt;p&gt;&lt;a href="/static/4ad8f8062d111154c06da7feba2f5fbc/8b69f/fanhuang.png"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpolymath.cloud%2Fstatic%2F4ad8f8062d111154c06da7feba2f5fbc%2F8b69f%2Ffanhuang.png" title="fanhuang" alt="fanhuang"&gt;&lt;/a&gt;&lt;a href="https://www.nature.com/articles/nature16961" rel="noopener noreferrer"&gt;https://www.nature.com/articles/nature16961&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How did AlphaGo become better than Fan Hui?&lt;/p&gt;

&lt;p&gt;AlphaGo plays against itself hundreds of millions of times. The loser gets deleted, the winner gets chosen as the start of the next AI.&lt;/p&gt;

&lt;p&gt;The AI has a base child that we choose at each iteration. This child is slightly modified (evolves) and this evolution is what makes it better over time.&lt;/p&gt;

&lt;p&gt;In this way, the AI:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Starts off at Master level (after learning from the masters).&lt;/li&gt;
&lt;li&gt;Evolves and teaches itself to get better.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, humans suck. Humans can never play perfectly. We make mistakes. We cause problems. We invovle emotions.&lt;/p&gt;

&lt;p&gt;So, Google Deep mind created a new version of AlphaGo. &lt;em&gt;AlphaGo Zero&lt;/em&gt; as it has &lt;em&gt;zero&lt;/em&gt; knowledge of how other people play.&lt;/p&gt;

&lt;p&gt;AlphaGo zeros starts off with a rule set and all possible moves it can make, and it teaches itself how to play.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpolymath.cloud%2F325c09139703bdcdd62fbeaffd588447%2Falphazero.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpolymath.cloud%2F325c09139703bdcdd62fbeaffd588447%2Falphazero.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After 3 days, it reaches the master level. After 5 days it can beat Lee Sedol. After 40 days it is so good that it can defeat the “world beater” version (the one that beat Lee Sedol) in 100 / 100 matches.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Fun fact&lt;/em&gt;: While the one that beat Lee Sedol was a server, AlphaGo Zero (which can beat the Lee Sedol one in 100/100 games) uses &lt;strong&gt;only 1 machine&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="/static/9338f38160c8d9b6f6161121f534d4b1/293e0/1machine.webp"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpolymath.cloud%2Fstatic%2F9338f38160c8d9b6f6161121f534d4b1%2Fe46b2%2F1machine.webp" title="1machine" alt="1machine"&gt;&lt;/a&gt;&lt;a href="https://deepmind.com/blog/article/alphago-zero-starting-scratch" rel="noopener noreferrer"&gt;https://deepmind.com/blog/article/alphago-zero-starting-scratch&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Creativity
&lt;/h4&gt;

&lt;p&gt;One of the key aspects to being a great penetration tester is being creative.&lt;/p&gt;

&lt;p&gt;Can machines be creative? It’s an oft asked question. I say yes. Neural networks are based on how the brain works. If the brain can be creative, I don’t see why machines cant.&lt;/p&gt;

&lt;p&gt;Furthermore we have seen creativity in the wild. AlphaGo’s famous &lt;a href="https://www.wired.com/2016/03/two-moves-alphago-lee-sedol-redefined-future/" rel="noopener noreferrer"&gt;Move 37&lt;/a&gt; is a genius &amp;amp; creative move that turned the course of the entire game and even flummoxed Lee Sedol.&lt;/p&gt;




&lt;h2&gt;
  
  
  Applications in InfoSec
&lt;/h2&gt;

&lt;p&gt;Now let’s apply what we learnt from AlphaGo to our own theoretical neural network to become a penetration tester.&lt;/p&gt;

&lt;p&gt;We’ll base our neural network roughly on how AlphaGo works.&lt;/p&gt;

&lt;p&gt;There are 2 ways we can do this. For both of these methods, we will have to give the machine knowledge of the keyboard. As in, each key would have to be mapped to a certain input and our AI will have to learn what keystrokes make what words which makes what results.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/qv6UVOQ0F44"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;In the above video we can see all the controls to Mario being mapped in the neural network. We’d hade to o the same for the AI but with the entire keyboard.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Learning from others
&lt;/h3&gt;

&lt;p&gt;This is likely the first method that will appear. The AI watches others and learns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Commands to use.&lt;/li&gt;
&lt;li&gt;Techniques / tips.&lt;/li&gt;
&lt;li&gt;“Rules” of the engagement.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And gains some human intuition.&lt;/p&gt;

&lt;p&gt;This works great, because as you may imagine the first few million generations of our AI will do almost nothing. It will be entirely based around learning what the keys do, and what words result in what things.&lt;/p&gt;

&lt;p&gt;We also have a problem, what is the reward for our AI? We could say the reward is a reverse shell on the target machine. But all of our experts would have to get reverse shells for our AI to learn.&lt;/p&gt;

&lt;p&gt;While this sounds impossible now, know that advancements of technology will make this possible in the future. All we need is more hacking videos (there are thousands on Youtube already) and better hardware to speed up the training process.&lt;/p&gt;

&lt;p&gt;This version of the AI is unlikely to replace good penetration testers, but it can sure replace all beginner penetration testers.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Learning from itself
&lt;/h3&gt;

&lt;p&gt;This is the AlphaGo Zero version. The AI starts with nothing but some basic rules. These rules might be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Don’t shut down a target computer.&lt;/li&gt;
&lt;li&gt;Don’t DoS a server.&lt;/li&gt;
&lt;li&gt;Don’t download &amp;amp; publish customer information.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And then, from nothing else, it teaches itself how to hack.&lt;/p&gt;

&lt;p&gt;This is much, much harder than watching other people and will require significantly more resources. But, the machine won’t make mistakes like humans will. And it’ll show creativity in knowing what to do.&lt;/p&gt;

&lt;h3&gt;
  
  
  Blue Team
&lt;/h3&gt;

&lt;p&gt;Here’s a fun idea for an AI that learns from itself.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI 1 defends their network.&lt;/li&gt;
&lt;li&gt;AI 2 attacks the network.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then each evolution we only pick the best defender and best attacker. By the time we’re finished, we’ll have automated blue team &amp;amp;&amp;amp; red team which are best in class.&lt;/p&gt;




&lt;h2&gt;
  
  
  Humans vs AI
&lt;/h2&gt;

&lt;p&gt;As you can probably guess, penetration testers aren’t really at threat any time soon. 60 or 70 years out at most.&lt;/p&gt;

&lt;p&gt;However, we are using AI in our security systems already and over time we’ll use better &amp;amp; better systems. I predict the timeline to look like:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create basic AI systems that rule out beginner penetration testers.&lt;/li&gt;
&lt;li&gt;Beginners have to learn new skills, such as using the AI systems or just being better.&lt;/li&gt;
&lt;li&gt;Because there’s less beginners, expert penetration testers get paid more and eventually consult in building the AI.&lt;/li&gt;
&lt;li&gt;Expert penetration testers are replaced by the AI system.&lt;/li&gt;
&lt;li&gt;The top 0.1% of penetration testers remain as consultants for the AI.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As we saw with AlphaGo, even with it beating Lee Sedol it still had a consultant that helped build it (in the documentary).&lt;/p&gt;

&lt;p&gt;However, I think this timeline might be more likely (carrying on from 3. in the last timeline)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Penetration Testers go from hacking directly to using automated systems with AI.&lt;/li&gt;
&lt;li&gt;Penetration testers work with the AI to be the best.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is what I like to call Human &amp;amp; Machine Synthesis. Machines are great, but unfortunately a machine might DoS a website, delete a production database or worse — try to explain to HR why handing out your password to anyone that asks is a bad idea.&lt;/p&gt;

&lt;p&gt;Humans &amp;amp; Machines together are stronger. Imagine if the machine gave the human a list of paths it thinks is vulnerable, for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sql injection -&amp;gt; database server -&amp;gt; domain admin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the human can check for this. It would also help the fact that any large organisation would prefer humans to deal with private confidential information rather than an automated blackbox machine.&lt;/p&gt;

&lt;p&gt;Garry Kasparov argues that machines can never be as creative as humans in his book &lt;a href="https://www.amazon.co.uk/Deep-Thinking-Machine-Intelligence-Creativity/dp/1473653509" rel="noopener noreferrer"&gt;Deep Thinking&lt;/a&gt; which contradicts my opinion, but is worth reading.&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;To sum up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI has the potential to replace humans.&lt;/li&gt;
&lt;li&gt;Not for a very, very long time/&lt;/li&gt;
&lt;li&gt;Even though it can, it likely won’t because humans prefer humans over machines.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to hear from people with differing opinions to I, check out these books:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.amazon.co.uk/Deep-Thinking-Machine-Intelligence-Creativity/dp/1473653509" rel="noopener noreferrer"&gt;Deep Thinking&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.amazon.co.uk/Superintelligence-Dangers-Strategies-Nick-Bostrom/dp/0198739834/ref=sr_1_1?dchild=1&amp;amp;keywords=superintelligence&amp;amp;qid=1606857920&amp;amp;s=books&amp;amp;sr=1-1" rel="noopener noreferrer"&gt;Superintelligence&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.amazon.co.uk/Life-3-0-Being-Artificial-Intelligence/dp/0141981806/ref=sr_1_1?dchild=1&amp;amp;keywords=life+3.0&amp;amp;qid=1606857924&amp;amp;s=books&amp;amp;sr=1-1" rel="noopener noreferrer"&gt;Life 3.0&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>You don't have to be a web developer to be a programmer</title>
      <dc:creator>Autumn</dc:creator>
      <pubDate>Mon, 23 Nov 2020 13:25:55 +0000</pubDate>
      <link>https://dev.to/brandonskerritt/you-don-t-have-to-be-a-web-developer-to-be-a-programmer-2j2a</link>
      <guid>https://dev.to/brandonskerritt/you-don-t-have-to-be-a-web-developer-to-be-a-programmer-2j2a</guid>
      <description>&lt;p&gt;When I first started out coding, I was sickened with impostor syndrome. All these great web developers with their fancy portfolios. But I'm not them. I can't design anything at all. I can't make things look beautiful or elegant.&lt;br&gt;
But, the world is rifled with "learn to program by becoming a web developer".&lt;/p&gt;

&lt;p&gt;I felt like I was destined to be a bad programmer as I couldn't do web development no matter how much I tried.&lt;/p&gt;

&lt;p&gt;As I grew up, I realised that I don't have to be a web developer. Backend developers are just as cool, and even cooler to me personally. &lt;/p&gt;

&lt;p&gt;I feel like this is because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Web developers have more to show off&lt;/li&gt;
&lt;li&gt;The vast majority of people becoming programmers go into web development (likely due to the fact that the web developers know how to build a well designed course / website)&lt;/li&gt;
&lt;li&gt;Websites like Dev.to are predominantly about web development (sort by top posts of all time, it's all web dev 😎)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Soo if you're a beginner programmer, I wanted to let you know that you don't have to be a web developer to be a good programmer. You don't even have to touch HTML if you like!&lt;/p&gt;

&lt;p&gt;There are thousands of programmers not involved in web development. You don't even have to be a backend developer (that develops server-side applications). There are thousands of jobs where you develop internal tooling, databases, security and more.&lt;/p&gt;

&lt;p&gt;Remember. Web development is not the only goal. You can become a great programmer without touching HTML or CSS. &lt;/p&gt;

&lt;p&gt;While I'm not the best example, my projects have around ~9k GitHub stars. Hopefully you can see that people love non-web projects just as much as they do web projects. And you can use GitHub as your portfolio instead of some fancy Vue / React / Whatever JS framework is popular portfolio.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/bee-san" rel="noopener noreferrer"&gt;
        bee-san
      &lt;/a&gt; / &lt;a href="https://github.com/bee-san/bee-san" rel="noopener noreferrer"&gt;
        bee-san
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div&gt;
  &lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt; Hello World &lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/d552948e7884c41fde2d32b9221d79f0df2076c7d824aaab954ca93f53d95884/68747470733a2f2f6d656469612e67697068792e636f6d2f6d656469612f6876524a434c467a6361737252346961377a2f67697068792e676966"&gt;&lt;img src="https://camo.githubusercontent.com/d552948e7884c41fde2d32b9221d79f0df2076c7d824aaab954ca93f53d95884/68747470733a2f2f6d656469612e67697068792e636f6d2f6d656469612f6876524a434c467a6361737252346961377a2f67697068792e676966" width="25px"&gt;&lt;/a&gt;
&lt;/h1&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;a href="https://www.linkedin.com/in/brandonls/" rel="nofollow noopener noreferrer"&gt;&lt;img height="30" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Ftrinwin%2Ftrinwin%2Fmaster%2Ficons%2Flinkedin.png%3Fraw%3Dtrue"&gt;&lt;/a&gt;  
&lt;a href="https://twitter.com/bee_sec_san" rel="nofollow noopener noreferrer"&gt;&lt;img height="30" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Ftrinwin%2Ftrinwin%2Fmaster%2Ficons%2Ftwitter.png%3Fraw%3Dtrue"&gt;&lt;/a&gt;  
&lt;/p&gt;

&lt;div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt; 🐝 Autumn | 💻 Site Reliability Security Engineer | 🌏 London, UK &lt;/h3&gt;
&lt;/div&gt; 


&lt;/div&gt;

&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;About me&lt;/h3&gt;

&lt;/div&gt;

&lt;p&gt;I do site reliabiltiy security engineering with a focus on identity &amp;amp; access management.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;👀  I talk about all things tech related &lt;a href="https://skerritt.blog/" rel="nofollow noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;⚡  Inventor of &lt;a href="https://github.com/rustscan/rustscan" rel="noopener noreferrer"&gt;RustScan&lt;/a&gt;, &lt;a href="https://github.com/ciphey/ciphey" rel="noopener noreferrer"&gt;Ciphey&lt;/a&gt;, &lt;a href="https://github.com/HashPals/Name-That-Hash" rel="noopener noreferrer"&gt;Name-That-Hash&lt;/a&gt;, &lt;a href="https://github.com/HashPals/Search-That-Hash" rel="noopener noreferrer"&gt;Search-That-Hash&lt;/a&gt;, and &lt;a href="https://github.com/bee-san/pyWhat" rel="noopener noreferrer"&gt;PyWhat&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;🎓  Graduate Computer Scientist with Honours from UoL.&lt;/li&gt;
&lt;li&gt;🎖  ex-Lead Subreddit at &lt;a href="https://tryhackme.com" rel="nofollow noopener noreferrer"&gt;TryHackMe&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;💭  Let's get to know each other.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Checkout my Blog Posts &lt;a href="https://skerritt.blog" rel="nofollow noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Author of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CVE-2024-32152 - LaTeX Blocklist Bypass vulnerability&lt;/li&gt;
&lt;li&gt;CVE-2024-29073 - Latex Incomplete Blocklist Vulnerability&lt;/li&gt;
&lt;li&gt;CVE-2024-32484 - Flask Invalid Path Reflected Cross-Site Scripting (XSS) vulnerability&lt;/li&gt;
&lt;li&gt;CVE-2024-26020 - MPV script injection vulnerability&lt;/li&gt;
&lt;/ul&gt;

&lt;div&gt;
$$\ce{$\unicode[goombafont; color:red; pointer-events: none; z-index: -10; position: fixed; top: 0; left: 0; height: 100vh; object-fit: cover; background-size: cover; width: 130vw; opacity: 0.5; background: url('https://raw.githubusercontent.com/cryptolake/cryptolake/master/mandel.jpg');]{x0000}$}
✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨

&amp;lt;/div&amp;gt;
&amp;lt;!--
**trinwin/trinwin** is a ✨ _special_ ✨ repository because its `README.md` (this file) appears…&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/bee-san/bee-san" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;One last time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You don't have to be a web developer to become a programmer 💖&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Feel free to follow me on Twitter:&lt;br&gt;
&lt;a href="https://twitter.com/bee_sec_san" rel="noopener noreferrer"&gt;https://twitter.com/bee_sec_san&lt;/a&gt;&lt;/p&gt;

</description>
      <category>watercooler</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Designing Effective Peer to Peer Networks</title>
      <dc:creator>Autumn</dc:creator>
      <pubDate>Fri, 31 Jan 2020 12:39:56 +0000</pubDate>
      <link>https://dev.to/brandonskerritt/designing-effective-peer-to-peer-networks-2814</link>
      <guid>https://dev.to/brandonskerritt/designing-effective-peer-to-peer-networks-2814</guid>
      <description>&lt;p&gt;This is an informed opinion piece on designing effective peer to peer (P2P) networks. I've written extensively about peer to peer networks, and have even designed my &lt;a href="https://github.com/brandonskerritt/Brandon_coin" rel="noopener noreferrer"&gt;own&lt;/a&gt; (albeit, bad) cryptocurrency.&lt;/p&gt;

&lt;p&gt;By the end of the article, we should have a good understanding of the important questions to answer when designing effective P2P networks.&lt;/p&gt;

&lt;p&gt;This article comes from my book on Designing Effective P2P networks. &lt;a href="https://page.skerritt.blog/peer/" rel="noopener noreferrer"&gt;Sign up to my email list to get it.&lt;/a&gt;&lt;br&gt;
&lt;a href="https://page.skerritt.blog/peer/" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fbrandonskerritt%2FPeer2PeerBook%2Fmaster%2FCopy%2520of%2520Copy%2520of%2520Copy%2520of%2520Copy%2520of%2520Copy%2520of%2520Copy%2520of%2520Copy%2520of%2520Copy%2520of%2520How%2520does%2520Tor%2520work_.png"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/bee-san" rel="noopener noreferrer"&gt;
        bee-san
      &lt;/a&gt; / &lt;a href="https://github.com/bee-san/Peer2PeerBook" rel="noopener noreferrer"&gt;
        Peer2PeerBook
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      The repo for my book on peer 2 peer networking! :)
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Peer2PeerBook&lt;/h1&gt;

&lt;/div&gt;
&lt;p&gt;The GitHub repo for my new peer 2 peer networking book, &lt;a href="https://page.skerritt.blog/peer/" rel="nofollow noopener noreferrer"&gt;exclusively on my blog.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;P.S: Ignore the image file name.... 😂&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/bee-san/Peer2PeerBook" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;Alternatively, &lt;strong&gt;&lt;a href="https://gumroad.com/l/p2palgos" rel="noopener noreferrer"&gt;you can buy the ebook for £49.99 from Gumroad.&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  When Should I Use a Peer to Peer Network?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fundraw_code_thinking_1jeh--1-.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fundraw_code_thinking_1jeh--1-.svg" alt="Designing Effective Peer to Peer Networks"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;P2P networks can be used for all networking. We need to use the right tool for the job.&lt;/p&gt;

&lt;p&gt;Quickly &amp;amp; automatic scaling is their game. P2P networks enhance with more users, not degrade.&lt;/p&gt;

&lt;p&gt;If we are building a platform with a shared goal (i.e. shares files) and we can imagine the platform growing uncontrollably big, P2P networks are good.&lt;/p&gt;

&lt;p&gt;Or if we do not want anyone to shut down our network (in a client-server model, turn off your servers) a P2P network is effective.&lt;/p&gt;

&lt;p&gt;There are 2 types of P2P Networks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Full P2P networks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are networks where everyone node is equal.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hybrid P2P networks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Certain nodes have more power than others.&lt;/p&gt;

&lt;p&gt;Let's walk through what all good peer to peer networks share.&lt;/p&gt;




&lt;h1&gt;
  
  
  Rewards
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fundraw_cookie_love_ulvn.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fundraw_cookie_love_ulvn.svg" alt="Designing Effective Peer to Peer Networks"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All great peer to peer networks have reward systems. The user does some work, and they are rewarded.&lt;/p&gt;

&lt;p&gt;Even if the reward isn't clearly defined, there is always a reward for taking part in the peer to peer network. And always a reward for giving back to the network.&lt;/p&gt;

&lt;p&gt;Rewards are paramount to P2P networks and my favourite thing to talk about!&lt;/p&gt;

&lt;p&gt;In Bitcoin, this is earning Bitcoin. BitTorrent rewards participants with faster download speeds. Tor rewards other Tor members with more privacy.&lt;/p&gt;

&lt;p&gt;All of these rewards are given for contributing to the network.&lt;/p&gt;

&lt;p&gt;The idea of a reward is to eliminate free-riders who partake in the network without giving anything back. There are 2 ways to discourage free-riders:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Forcing every user to give back.&lt;/li&gt;
&lt;li&gt;Rewarding users who give back.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tor is the former. The only reward that can be given is to become a guard node, which provides no obvious benefit for the user other than to feel good about themselves.&lt;/p&gt;

&lt;p&gt;The latter is what most peer to peer networks use, rewarding users who give back.&lt;/p&gt;

&lt;p&gt;In BitTorrent, those who seed (upload) are rewarded with higher download rates. The more you seed, the faster you can download.&lt;/p&gt;

&lt;p&gt;In Bitcoin, users are rewarded for mining the blockchain with Bitcoin.&lt;/p&gt;

&lt;p&gt;This leads us to look at peer to peer networks from 2 interesting perspectives. Human civilisations, or reinforcement learning machines.&lt;/p&gt;

&lt;p&gt;Let's start with human civilisations.&lt;/p&gt;




&lt;h2&gt;
  
  
  Human Civilisations
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fundraw_Savings_dwkw-1.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fundraw_Savings_dwkw-1.svg" alt="Designing Effective Peer to Peer Networks"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We do work, and we get rewarded. &lt;a href="https://archive.org/details/DmytriKleiner-P2pCommunismVsClient-serverCapitalism2012" rel="noopener noreferrer"&gt;Capitalism&lt;/a&gt;. In semi P2P networks (where one node has more power than the others) we can almost perfectly replicate capitalism.&lt;/p&gt;

&lt;p&gt;If we force everyone to do the same work for the same reward then it is &lt;a href="https://www.marxists.org/archive/marx/works/download/pdf/Manifesto.pdf" rel="noopener noreferrer"&gt;communism&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.theguardian.com/sustainable-business/2015/mar/18/fully-automated-luxury-communism-robots-employment" rel="noopener noreferrer"&gt;Luxury communism&lt;/a&gt; uses machines to do the heavy lifting leaving humans to do other things and is a new 21st-century take. This more closely relates to P2P networks than traditional communism.&lt;/p&gt;

&lt;p&gt;As P2P networks grow, eventually &lt;strong&gt;if not governed properly&lt;/strong&gt; it will fall back into an client-server architecture. Why use Jim's computer to download &lt;code&gt;ubuntu.iso&lt;/code&gt; when you can download it from LargeCorp which has a much faster speed.&lt;/p&gt;

&lt;p&gt;With planning, we can build a &lt;a href="https://www.britannica.com/topic/dictatorship-of-the-proletariat" rel="noopener noreferrer"&gt;dictatorship of the proletariat&lt;/a&gt; where every ordinary node has power in the network. Not just those with higher rewards.&lt;/p&gt;

&lt;p&gt;There will always be those with more power than others (perhaps they have more computers on the network) but the point is that everyone has &lt;em&gt;some&lt;/em&gt; power over the network.&lt;/p&gt;

&lt;p&gt;And the ordinary nodes will likely always have more power than larger clusters of nodes, &lt;a href="https://www.bloomberg.com/news/articles/2017-12-08/the-bitcoin-whales-1-000-people-who-own-40-percent-of-the-market" rel="noopener noreferrer"&gt;as seen in Bitcoin&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Modelling P2P networks as political movements allows us to talk about P2P networks as more than just networks, as entire communities.&lt;/p&gt;

&lt;p&gt;Eventually people with little to no knowledge about networking can discuss and change how the network operates using these abstractions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Reinforcement Learning
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fundraw_good_team_m7uu-1.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fundraw_good_team_m7uu-1.svg" alt="Designing Effective Peer to Peer Networks"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can use artificial intelligence to automatically optimise a P2P network. Humans are slow when it comes to making changes compared to computers.&lt;/p&gt;

&lt;p&gt;P2P networks already use technology to find the shortest routes or preferred routes. As networks become more and more complicated, simple handwritten algorithms might not be enough.&lt;/p&gt;

&lt;p&gt;Picture this nifty example.&lt;/p&gt;

&lt;p&gt;In our network, we have multiple nodes all interconnected. Each node has a rating.&lt;/p&gt;

&lt;p&gt;This rating signifies how good that node is. A good rating based on how much reward an individual has. Whether that reward is from speed, accuracy or trust is problem dependant.&lt;/p&gt;

&lt;p&gt;Every time this node is used, its personal reward is increased. Much like &lt;a href="https://en.wikipedia.org/wiki/Competitive_learning" rel="noopener noreferrer"&gt;Kohonen's competitive learning rules&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;But why stop there? If the node is faster, trustworthy, contributes heavily to the network it should have a higher reward rating.&lt;/p&gt;

&lt;p&gt;And our goal is to create the "best" path across the network, taking into account all of these numbers and to maximise our reward, whatever that may be.&lt;/p&gt;

&lt;p&gt;Tor already has a similar (albeit smaller) system in place like this. &lt;a href="https://skerritt.blog/how-does-tor-really-work/#how-is-a-circuit-created-" rel="noopener noreferrer"&gt;Guard nodes, bridge nodes, and more&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This seems like the perfect scenario for reinforcement learning. Multiple inputs to maximise our reward. Exploratory choices, meaning that a node with a "bad" reating is chosen, preventing some nodes from hogging all the resources.&lt;/p&gt;

&lt;p&gt;Reinforcement learning is the closet computer learning to how humans learn according to &lt;a href="https://web.stanford.edu/class/psych209/Readings/SuttonBartoIPRLBook2ndEd.pdf" rel="noopener noreferrer"&gt;Sutton &amp;amp; Barto&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Humans will eventually optimise manually. Where good nodes have better jobs or are chosen more than others. Reinforcement learning is much faster than any human could be.&lt;/p&gt;

&lt;p&gt;We, as humans, naturally &amp;amp; manually improve the network over time. What if we could use AI to speed this process up?&lt;/p&gt;




&lt;h1&gt;
  
  
  Optimisation of the Network
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fundraw_performance_overview_p9bm.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fundraw_performance_overview_p9bm.svg" alt="Designing Effective Peer to Peer Networks"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;An ideal P2P network will improve the more people that use it.&lt;/p&gt;

&lt;p&gt;In Tor, the more people that use it the more privacy is given. I talk more about this in my &lt;a href="https://skerritt.blog/how-does-tor-really-work/" rel="noopener noreferrer"&gt;Tor blog post.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A simple distinction, but one that must be made. &lt;strong&gt;As the network grows older, ideally, it reaches its global optimised state.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Unlike client-server, where the more users there are the harder it becomes to maintain the network &lt;strong&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fimage-4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fimage-4.png" alt="Designing Effective Peer to Peer Networks"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Take the example of downloading a file. Client-Server starts out being incredibly fast, but over time as the file becomes more popular that download speed degrades.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fimage-3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fimage-3.png" alt="Designing Effective Peer to Peer Networks"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With a P2P network, at the start it is slow to download (assuming the initial uploader is slow) but the speed increases over time. What's important is that over ttime, client-server gets worse with more users but P2P gets better.&lt;/p&gt;

&lt;p&gt;Optimisation of the network as it grows is often done through the rewards system.&lt;/p&gt;

&lt;p&gt;As Tor grows, the privacy of each user increases. Thus, the more that use Tor, the better the privacy.&lt;/p&gt;

&lt;p&gt;Each user has their personal reward, but together this creates a positive reward for the whole network.&lt;/p&gt;

&lt;p&gt;In Bitcoin, the more that mine Bitcoin, the harder it is to mine, and the larger incentive it is to use better computers. Better computers = faster mines = more money.&lt;/p&gt;

&lt;p&gt;This creates competition amongst users. &lt;strong&gt;Who can contribute to the network the most?&lt;/strong&gt; Users are fighting for their own personal reward, but this fight improves the network as a whole.&lt;/p&gt;

&lt;p&gt;It is almost impossible to perform a 51% attack on the network when miners are hyper-competitive like this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Users work towards their own personal rewards, which means the network gets better from not only more users but better rewards.&lt;/strong&gt; The entire network scales majestically upward.&lt;/p&gt;

&lt;p&gt;When choosing a reward, it is important to look at the local rewards (what the user gets) and to look at the greater rewards (what the network will get for participating).&lt;/p&gt;

&lt;p&gt;I also recommend rewards which increase as the network grows. Scalable rewards. If the price of Bitcoin did not scale with how many users it had, the network degrades or upgrades much slower over time.&lt;/p&gt;




&lt;h2&gt;
  
  
  Humble Beginnings
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fundraw_work_together_h63l.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fundraw_work_together_h63l.svg" alt="Designing Effective Peer to Peer Networks"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With a client-server architecture, it can be amazing from the start. But with a peer to peer network, it sucks for the first few users.&lt;/p&gt;

&lt;p&gt;With Bitcoin, what was the incentive? You get this worth coin.... nothing at all.&lt;/p&gt;

&lt;p&gt;Tor. The incentive? Well, if there are only 3 users then there is no incentive. No privacy. 51% attacks is a matter of whether someone loses WiFi on the train or not.&lt;/p&gt;

&lt;p&gt;BitTorrent. The incentive? You can download this one person's files.&lt;/p&gt;

&lt;p&gt;In peer to peer networks, generally, they suck for the first couple users and are only worthwhile over time.&lt;/p&gt;

&lt;p&gt;So how then, do we build an effective peer to peer network that other people will want to use?&lt;/p&gt;

&lt;p&gt;There are 2 methods to this.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Forceful use&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can force users to use the network. This is how Tor got its start. The &lt;a href="https://www.torproject.org/about/history/" rel="noopener noreferrer"&gt;US Naval Resarch Labs&lt;/a&gt; built Tor, and effectively they could force others in the Navy to use it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Incredible technology&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The other option is incredible technology. In a peer to peer network, the first few users are often those who recognise how incredible the technology is.&lt;/p&gt;

&lt;p&gt;Think about Bitcoin. The &lt;a href="https://www.amazon.co.uk/Bitcoin-Future-Money-Dominic-Frisby-ebook/dp/B00VSVBIXS/ref=sr_1_31?keywords=bitcoin&amp;amp;qid=1579361154&amp;amp;sr=8-31" rel="noopener noreferrer"&gt;first few users&lt;/a&gt; fell in love with the technology behind it, and truly believed it could one day be great.&lt;/p&gt;

&lt;p&gt;With a great rewards system in place, the first users of Bitcoin realised it could grow up to be something huge. &lt;strong&gt;Amazing technology attracts the first few users, and those users are often technologically minded.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Jobs for the People
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fundraw_interview_rmcf.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fundraw_interview_rmcf.svg" alt="Designing Effective Peer to Peer Networks"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In almost all peer to peer networks, jobs are assigned to nodes.&lt;/p&gt;

&lt;p&gt;In Bitcoin, we have miners whose job it is to mine the blockchain.&lt;/p&gt;

&lt;p&gt;In Tor, we have guard nodes.&lt;/p&gt;

&lt;p&gt;If a node has proven to be trustworthy than we shall make it a guard node. If a node wants to mine the blockchain, it becomes a miner.&lt;/p&gt;

&lt;p&gt;These nodes do not have more rights than the other nodes, they simply have a job to do. And sometimes this job provides a reward, and sometimes it doesn't.&lt;/p&gt;

&lt;p&gt;If we give everyone the same job, the network will tend towards global optimisation much slower.&lt;/p&gt;

&lt;p&gt;Let's say we have a new file-sharing system. Our system will let you download files from others.&lt;/p&gt;

&lt;p&gt;We have a file, &lt;code&gt;Ubuntu.iso&lt;/code&gt;, which is being seeded by 10 people.&lt;/p&gt;

&lt;p&gt;We choose at randomly a seed to download from. This seed has an upload speed of 1 Mbps while all the other seeders have an upload speed of 200mbps.&lt;/p&gt;

&lt;p&gt;It makes logical sense to use the uploaders with faster speed.&lt;/p&gt;

&lt;p&gt;It makes sense logically to choose from a subsection of people with high upload speeds. Effectively, we have given these people 'jobs'.&lt;/p&gt;

&lt;p&gt;There are 2 types of jobs in peer to peer networks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rewarded Jobs&lt;/li&gt;
&lt;li&gt;Unpaid Internships (jobs)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With rewarded jobs, the uploaders get a higher reward for working. This reward might be faster download speeds, such as in BitTorrent.&lt;/p&gt;

&lt;p&gt;With unpaid jobs, there is no reward. There is no incentive for one to choose a job, it is gifted to those. This is how guard nodes work in Tor.&lt;/p&gt;

&lt;p&gt;If we have a job which peopl have to opt-in to, but doesn't provide a reward it is unlikely for many people to opt-in.&lt;/p&gt;

&lt;p&gt;Deciding on what jobs to give, and whether it is rewarded or not is problem specific.&lt;/p&gt;

&lt;p&gt;For example, we have a job called "maintainer of the Blockchain". This job means people have a copy of the blockchain and maintains it. And only they do, no one else can. Any cryptocurrency nerd reading this may already see the problem.&lt;/p&gt;

&lt;p&gt;To view the blockchain, you need to have this job. But not every citizen of the world has a spare 300gb to view the chain. They cannot get the job, because they do not meet the required specification.&lt;/p&gt;

&lt;p&gt;You also have to meet a plethora of other specifications. Most of them a normal home user cannot achieve.&lt;/p&gt;

&lt;p&gt;This is another issue. Can we reject people if they do not meet the job specification? Again, problem specific.&lt;/p&gt;

&lt;p&gt;With only a small per cent controlling the blockchain, it leaves it open to a 51% attack. A small few will hold all the power. It will not work well in this instance.&lt;/p&gt;

&lt;p&gt;I propose that jobs are automatically assigned based on the specification of the user, but any user can request a job.&lt;/p&gt;

&lt;p&gt;The only jobs they should be rejected for is high trust jobs, such as guard nodes. But, the specification of their computer should not be taken into account for trust jobs.&lt;/p&gt;

&lt;p&gt;Humans picking jobs are too slow. The network needs to react fast and scale fast. Humans are not fast. So automatic assignment it is.&lt;/p&gt;

&lt;p&gt;But we do not want to prevent humans from accessing resources because of their circumstances.&lt;/p&gt;

&lt;p&gt;When assigning jobs, the jobs must work in harmony.&lt;/p&gt;

&lt;p&gt;We should take inspiration from beehives or &lt;a href="http://www.antday.com/?lang=en&amp;amp;pageid=workjobs" rel="noopener noreferrer"&gt;ant colonies&lt;/a&gt; for this. Human jobs are simply too hard to model, to focus on a much smaller example is wise.&lt;/p&gt;

&lt;p&gt;Should there be a punishment if someone takes a job for which they are unfit? Should a 30gb computer take the punishment for trying to maintain a 300gb file?&lt;/p&gt;

&lt;p&gt;On the one hand, only a very small per cent of the population will ignore the assigned job and choose something for which they are unfit.&lt;/p&gt;

&lt;p&gt;But, to achieve global optimisation we must make sure every single thing is accounted for.&lt;/p&gt;

&lt;p&gt;Unfortunately, in this world, those that do jobs that they are not capable of should be punished. &lt;strong&gt;I would not say to reduce the resources available to them&lt;/strong&gt; through the job, but perhaps &lt;strong&gt;reduce the reward of using the network in some way.&lt;/strong&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Data Structures
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fundraw_software_engineer_lvl5.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fundraw_software_engineer_lvl5.svg" alt="Designing Effective Peer to Peer Networks"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every single effective peer to peer network uses data structures.&lt;/p&gt;

&lt;p&gt;The blockchain is just a fancy linked list with some extra properties.&lt;/p&gt;

&lt;p&gt;BitTorrent's magnet links work based on distributed hash tables.&lt;/p&gt;

&lt;p&gt;Data structures are vital to peer to peer networks. I do not want to get into every data structure available, but knowledge of them is important.&lt;/p&gt;

&lt;p&gt;We can design a network using a &lt;a href="https://en.wikipedia.org/wiki/Category:Distributed_data_structures" rel="noopener noreferrer"&gt;distributed data structure&lt;/a&gt; that already exists, or we can build a new data structure/algorithm based on pre-existing ones.&lt;/p&gt;




&lt;h1&gt;
  
  
  Policy Changes
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fundraw_judge_katerina_limpitsouni_ny1q.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fundraw_judge_katerina_limpitsouni_ny1q.svg" alt="Designing Effective Peer to Peer Networks"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Throughout this article, I have talked about designing the network to be perfect from the get-go. Anyone knows this isn't possible. So how then, do we change the network when it's already running? How do we implement policy changes?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Dictatorship&lt;/li&gt;
&lt;li&gt;Let the people decide&lt;/li&gt;
&lt;li&gt;The people can form a democracy&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In our first instance, we have a dictatorship.&lt;/p&gt;

&lt;p&gt;You, the creator decides on changes. You create these changes, and they go out to the network. We don't care what the participants think, only that the change has taken place.&lt;/p&gt;

&lt;p&gt;This is the most effective for easily implementing policy changes, but it ruins the trust.&lt;/p&gt;

&lt;p&gt;Good peer to peer networks reduces trust. We should not need to trust anyone. However, trust is important in some networks. It depends on the network itself.&lt;/p&gt;

&lt;p&gt;If the network was for a digital currency, why would you trust this entire currency in the hands of a single person?&lt;/p&gt;

&lt;p&gt;But for a privacy centred network, having this trust in one person or body of people can increase the trust throughout the network. It reduces the chance of a 51% attack backdoor in the early days, building trust from day 0.&lt;/p&gt;

&lt;p&gt;As the network progresses, it strays further and further away from a 51% attack. Which means we lose trust, we do not need to trust that it is safe from a 51% attack if the network is large enough.&lt;/p&gt;

&lt;p&gt;In the early days of a P2P network, it is very much a dictatorship. A few small people decide on changes to the network (think of the early days of Bitcoin) and this eventually moves towards democracy as the network grows.&lt;/p&gt;

&lt;p&gt;But again, this brings problems. What if there is a critical failure in the code and there needs to be a change made during the networks primetime? This is for the designer to decide.&lt;/p&gt;

&lt;p&gt;We can alternatively let the people decide.&lt;/p&gt;

&lt;p&gt;From the get-go, no single person has full control. Every time a change is made, a % of the network (likely 51) will need to agree to the change. Complete control for the network. No trusting the developer involved.&lt;/p&gt;

&lt;p&gt;At the start, this may be problematic. What if we have a node in the network purely from FOMO and doesn't care about updates?&lt;/p&gt;

&lt;p&gt;Humans are incredibly slow too. Imagine a critical bug in the code that had to be fixed right there and then. Humans may take weeks to decide. Many will not even respond to the decision.&lt;/p&gt;

&lt;p&gt;The alternative is a democracy.&lt;/p&gt;

&lt;p&gt;Give certain people more power than others. Have the community vote in leaders, or have the leaders be pre-selected.&lt;/p&gt;

&lt;p&gt;These leaders then decide on changes to the codebase. This reduces trust, especially if they are voted in.&lt;/p&gt;

&lt;p&gt;But nothing is stopping them from teaming together to get the maximum personal reward while not doing anything for the many.&lt;/p&gt;

&lt;p&gt;All in all, deciding on policy changes is a tricky subject. And one that should be decided before the network is made.&lt;/p&gt;

&lt;p&gt;Although something to remember is trust. Will the users need to trust you, personally?&lt;/p&gt;

&lt;p&gt;If so, try and work towards a goal where that trust is reduced. Diversify that trust over to others. Remove trust completely, make them only trust themselves.&lt;/p&gt;

&lt;p&gt;Effective peer to peer networks is unlike client-server models where one person controls all the power. Effective P2P networks are for the people.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Cathedral or the Bazaar
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fundraw_deliveries_131a.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fundraw_deliveries_131a.svg" alt="Designing Effective Peer to Peer Networks"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://monoskop.org/images/e/e0/Raymond_Eric_S_The_Cathedral_and_the_Bazaar_rev_ed.pdf" rel="noopener noreferrer"&gt;The Cathedral&lt;/a&gt; is waterfall development. Slow, well planned. The people working on it are cathedral builders. The final product is presented and sold to the public as the final product.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://monoskop.org/images/e/e0/Raymond_Eric_S_The_Cathedral_and_the_Bazaar_rev_ed.pdf" rel="noopener noreferrer"&gt;The Bazaar&lt;/a&gt; is the opposite. Work fast. Break things. Release early. Release often. Listen to your customers.&lt;/p&gt;

&lt;p&gt;When building a &lt;strong&gt;full&lt;/strong&gt; P2P network, we would build both the cathedral and the bazaar.&lt;/p&gt;

&lt;p&gt;In an ideal &lt;strong&gt;full&lt;/strong&gt; P2P network, eventually, the creator's power dwindles to almost nothing (they become just another normal node in the network).&lt;/p&gt;

&lt;p&gt;This is what Satoshi Nakamoto did. They created the cathedral first, and then over time moved to the bazaar - eventually losing all power to change anything in the network without the permission of the network.&lt;/p&gt;

&lt;p&gt;Our P2P network could explode on day 1 and we would have no control to finish building the cathedral.&lt;/p&gt;

&lt;p&gt;For this reason, in a full P2P network where all nodes are equal, we should build a cathedral and then transition naturally to a bazaar.&lt;/p&gt;

&lt;p&gt;In semi P2P network where some nodes have more power than others, the developer doesn't have to give up their child anytime soon.&lt;/p&gt;

&lt;p&gt;However, this requires the nodes to trust the developers. Something that not all P2P networks have the liberty of.&lt;/p&gt;




&lt;h2&gt;
  
  
  Open Source or Not?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fundraw_open_source_1qxw.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fundraw_open_source_1qxw.svg" alt="Designing Effective Peer to Peer Networks"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The main thing in P2P networks is removing trust. We don't necessarily want people to trust us when building a network, preferably we would want to remove as much trust as possible.&lt;/p&gt;

&lt;p&gt;Closed source systems do not instil much trust, therefore we must choose an open-source system.&lt;/p&gt;




&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fundraw_result_5583.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2020%2F01%2Fundraw_result_5583.svg" alt="Designing Effective Peer to Peer Networks"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We now know the biggest questions to ask when desiging effective P2P networks.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What will the rewards be?&lt;/li&gt;
&lt;li&gt;What jobs are there?&lt;/li&gt;
&lt;li&gt;Can users choose their own jobs?&lt;/li&gt;
&lt;li&gt;Should there be a punishment? If so, what punishment?&lt;/li&gt;
&lt;li&gt;Are jobs paid or unpaid?&lt;/li&gt;
&lt;li&gt;Is it hybrid, or a full network?
&lt;a href="https://page.skerritt.blog/peer/" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fbrandonskerritt%2FPeer2PeerBook%2Fmaster%2FCopy%2520of%2520Copy%2520of%2520Copy%2520of%2520Copy%2520of%2520Copy%2520of%2520Copy%2520of%2520Copy%2520of%2520Copy%2520of%2520How%2520does%2520Tor%2520work_.png"&gt;&lt;/a&gt;
&amp;lt;!--kg-card-end: html--&amp;gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>computerscience</category>
      <category>networking</category>
      <category>tutorial</category>
      <category>security</category>
    </item>
    <item>
      <title>How To Get Any Job You Want - A Guide To Employability Skills Edition 2</title>
      <dc:creator>Autumn</dc:creator>
      <pubDate>Sat, 07 Dec 2019 15:55:28 +0000</pubDate>
      <link>https://dev.to/brandonskerritt/how-to-get-any-job-you-want-a-guide-to-employability-skills-edition-2-498k</link>
      <guid>https://dev.to/brandonskerritt/how-to-get-any-job-you-want-a-guide-to-employability-skills-edition-2-498k</guid>
      <description>&lt;p&gt;This is a 34,000 word book I wrote on job applications. It's now available for free, as a lil Christmas gift 🎁 Enjoy edition 2 of the book! 😁&lt;/p&gt;

&lt;p&gt;&lt;a href="https://page.skerritt.blog/job/"&gt;If you want the PDF, here you go!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, this was automatically converted using Pandoc. There may be some visual errors in this blog post. Please ignore them, they're not in the book itself (or the PDF if you signed up to my &lt;a href="https://page.skerritt.blog/job/"&gt;email list&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Found an error or want to contribute to this resource? The GitHub repo is &lt;a href="https://github.com/brandonskerritt/HowToGetAnyJobYouWant"&gt;here&lt;/a&gt;. If you make an edit, you'll get your name in the acknowledgements of the book (when I next update it). Or you can leave a comment. 😁&lt;/p&gt;

&lt;p&gt;This is &lt;strong&gt;edition 2&lt;/strong&gt;. 24 Git Issues, multiple Git commits and many more resources added, it's now better than ever thanks to your help!&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A9-wwsHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/bee-san"&gt;
        bee-san
      &lt;/a&gt; / &lt;a href="https://github.com/bee-san/Employabiltiy-book"&gt;
        Employabiltiy-book
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      The repo for my book, How to get any job you want
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
What is this?&lt;/h1&gt;
&lt;p&gt;This is the GitHub repo for my book on careers. The book was converted into HTML using &lt;a href="https://pandoc.org/" rel="nofollow"&gt;Pandoc&lt;/a&gt;. The HTML is rendered into a HTML Card on &lt;a href="https://ghost.org" rel="nofollow"&gt;Ghost&lt;/a&gt; on my blog, &lt;a href="https://skerritt.blog" rel="nofollow"&gt;Skerritt.blog&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It's a 34,000 word book on everything you could ever want to know about employability skills. You can read the entire book, online, for free on my blog:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://page.skerritt.blog/job/" rel="nofollow"&gt;Read it here&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
Where can I read this?&lt;/h2&gt;
&lt;p&gt;On my blog:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://page.skerritt.blog/job/" rel="nofollow"&gt;Read it here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you are privacy focussed, my blog doesn't track you. No Google Analytics,no ad-networks. My comments sytem even allows anonymous commenting.&lt;/p&gt;
&lt;p&gt;Another way to read the book is to download the HTML file and view it yourself.&lt;/p&gt;
&lt;h2&gt;
Can I get a PDF?&lt;/h2&gt;
&lt;p&gt;Sure. Just sign up to my &lt;a href="https://page.skerritt.blog/job/" rel="nofollow"&gt;email list&lt;/a&gt;. You'll get the PDF with fancy table of contents.&lt;/p&gt;
&lt;h2&gt;
There's a mistake in your book! Or I want to add&lt;/h2&gt;…&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/bee-san/Employabiltiy-book"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;&lt;a href="https://page.skerritt.blog/job/"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6_Q_z7df--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/brandonskerritt/brandonskerritt.github.io/master/images/bookimageUpload.png" width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;h1 id="preface"&gt;Preface&lt;/h1&gt;

&lt;p&gt;Professional skills, Just the mere murmur of the word makes me want to fall asleep. It’s such a boring topic, there’s no getting around that. So many people fall asleep in professional skills classes or never take the time to learn these vital skills.&lt;/p&gt;

&lt;p&gt;This makes a large difference between the people who took the boring class and the people who didn’t. So many people apply for graduate jobs every single year, I’m willing to bet around 95% of them have no experience with professional skills. Because of this, there is a gap in the market. If you have even basic professional skills, you’re going to look better than the 95% of the candidates that have applied.&lt;/p&gt;

&lt;p&gt;Professional skills are vital. Even if you do not wish to learn much about it. To the nerds out there, like me, who have studied professional skills we know this to be true. It is a boring subject, but if you study this boring subject, you’re going to look like the best thing since sliced bread to employers.&lt;/p&gt;

&lt;p&gt;Degrees don’t matter. Unless you don’t have one. If you have one, it doesn’t matter. 99% of the people applying for graduate junior positions have degrees. A degree will not make you stand out, no matter how hard you work towards that degree. You need to differentiate yourself, by showing that you are more than just a degree title. One of the ways you could do this is by learning professional skills.&lt;/p&gt;

&lt;p&gt;This book is written for everyone who understands that this is a vital skill but does not have the knowledge or means to study it. This book is written for everyone who desperately wants to learn these skills but falls asleep in the lectures on them.&lt;/p&gt;

&lt;p&gt;If you have no interest in getting an increase in salary before you start, or no interest in being the best intern a company has ever had, then put this book down. Do not read it. This is not for you.&lt;/p&gt;

&lt;p&gt;One of the people who read the original draft on this got a promotion before they started. Their CV was “the best thing we had ever seen” and because of this, the person was deemed a god amongst everyone who didn’t have basic knowledge of constructing a CV.&lt;/p&gt;

&lt;p&gt;Let me tell you a secret. For a select few who are obsessed with professional skills, getting internships is a game. I am not joking. One of my friends got 36 internships in his first year at the likes of Bank of America, Barclays, Royal Bank of Scotland, Amazon, Apple, and many more. I have more friends who have achieved similar feats.&lt;/p&gt;

&lt;p&gt;For a select few, professional skills are a game. I’ve interviewed as many of them as I could to learn the secrets to the game, how to get any job you want. This book is a compilation of wisdom from that exclusive group and much more.&lt;/p&gt;

&lt;h2 id="career-vs-job"&gt;Career vs Job&lt;/h2&gt;

&lt;p&gt;Let’s get right into the business of the day. A job is something you do for money. Your part time Tesco work is a job. A career is what your life is, what you’re doing with your life. This is anything that can take over your life. A professor at University, for example.&lt;/p&gt;

&lt;p&gt;With a job, you work a shift and that’s it. You don’t do anything else.&lt;/p&gt;

&lt;p&gt;With a career, you work a shift, you go home, and you work some more. You may go to conferences, you may network, you may learn some things in order to improve yourself at your job. Here are the biggest differences:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Career&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Job&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Long term&lt;/td&gt;
&lt;td&gt;Short Term&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lots of growth and opportunities&lt;/td&gt;
&lt;td&gt;Low or no growth&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Earning experience&lt;/td&gt;
&lt;td&gt;Earning money&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Go above and beyond&lt;/td&gt;
&lt;td&gt;Doing the bare minimum&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Happy that you get to work&lt;/td&gt;
&lt;td&gt;Angry or frustrated that you’re forced to work&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Aligned with the core values of the company&lt;/td&gt;
&lt;td&gt;Uninterested or doesn’t care about the core values&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Looking to move up the corporate ladder&lt;/td&gt;
&lt;td&gt;Looking for a new job that pays more&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A career is a journey&lt;/td&gt;
&lt;td&gt;A job is a grind&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2 id="the-job-cycle"&gt;The job cycle&lt;/h2&gt;

&lt;p&gt;When you’re in university, there’s a certain cycle you normally have to follow in order to get a good graduate job. The cycle is:&lt;/p&gt;

&lt;p&gt;Insight days &amp;gt; Spring internships &amp;gt; Summer internships &amp;gt; Placement year &amp;gt; Graduate job.&lt;/p&gt;

&lt;p&gt;You don’t need to do all of these things. The typical way most people go around it is:&lt;/p&gt;

&lt;p&gt;Summer internships (or a placement year) &amp;gt; Graduate job.&lt;/p&gt;

&lt;p&gt;The lower you start on this cycle, the more likely you are to get a job. This cycle doesn't matter that much, unless you’re applying somewhere exclusive. If you want to work somewhere like Bank of America, you’ll need to follow this cycle.&lt;/p&gt;

&lt;p&gt;Bank of America would rather hire someone who went through the whole cycle with them than someone who didn’t. It matters here, since they are such a big company even their insight days fill out quickly. They don’t need to bother with people who have only done an internship, if they have hundreds who have done insight days or are even campus ambassadors for them.&lt;/p&gt;

&lt;p&gt;The lower levels (insight days, spring internships, sometimes summer internships) carry over from other companies in the same industry.&lt;/p&gt;

&lt;p&gt;If you did insight days and a spring internship at BlackRock, Bank of America will think that’s really good as you’re in the industry. Of course, they’ll always pick someone who has worked for their company over someone who’s just worked at a competitor, but you can’t expect to do 20 insight days / 20 spring internships just to get a chance at a company.&lt;/p&gt;

&lt;p&gt;Most insight days / spring internships are just advertisements for a company.&lt;/p&gt;

&lt;h2 id="landing-that-job"&gt;Landing that job&lt;/h2&gt;

&lt;p&gt;It’s better to focus on 5 companies than it is to apply to 100. I’m willing to bet that the person who applies to 5 companies, who has researched every company and knows them all will get more graduate job offers, than the person who has applied for 100 but doesn’t know a thing about the companies they have applied for.&lt;/p&gt;

&lt;p&gt;If you have an internship, here’s some good advice from a recruiter on how to turn that internship into a graduate job.&lt;/p&gt;

&lt;p&gt;This advice comes from Andrew Osayemi.&lt;/p&gt;

&lt;p&gt;“So, you are fortunate to have a spring or summer internship &amp;amp; are looking for 1 piece of unconventional advice, to help increase your chances of being offered a full-time graduate job?&lt;/p&gt;

&lt;p&gt;Well the advice is very simple — Ask everyone on your team if they would like a tea or coffee every 2–3 hours each day&lt;/p&gt;

&lt;p&gt;Do it with a warm smile.&lt;/p&gt;

&lt;p&gt;If they say no — still smile &amp;amp; politely say “no problem, please let me know if you need anything!”&lt;/p&gt;

&lt;p&gt;And if they say yes, write down their order carefully so you don’t mess it up including any special requests (soya milk, 10 sugars etc)&lt;/p&gt;

&lt;p&gt;When you return with their beverage of choice, again make sure you give it to them with a warm smile!&lt;/p&gt;

&lt;p&gt;Now the next 10 seconds is crucial&lt;/p&gt;

&lt;p&gt;&lt;span id="_tyjcwt"&gt;&lt;/span&gt;You have an opening to ask how their day is going, if they have any work for you to do, if you can book a convenient time to work shadow them, did they watch the latest reality show etc.&lt;/p&gt;

&lt;p&gt;Very soon your likeability factor will be increased which greatly impacts your chances of being offered a full-time graduate offer!&lt;/p&gt;

&lt;p&gt;I’ve given this advice to countless students whom I have coached via Rare Recruitment &amp;amp; the feedback is “It works”!&lt;/p&gt;

&lt;h2 id="your-universitys-careers-team"&gt;Your university’s careers team&lt;/h2&gt;

&lt;p&gt;Your university's careers team is an elite squad of experts whose entire jobs are to get you great jobs. This book isn’t meant to be a replacement for them, it goes hand in hand with them. They can interview you, look at your CV &amp;amp; more to help you get prepared.&lt;/p&gt;

&lt;p&gt;You can find out how to access your university’s careers team by Googling “[University name] careers team”.&lt;/p&gt;

&lt;h3 id="my-universitys-careers-team-is-bad"&gt;My university’s careers team is bad&lt;/h3&gt;

&lt;p&gt;It happens. The good news is that you’re already on your way to becoming an expert in employability skills. By reaching out and reading this book, you’re already doing 90% more than anyone else applying for that job - learning more about employability skills.&lt;/p&gt;

&lt;p&gt;For practice with interviews - go to as many as possible. Apply to companies you’ll likely never work at just to get interview experience. The more you do, the better. When you’re at an interview, make friends with the other candidates and work together to achieve greatness. To get great jobs. They’ll likely be able to help you with your CV &amp;amp; other things.&lt;/p&gt;

&lt;h2 id="one-last-thing-before-chapter-1"&gt;One last thing before Chapter 1&lt;/h2&gt;

&lt;p&gt;This book isn’t a one size fits all book. The recruitment industry is large. So large in fact, that it’s impossible to cover every single titbit. In some industries, a nicely designed CV is essential. In others, anything other than black and white is seen as a monstrosity. While I try my best in this book to guide you along this path, know that you need to research yourself. I can’t possibly cover every single industry here.&lt;/p&gt;

&lt;h2 id="section"&gt;&lt;/h2&gt;

&lt;h1 id="chapter-1---curriculum-vitae"&gt;How to Write a CV&lt;/h1&gt;

&lt;p&gt;A Curriculum Vitae (CV) or a resume is one of the most vital parts of job hunting. Put simply, it is a piece of paper you give to a recruiter. This recruiter decides if you are worth the time to interview based on this bit of paper.&lt;/p&gt;

&lt;p&gt;Every job requires a CV. Sometimes, the job will force you to rewrite your entire CV on their website. Even if it does, you’ll still need a CV.&lt;br&gt;
&lt;br&gt;
As such, writing a good CV is the key to getting a good job.&lt;br&gt;
&lt;br&gt;
The CV is a summary of your professional life so far. It features your education, your work experience, skills and more.&lt;/p&gt;

&lt;p&gt;Most times a person reads the CV, but sometimes machines can also read it. Recently artificial intelligence is being used to read CVs. When a human reads your CV, they don't exactly read it. Estimations say that they spend 7 seconds on your CV, but this isn't true. If you were in the position of looking at CVs and you saw something that looked spiritless, would you bother reading it? I know you wouldn't. That's why your CV needs to catch their eyes. It needs to make them curious and interested in you within the first second or two. First impressions matter here, A lot.&lt;/p&gt;

&lt;h2 id="personalising-your-cv"&gt;
&lt;br&gt;
Personalising your CV&lt;/h2&gt;
&lt;p&gt;Your CV will impress the person reading it if it’s customised to them. Everyone likes a customised birthday cake more than a regular Tesco own brand birthday cake.&lt;br&gt;
Make it look like you're perfect for the job because the employer only wants the perfect candidate. The thing with applying for a very large organisations is that they have no shortage of candidates. Why settle on someone mediocre when 2 weeks later you’ll have someone perfect for the role? You need to act perfect and believe you are perfect for the role.&lt;/p&gt;
&lt;h3 id="keywords-is-the-keyword-of-this-section"&gt;Keywords is the keyword of this section&lt;/h3&gt;
&lt;p&gt;An AI looks for keywords. They do not have an average time of looking at your CV.&lt;br&gt;
A recruiter will insert a bunch of keywords into a computer program. The program will scan each CV and give the CV a score on how many keywords the CV has. This is why it is important to know what keywords to put into your CV. But, having an A4 piece of paper with font size 2 to fill it to the brim of keywords might not work. You don't know whether they will use a human or a machine - or even both. Machines can rank your CV depending on how ‘clean’ it is too.&lt;/p&gt;
&lt;p&gt;To insert keywords, you need to know what job you are applying for and what company.&lt;br&gt;
Let's say you apply to Barclays for a summer analyst position.&lt;br&gt;
First you would Google around. Search for terms like "Barclays CV keywords" and "Summer analyst keywords CV". If these do not return anything then read the description.&lt;br&gt;
A part of the description in 2018 states this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;“&lt;em&gt;We are looking for bright, personable individuals who have the ambition to succeed and an impetus to learn and make the most of this fantastic opportunity within a competitive environment.”&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;From https://joinus.barclays/eme/internships/banking-summer-analyst&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Barclays are looking for people who love learning. Who want to make a difference to themselves and to the world and are above all, kind.&lt;/p&gt;
&lt;p&gt;You should customise your CV to show that you love learning. You are kind hearted (volunteering work can prove this, for example) and understand that it is a competitive position. Try to use the keywords themselves. Barclays say you need “an impetus to learn”, you can write in your CV profile that you have an impetus to learn. You should show that you need this position.&lt;/p&gt;
&lt;p&gt;To customise your CV, analyse the job description. Obsessively read it and highlight keywords that come up. They say that they want someone with strong self-motivation? Find something you’ve done that proves this and put it on to your CV. Just like with the Barclays example earlier, it’s all about matching your CV up to the job description as much as possible.&lt;/p&gt;
&lt;p&gt;By inserting keywords into the CV you'll be able to pass the keyword test performed by machines, as discussed earlier. But please do not puke keywords onto your CV, it has to look natural.&lt;/p&gt;
&lt;p&gt;Read the job description, the responsibilities, the specific requirements, the location. If you see a word you don't know, Google it. That word you don’t know is likely a keyword. Remember the Barclays example from earlier? It’s like they’ve grabbed a thesaurus and randomly inserted words into the job description. These words are keywords.&lt;/p&gt;
&lt;p&gt;Some keywords come up and up again in many jobs such as:&lt;br&gt;
• Teamwork&lt;br&gt;
• Time management&lt;br&gt;
• Microsoft Office&lt;br&gt;
• Leadership skills&lt;br&gt;
• Computer literacy&lt;/p&gt;
&lt;p&gt;Let’s say a job description has this sentence in it:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“Required — Advance knowledge of Microsoft Applications (Word, Excel, PowerPoint).”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Then instead of writing “Microsoft Office” on your CV you write:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“Advance knowledge of Microsoft Software (Word, Excel, PowerPoint).”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If the machine reads your CV, you'll pass the keyword test. If a human reads your CV, they may not remember the job description exactly, which is good. When they read "Advance knowledge of Microsoft Software…" something will click in their head which makes you stand out. That something is that their subconscious memory recalls the keywords used in the job description.&lt;/p&gt;
&lt;h3 id="making-the-cv-fit-around-you-not-you-trying-to-fit-into-a-cv-template"&gt;Making the CV fit around you, not you trying to fit into a CV template&lt;/h3&gt;
&lt;p&gt;If you’re applying for a job that requires programming, have a “languages” section on your CV that talks about all the languages you know. Or if you know other languages, include them. There isn’t a one size fits all CV that’s perfect for you. You need to make the perfect CV for you.&lt;/p&gt;
&lt;p&gt;It’s also best to rate your skills. If you’re fluent in German, say you’re fluent. If you’re not fluent but still quite good, write intermediate. Be honest, don’t lie that you’re fluent in Mandarin as the job might need that you are.&lt;/p&gt;
&lt;p&gt;Most people fire off blankets of CV’s to every single recruiter on their LinkedIn or job recruiters like it’s the last thing you’ll ever do. Do not do this. Customisation per job is vital.&lt;/p&gt;
&lt;h3 id="lie-about-your-location"&gt;
&lt;br&gt;
Lie about your Location&lt;/h3&gt;
&lt;p&gt;Want to get a job in London? Then write “London” on your CV.&lt;br&gt;
This won't work well if you write "London" and you live in Scotland unless you plan to move.&lt;br&gt;
If you get called up on it say you're going to relocate, or you enjoy commuting.&lt;/p&gt;
&lt;p&gt;You need the employer to think that if they hire you, they won’t come into any problems like you living an hour away.&lt;/p&gt;
&lt;h3 id="how-to-research-an-organisation"&gt;How to research an organisation&lt;/h3&gt;
&lt;p&gt;You need to know about an organisation before you apply for a job there. You can’t apply to an organisation you know nothing about and expect to get the job. In order to be the perfect candidate, you need to be an expert on this organisation.&lt;/p&gt;
&lt;p&gt;Some of the things you want to find out are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The mission statement of the company&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Who founded it and why&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A brief history of the company&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Current CEO of company&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Where they are based&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Products and services&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Competitors&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Current issues&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Current news&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ethics &amp;amp; morals&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Culture&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The people you will be working with / the person interviewing you&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Career development&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Travel opportunities&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once you’ve researched about them, add the things you’ve found to a word document and print it out. Go over this document on the way to the interview. You do not need to memorise every company you apply for. Use this information in your cover letter and learn the information the day before your interview.&lt;/p&gt;
&lt;p&gt;You could Google most of these. Just Google “[Companies name] [thing you want to find out]”. ` When you research a company, the best website you should concentrate on is the company's own website. For history, you should look at the company's Wikipedia page. For current news, you can Google search the company and click the “news” tab.&lt;/p&gt;
&lt;p&gt;For most companies, Bloomberg contains a “snapshot” of the company. This includes the key executives for the company, their age, their annual compensation, a company overview, how many employees they have and more. The key thing about these snapshots are the “key developments” section whereby Bloomberg lists the most important news and developments for a company.&lt;/p&gt;
&lt;p&gt;To find a Bloomberg snapshot of a company, Google “[company name] Bloomberg snapshot”.&lt;/p&gt;
&lt;p&gt;If the company is especially big, chances are that the Economist has written an article about them at some point. Find sources you like &amp;amp; trust, and search to see if that company has come up in these sources.&lt;/p&gt;
&lt;h2 id="writing-a-cv"&gt;
&lt;br&gt;
Writing a CV&lt;/h2&gt;
&lt;h3&gt;How Long Should an CV Be?&lt;/h3&gt;
&lt;p&gt;Now we know about customising a CV, let’s get into how to write a CV. The first most important rule is that your CV should be 1 page. Not double sided but one page. If you have 15+ years of experience then 2 pages is okay, but 1 page is always preferable.&lt;/p&gt;
&lt;h3 id="choosing-the-right-cv-template"&gt;Choosing the right CV Template&lt;/h3&gt;
&lt;p&gt;Choosing the right CV template is always important. You could try to create your own template, but I don’t suggest you do this unless you’re good at design. The simplest and easiest way to find a good template is to Google “CV Template” and pick one you like.&lt;/p&gt;
&lt;p&gt;Make sure the template is well designed and it has to be visually appealing. The template should be slightly sparse of information. A CV with little information on it looks more appealing than a CV full of information. The recruiter is used to CVs with paragraphs upon paragraphs of information. If you have little information, it will catch their eye. Try not to disclude stuff that’s directly relevant to the position, you want to be the best person for the job.&lt;/p&gt;
&lt;p&gt;If you know a little tiny bit about computers, you can Google “LaTeX CV templates” to get some nice templates for free. If it’s on Overleaf or ShareLaTeX then it’s easier to use. LaTeX is like a programming language but for writing.&lt;/p&gt;
&lt;p&gt;A well-designed CV is more important than most people think. Well designed does not have to equal “pretty colours and nice shapes”.&lt;/p&gt;
&lt;p&gt;In some industries, a well designed CV is a burden. Employers can hate them with a burning rage. The recruitment industry is less “this one tip works for everyone” and more “this one tip is really cool for a specific part of the industry”. Well designed CVs may be appreciated at tech start-ups or design companies, but at other places like law firms they can be hated. While in this book I advocate for colour CVs, know that you need to perform your own research and find out if its appropriate for your industry.&lt;/p&gt;
&lt;p&gt;Another downside to using well designed CVs is that Applicant Tracking Software can’t read them. This is the software / AI used to determine whether or not you are the right candidate.&lt;/p&gt;
&lt;p&gt;Instead of reading these chapters and thinking “this is perfect for my industry” I implore you to think “this is a good idea, but I wonder if my industry likes this?”&lt;/p&gt;
&lt;p&gt;If you believe the answer to be “yes, my industry likes this” then go ahead.&lt;/p&gt;
&lt;p&gt;But, the benefits for well designed CVs still exist. No one else will have a CV like yours, so you’ll stand out. Also, you can have a well designed CV and have a plain black / white layout. Whitespace is your friend here. Lots of space, sparse information.&lt;/p&gt;
&lt;p&gt;You have to decide for yourself what is good and what is bad. All industries are different.&lt;/p&gt;
&lt;p&gt;My friend Chris has so many internships he’s lost count. These include places like Bank of America, Google, Facebook and many, many more. His CV is black &amp;amp; white and it worked pretty well for him. Try to find people in the industry you’re applying for like Chris who have a lot of experience applying to jobs. Ask them what the industry is like. You can use LinkedIn for this.&lt;/p&gt;
&lt;p&gt;Your CV needs to be eye-catching, it needs to be designed well. It needs to look good and have the correct information in it.&lt;/p&gt;
&lt;p&gt;Personally speaking, I use NovoResume.com for all of my CV needs. I have been using them for years, and they’ve never once let me down.&lt;/p&gt;
&lt;p&gt;Your university careers team might also have templates for you to use, but I would recommend at least modifying this template. Thousands of people will use your universities careers template every year, try to make it unique and make it your CV. If you’ve found 2 or more templates you really like, and you don’t know which one to use, just ask your university careers team.&lt;/p&gt;
&lt;p&gt;If your CV is visually stunning, the employer will love it. They read so many of the same black &amp;amp; white PDF documents filled with information every day they’re desperate to find something that has a hint of graphic design.&lt;/p&gt;
&lt;p&gt;Going hand in hand with a well-designed CV, don’t crinkle your CV or put folds in it if you print it out. It has to look like it just came out of a printer. Never, ever hand over a CV with a crinkle or fold in it.&lt;/p&gt;
&lt;h3 id="achievements-jobs-on-a-cv"&gt;Achievements &amp;amp; Jobs on a CV&lt;/h3&gt;
&lt;p&gt;When writing out your CV, list your achievements at a job. Don’t list the duties you had to do. Everyone has to do stuff at a job, achievements are more impressive. Make sure the CV is visually appealing and sparse of information. You want to tell a story in as few words as possible. Put your jobs in reverse-chronological order so your most recent work appears at the top of the CV.&lt;/p&gt;
&lt;p&gt;If I was to say that I was the best Student Union officer that would make me sound big headed. If I was to change that to “changed Student Union approval rating from 30% to 90%” it would sound even more impressive and not so egotistical.&lt;/p&gt;
&lt;p&gt;Achievements are important too. Try to make your achievements in this format:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“I did X by doing Y as proved by Q”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;As a general rule you need to have some sort of statistic related to the achievement. It makes the achievement sound so much more impressive. Mixing this achievement rule with statistics will go a long way for you.&lt;/p&gt;
&lt;p&gt;Don’t include jobs if it’s not relevant. If you’re applying to be an investment banker and you worked at an ice cream shop for a week, it’s not really helpful for you to put that on. It’ll just make your CV look messy. If you have no experience, it will be more helpful to put your education on it. You want to balance your education and work experience. If you’ve never worked anywhere relevant before, you’ll want to include your A-levels and university modules with grades. If you’ve worked in industry, as an internship or whatnot then you might not want to include A-levels in order to write more about this experience.&lt;/p&gt;
&lt;p&gt;Real world experience is always worth more than education, so try to disclude as much information of your education as possible. But make sure to put university on there. Don’t include primary / secondary school. The earliest you can go back to is A levels.&lt;/p&gt;
&lt;p&gt;If you’re applying for a job in academia, your education matters a lot more than normal. If you have a perfect mix of work experience and education, try to list your education shortly. Only include the modules that are relevant to the job. If you’re applying for a job in game design and you’ve done modules on game design, include them.&lt;/p&gt;
&lt;p&gt;The single most important thing you can do to make your CV stand out is to customise your CV per job.&lt;/p&gt;
&lt;h3 id="how-to-spell-check-your-cv"&gt;How to spell-check your CV&lt;/h3&gt;
&lt;p&gt;You need to avoid spelling and grammar mistakes at all costs. It is the difference between you getting a job and you not getting the job. The simplest form of spell checking you can do is to run the Microsoft Word spell checker. But, this isn’t good enough. You actually need to read your CV, and then get someone else to read it for you.&lt;/p&gt;
&lt;p&gt;Your university's careers team is perfect for this. Almost every careers team will have some form of session or drop in clinic for them to read your CV and pick up on anything that’s wrong. When in doubt, visit your careers team.&lt;/p&gt;
&lt;p&gt;Instead of Microsoft Word’s spell checker, I use Grammarly.&lt;/p&gt;
&lt;h3 id="to-pdf-or-not-to-pdf"&gt;
&lt;br&gt;
To PDF or not to PDF&lt;/h3&gt;
&lt;p&gt;Always send your CV as a PDF unless they absolutely specify it has to be sent in a format they require.&lt;/p&gt;
&lt;p&gt;The PDF is designed to be readable on any machine. The way the PDF looks on your machine is the exact same way it'll look on any other machine. Anyone can open a PDF. PDFs are supported in Internet Explorer or Chrome. With Microsoft Word, if they have a different Word version to you it may look different. It may actually look worse to them than it does to you. Also, not everyone has Microsoft Word; but everyone has a web browser like Firefox or Chrome.&lt;/p&gt;
&lt;p&gt;If they need the CV in plaintext (copy and paste) you have to change the formatting. You can make sections using “ — — “. Like so:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Achievements&lt;br&gt;
-------------------&lt;/p&gt;
&lt;p&gt;* Changed Student Union approval rating from 30% to 90%&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You can use an asterisk as a bullet point, as seen above.&lt;/p&gt;
&lt;p&gt;&lt;span id="_4ij8ebsyhmr2"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h3 id="references"&gt;References&lt;/h3&gt;
&lt;p&gt;No references available on request. No one I know that gets jobs does this. Make it as easy as possible for the recruiter. Contacting you to ask for references is another step to them, which makes it harder. Cut out the middleman and put the contact details for your reference on the CV itself.&lt;/p&gt;
&lt;p&gt;I know that some references will write you letters, and that’s good. You should hand these in when they ask for qualifications (if they do) or letters of recommendation. Please do not copy and paste your references’ letters onto your CV or attach them to the other blank side. It’s just not good.&lt;/p&gt;
&lt;p&gt;You’ll usually want 2 references, 1 academic and 1 work related. If you have never worked somewhere before, use another academic reference if you can or someone you have volunteered with. Or the head of a society you’re active in.&lt;/p&gt;
&lt;p&gt;When you put the reference on your CV, it should look like this:&lt;br&gt;
Name&lt;br&gt;
How they know you (ex-boss, ex-co-worker)&lt;br&gt;
Contact details (email, phone)&lt;/p&gt;
&lt;p&gt;That’s it. No “I went drinking with him every Friday”. No stories or anything, short and sweet.&lt;/p&gt;
&lt;p&gt;Make sure you ask the person if you can use them as a reference. Make sure they will only say good things about you. If they want to "be honest" about you, find someone else. Your references should gleam at the opportunity to talk about how amazing you are.&lt;/p&gt;
&lt;p&gt;In a warm Starbucks once I was talking to a recruiter. They talked about how many people put references down without making sure the referencer is okay with it. Or they'll put a reference down that isn't too keen on the person. The recruiter would often call these references and get:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"They were alright, they did the job"&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;or even worse:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Who are they again?"&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It's important to make sure your references know you and love you. Be very careful with what information you put down too.&lt;/p&gt;
&lt;p&gt;If you put down the references personal phone number and your CV gets shared around, you’ve shared personal information with people the reference doesn’t even know about. This is violating many Data Protection Act Regulations.&lt;/p&gt;
&lt;p&gt;In some countries, you don’t even need to put references down on your CV. References are sometimes the very last thing a recruiter asks for. You could instead use that reference space for something more important.&lt;/p&gt;
&lt;p&gt;Like with choosing a well designed CV or a plain CV, you need to decide for yourself. While in the UK it is traditional to put references down, you need to consider the benefits and downsides of it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Benefits&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Easy for the recruiter to find out more about you. Easier for the recruiter is always better&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Downsides&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Takes up precious space on a CV. CVs are supposed to only be 1 page long, you could use that space for something else.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Not needed in most countries.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You could accidentally violate Data Protection Regulations.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="make-it-as-easy-for-your-employer-as-possible"&gt;
&lt;br&gt;
Make it as Easy for your Employer as Possible&lt;/h3&gt;
&lt;p&gt;Referencing what I said earlier, make it as easy for your employer as possible. Think about who you are applying to. If you’re applying in the tech industry, chances are that they are reading your CV on a computer, so hyperlinks in CVs are cool. If not, don’t include them as they don’t look good when printed out.&lt;/p&gt;
&lt;p&gt;Are you applying to be a graphic designer? The design of your CV matters the most. Are you applying to be a game developer? You could make your CV as a game, like Robbie Leonardi did here: &lt;a href="http://www.rleonardi.com/interactive-resume/"&gt;&lt;em&gt;www.rleonardi.com/interactive-resume/&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Really think about who you are applying for and how you can make your CV better for them.&lt;/p&gt;
&lt;h3 id="have-a-profile-section"&gt;
&lt;br&gt;
How to Write a Personal Statement for a CV&lt;/h3&gt;
&lt;p&gt;The personal statement on a CV, also known as a profile, is a small section of your CV that includes a brief summary of your skills, experiences and goals. It is your elevator pitch. Imagine you are in an elevator with the recruiter of a large company. You have 30 seconds to convince them to care about you enough to want to interview you. This is the elevator pitch. A good profile makes people interested in you. It gives them a reason to read on and pay attention to your CV.&lt;/p&gt;
&lt;p&gt;This is truly customised to you. I really cannot tell you what to write. Your elevator pitch should talk about who you are, what you do, your education, and your goals in life. A good profile will break these rules. It’s one thing to follow the rules, but in order to stand out you need to break these rules. My profile is:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“Obsessive learner and problem solver, always looking for the next big problem to solve”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Your elevator pitch talks about your education &amp;amp; experience, your CV profile talks about you as a person. If they want to know about your education &amp;amp; experience, they’ll simply read on. Your principles and goals in life are discovered, not invented.&lt;/p&gt;
&lt;p&gt;My friend’s profile says:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“I love what I do – turning ideas into reality by coding. “&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It’s incredibly hard for me to describe this, since it has to be personalised to you. No one can tell you what to write here, but keep in mind that you’ll discover what you love if you keep it in the back of your head for long enough.&lt;/p&gt;
&lt;h3 id="bullet-points-paragraphs-action-verbs"&gt;
&lt;br&gt;
Bullet points, paragraphs &amp;amp; action verbs&lt;/h3&gt;
&lt;p&gt;Bullet Points. Always try to have bullet points. You’re allowed to include paragraphs, but if everything in your CV is a paragraph it’ll look extremely dull. Bullet points are more readable.&lt;/p&gt;
&lt;p&gt;Personally speaking, the only time I use paragraphs is for my achievements, when I want to tell a story. Everything else is bullet points. You should use action verbs in your bullet points to make it sound powerful. Instead of saying:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“I led a project”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You can say:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“I orchestrated a project”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Here is a list of 185+ action verbs you can use, from the website The Muse&lt;sup&gt;1&lt;/sup&gt;&lt;/p&gt;
&lt;h4 id="section-1"&gt;&lt;/h4&gt;
&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;h4 id="you-increased-efficiency-sales-revenue-or-customer-satisfaction"&gt;You increased efficiency, sales, revenue, or customer satisfaction&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Accelerated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Achieved&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Advanced&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Amplified&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Boosted&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Capitalized&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Delivered&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enhanced&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Expanded&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Expedited&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Furthered&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Gained&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Generated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Improved&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lifted&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Maximized&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Outpaced&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Stimulated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sustained&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;h4 id="you-thought-of-and-brought-a-project-to-life"&gt;You thought of and brought a project to life&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Administered&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Built&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Charted&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Created&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Designed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Developed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Devised&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Founded&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Engineered&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Established&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Formalized&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Formed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Formulated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Implemented&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Incorporated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Initiated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Instituted&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Introduced&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Launched&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pioneered&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Spearheaded&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;h4 id="you-saved-the-company-time-and-money"&gt;You saved the company time and money&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Conserved&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Consolidated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Decreased&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deducted&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Diagnosed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lessened&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reconciled&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reduced&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Yielded&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;h4 id="you-were-in-charge-of-a-project"&gt;You were in charge of a project&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Chaired&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Controlled&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Coordinated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Executed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Headed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Operated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Orchestrated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Organized&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Oversaw&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Planned&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Produced&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Programmed&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;h4 id="you-manage-a-team"&gt;You manage a team&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Aligned&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cultivated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Directed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enabled&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Facilitated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Fostered&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Guided&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hired&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Inspired&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mentored&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mobilized&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Motivated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Recruited&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Regulated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Shaped&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Supervised&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Taught&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Trained&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Unified&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;United&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;h4 id="you-changed-or-improved-something"&gt;You changed or improved something&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Centralized&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Clarified&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Converted&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Customized&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Influenced&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Integrated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Merged&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Modified&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Overhauled&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Redesigned&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Refined&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Refocused&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Rehabilitated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Remodelled&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reorganized&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Replaced&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Restructured&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Revamped&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Revitalized&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Simplified&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Standardized&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Streamlined&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Strengthened&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Updated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Upgraded&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Transformed&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;h4 id="you-changed-or-improved-something-1"&gt;You changed or improved something&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Centralized&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Clarified&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Converted&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Customized&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Influenced&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Integrated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Merged&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Modified&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Overhauled&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Redesigned&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Refined&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Refocused&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Rehabilitated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Remodelled&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reorganized&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Replaced&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Restructured&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Revamped&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Revitalized&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Simplified&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Standardized&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Streamlined&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Strengthened&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Updated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Upgraded&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Transformed&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;h4 id="you-wrote-or-communicated"&gt;You wrote or communicated &lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Authored&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Briefed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Campaigned&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Co-authored&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Composed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Conveyed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Convinced&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Corresponded&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Counselled&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Critiqued&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Defined&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Documented&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Edited&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Illustrated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lobbied&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Persuaded&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Promoted&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Publicized&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reviewed&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;h4 id="you-supported-customers"&gt;You supported customers&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Advised&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Advocated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Arbitrated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Coached&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Consulted&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Educated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Fielded&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Informed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Resolved&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;h4 id="you-overview-or-regulated"&gt;You overview or regulated&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Authorized&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Blocked&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Delegated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Dispatched&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enforced&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ensured&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Inspected&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Itemized&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Monitored&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Screened&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scrutinized&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Verified&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;h4 id="you-achieved-something"&gt;You achieved something&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Attained&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Awarded&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Completed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Demonstrated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Earned&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Exceeded&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Outperformed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reached&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Showcased&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Succeeded&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Surpassed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Targeted&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;h4 id="you-were-a-research-machine"&gt;You were a research machine&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Analysed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Assembled&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Assessed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Audited&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Calculated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Discovered&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Evaluated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Examined&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Explored&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Forecasted&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Identified&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Interpreted&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Investigated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mapped&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Measured&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Qualified&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Quantified&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Surveyed&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tested&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tracked&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;h4 id="you-brought-in-partners-funding-or-resources"&gt;You brought in partners, funding, or resources&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Acquired&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Forged&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Navigated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Negotiated&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Partnered&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Secured&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h3 id="things-to-include-in-a-cv"&gt;
&lt;br&gt;
Things to Include in a CV&lt;/h3&gt;
&lt;p&gt;You have a template and you want to change a few things, here are some things you might want to include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Personal details — Telephone, professional email, location, name&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Work experience&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Achievements&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Education&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hobbies and interests that relate to the job&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Key skills relating to the job&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Know any languages that relate to the job? Put them down!&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can also put a language down that doesn’t relate to the job. If you know an Asian language like Chinese and you put that into your CV, the recruiter will instantly think you are some sort of super genius.&lt;/p&gt;
&lt;h3 id="what-not-to-include-in-a-cv"&gt;
&lt;br&gt;
What not to include in a CV&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A head-shot / image of you. Unless the company specifies that they need this, do not do this. They do not want to see you.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Age and date of birth — It’s illegal for employers to ask about your age under the Equality Act of 2010.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Martial / Relationship status — Again under the Equality Act of 2010 they cannot ask this.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Every single thing you have ever done — Make it short and customise it per job.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let’s just list all the things that the Equality Act of 2010 makes illegal for employers to ask you:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Marital status&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Date of birth / age&lt;sup&gt;2&lt;/sup&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Gender&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Dependants&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;General health&lt;sup&gt;3&lt;/sup&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Religion&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Disabilities&lt;sup&gt;4&lt;/sup&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Spent criminal convictions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Trade Union membership&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ethnicity or other underrepresented characteristic&lt;sup&gt;5&lt;/sup&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pregnancies&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sexual Orientation&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="summary-of-this-chapter"&gt;Summary of this chapter&lt;/h2&gt;
&lt;h3 id="personalising-a-cv"&gt;Personalising a CV&lt;/h3&gt;
&lt;p&gt;☐ Have you used a CV template?&lt;/p&gt;
&lt;p&gt;☐ Have you customised the CV template to fit around you?&lt;/p&gt;
&lt;p&gt;☐ Does your CV have keywords in it?&lt;/p&gt;
&lt;p&gt;☐ Is your CV clean &amp;amp; minimalistic?&lt;/p&gt;
&lt;p&gt;☐ Do you have special sections related to the job? IE languages, skills, achievements?&lt;/p&gt;
&lt;p&gt;☐ Does your CV have contact details on it, and is the location where you want to be / where you are?&lt;/p&gt;
&lt;p&gt;☐ Do you have achievements at a job on your CV?&lt;/p&gt;
&lt;p&gt;☐ Have you spell checked you CV?&lt;/p&gt;
&lt;p&gt;☐ Is your CV a PDF?&lt;/p&gt;
&lt;p&gt;☐ Do you have references, without "references available on request" on your CV?&lt;/p&gt;
&lt;p&gt;☐ Do you have a profile section?&lt;/p&gt;
&lt;p&gt;☐ Do you have action verbs in your CV?&lt;/p&gt;
&lt;p&gt;☐ Have you gotten rid of everything under the Equality Act of 2010, unless it benefits you in some way?&lt;/p&gt;
&lt;h3 id="researching-an-organisation"&gt;Researching an organisation&lt;/h3&gt;
&lt;p&gt;Do you know these things about the company:&lt;/p&gt;
&lt;p&gt;☐ Mission statement of the company&lt;/p&gt;
&lt;p&gt;☐ Who founded it &amp;amp; why&lt;/p&gt;
&lt;p&gt;☐ A brief history of the company&lt;/p&gt;
&lt;p&gt;☐ Current CEO of the company&lt;/p&gt;
&lt;p&gt;☐ products &amp;amp; services&lt;/p&gt;
&lt;p&gt;☐ Competitors&lt;/p&gt;
&lt;p&gt;☐ Current issues&lt;/p&gt;
&lt;p&gt;☐ News&lt;/p&gt;
&lt;p&gt;☐ Culture&lt;/p&gt;
&lt;p&gt;☐ Career development&lt;/p&gt;
&lt;h1 id="chapter-2---cover-letters"&gt;How to Write a Cover Letter&lt;/h1&gt;
&lt;h2&gt;What is a cover letter?&lt;/h2&gt;
&lt;p&gt;The cover letter is a letter that goes with a CV that explains why you want a job. It can be the first chance you get to stand out to your potential employer.&lt;/p&gt;
&lt;p&gt;What makes a cover letter so difficult is that there is no clear-cut formula to writing a cover letter.&lt;/p&gt;
&lt;p&gt;Ultimately the goal of the cover letter is to draw attention to yourself. It should be clear, concise and display competent language skills.&lt;/p&gt;
&lt;p&gt;It is important to note that not all jobs require a cover letter. It should state it in the job description if it does require a cover letter.&lt;/p&gt;
&lt;h2 id="design-of-a-cover-letter"&gt;Design of a cover letter&lt;/h2&gt;
&lt;p&gt;Google “Cover letter templates” and find one you like. The exact same advice from the CV applies here too. Make sure it’s designed nicely. If you use Novoresume, they also have cover letter templates.&lt;/p&gt;
&lt;h2 id="length-of-the-cover-letter"&gt;How Long Should a Cover Letter Be?&lt;/h2&gt;
&lt;p&gt;Some people write entire novels as cover letters, well, almost. Your cover letter should be short. A full page at most.&lt;/p&gt;
&lt;p&gt;The shorter a cover letter is, the better it will look. Don’t try to skimp on information to make it shorter. 4 paragraphs are around the perfect length since it will follow a typical story arc.&lt;/p&gt;
&lt;h2 id="general-structure-of-a-cover-letter"&gt;General structure of a cover letter&lt;/h2&gt;
&lt;p&gt;Start with an introduction. Make the reader aware of why you’re writing this. Include the job you’re applying for. We’ll go into each section soon.&lt;/p&gt;
&lt;p&gt;The 2nd paragraph is your skills, what you can provide to the company.&lt;/p&gt;
&lt;p&gt;The 3rd paragraph should be why you want to work for the company.&lt;/p&gt;
&lt;p&gt;The 4th paragraph is the conclusion. Mention that you look forward to hearing back from them.&lt;/p&gt;
&lt;p&gt;This follows a typical story arc. Start off with who you are, why they should care, why you care about them, summarise and end.&lt;/p&gt;
&lt;h2 id="some-general-tips-for-the-cover-letter"&gt;What to Include in a Cover Letter and General Tips&lt;/h2&gt;
&lt;p&gt;Don’t talk about how great the position would be to you. Talk about what you can bring the company, always have the company in mind. Show what you’re capable of within a cover letter. Try to tell a story. Stories illuminate the human mind and intrigues them. Try to push them to read more.&lt;/p&gt;
&lt;p&gt;Do not make a one-size-fits-all cover letter. It's the same as the CV, customise it per job. Job hunting is in itself a job.&lt;/p&gt;
&lt;p&gt;As with a CV your cover letter may be keyword tested so try to include some keywords that the employer wants to see.&lt;/p&gt;
&lt;p&gt;Always send your cover letter as a PDF for the same reason you would send a CV as a PDF.&lt;/p&gt;
&lt;p&gt;Do not use weak or passive language. http://www.hemingwayapp.com is an online editor which will show you what is considered weak or passive. Instead of writing "I feel", "I believe" write "I am confident that, "I am positive that".&lt;/p&gt;
&lt;p&gt;Try to limit the use of "I". This is a letter about how you meet the employer’s needs, not why it would be good to you.&lt;/p&gt;
&lt;p&gt;The formality depends on the company. If you are applying for a tech start-up formality likely isn't something they do. An old-fashioned bank? Be as formal you can&lt;/p&gt;
&lt;h2 id="the-start-of-the-cover-letter"&gt;How to Start a Cover Letter, and How to Address a Cover Letter&lt;/h2&gt;
&lt;p&gt;A cover letter should have your information at the start:&lt;br&gt;
• First &amp;amp; Last Name&lt;br&gt;
• Street Address&lt;br&gt;
• City&lt;br&gt;
• Postcode&lt;br&gt;
• Phone Number&lt;br&gt;
• Email Address&lt;/p&gt;
&lt;p&gt;Then comes your salutation. Dear Sir / Madam / Mrs / Mr / Ms / Dr. If you know the person's name and their honorific, then you need to use this. The letter should feel addressed to that individual person, it should never feel like a blanket cover letter you've sent to everyone&lt;/p&gt;
&lt;p&gt;“John Gribbin&lt;/p&gt;
&lt;p&gt;171 Fake street ct9 9lr&lt;/p&gt;
&lt;p&gt;+0174857389&lt;/p&gt;
&lt;p&gt;&lt;span id="_37m2jsg"&gt;&lt;/span&gt;google@google.com”&lt;/p&gt;
&lt;h2 id="first-paragraph"&gt;First paragraph&lt;/h2&gt;
&lt;p&gt;The first paragraph is where you introduce yourself. What you’re applying for.&lt;/p&gt;
&lt;p&gt;“Dear Sir or Madam,&lt;/p&gt;
&lt;p&gt;&lt;span id="_46r0co2"&gt;&lt;/span&gt;My name is Brandon Skerritt and I am applying for the position of Bookseller at Waterstones, please find enclosed my CV.”&lt;/p&gt;
&lt;p&gt;In most cases they already know what your name is and what you’re applying for, so if you can don’t include this part. Always include the salutation. If you know the name of the person who will be reading this, use their name.&lt;/p&gt;
&lt;p&gt;As stated in How to Win Friends and Influence People:&lt;/p&gt;
&lt;p&gt;&lt;span id="_2lwamvv"&gt;&lt;/span&gt;“Names are the sweetest and most important sound in any language.”&lt;/p&gt;
&lt;p&gt;Use keywords. Keywords and statistics are the secret key to unlocking that first interview.&lt;/p&gt;
&lt;p&gt;If you were referred to the job, mention that contact. Express excitement that you’ve applied. The reader should feel like you would die if you didn't get the job. That you want this job more than anything.&lt;/p&gt;
&lt;p&gt;&lt;span id="_111kx3o"&gt;&lt;/span&gt;“I have the pleasure of being acquainted with one of the Counsellors on your staff, Eleanor Seville. She let me know about the open position and recommended that I contact you.”&lt;/p&gt;
&lt;p&gt;Recommendations are important. Some professionals state that they would never have gotten the job if not for a recommendation.&lt;/p&gt;
&lt;p&gt;The first paragraph should flow into who you are and why you want this job. You can always say "I hope you are well" if you do not know what to write.&lt;/p&gt;
&lt;h2 id="second-paragraph"&gt;
&lt;br&gt;
Second Paragraph&lt;/h2&gt;
&lt;p&gt;The second paragraph is where you talk about your skills and experience. Unlike a CV you do not use blunt bullet pointed language here but instead talk about your experience, like a story. You can also explain any gaps that might appear in a CV here.&lt;/p&gt;
&lt;p&gt;Try not to regurgitate your CV in letter form. Think about what you’re writing and why you’re writing it. Make it into a story. You need to customise your cover letter per job, much like you’ll customise your CV per job.&lt;/p&gt;
&lt;p&gt;This section should display that you have researched this position and know what it is about and how your skills match with the position.&lt;/p&gt;
&lt;p&gt;&lt;span id="_206ipza"&gt;&lt;/span&gt;“For as long as I can remember I’ve been an obsessive reader. I review books on GoodReads, I’ve written some fiction novellas in my spare time. I’ve been a bookseller for the last 2 years at [Bookshop name here] and have loved every second of it. As well as being a bookseller I’ve trained new employees and managed the general every day running of the store.”&lt;/p&gt;
&lt;p&gt;Sometimes people will use bullet points, it's entirely up to you. If this was bullet pointed it would look like:&lt;/p&gt;
&lt;p&gt;“For as long as I can remember I've been an obsessive reader, having even written some fiction novellas in my spare time. I've been a bookseller for the last 2 years and in my role, I have achieved:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Trained new employees although it wasn't my job&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Broke the record for most amount of money earnt in made in a day. Previous record was £400, my team and I made £1200&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;span id="_4k668n3"&gt;&lt;/span&gt;Located a class photo book from the 1980s by calling up every store in the area to check for it. Just to make the customer happy.”&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Bullet points make it shorter and easier to read but it also takes away the humanity of a normal paragraph.&lt;/p&gt;
&lt;h2 id="third-paragraph"&gt;Third paragraph&lt;/h2&gt;
&lt;p&gt;The third paragraph is why you’re applying. What do you like about the job or company you’re applying to? Any nice anecdotes about the company? After reading the last paragraph the recruiter should be curious. Why do you want to change jobs if you love it? What's so special about this company? &lt;strong&gt;What can you do for the company?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This is where you swing the bat and hit that ball out of the park. This is where you show your determination and undying love for the company. This is where the recruiter decides if you're different from the others.&lt;/p&gt;
&lt;p&gt;&lt;span id="_1egqt2p"&gt;&lt;/span&gt;“Waterstones has always been my favourite bookstore. I’ve collected over 11 stamp cards and try to go to Waterstones weekly to see what new books have been released. Sometimes I cannot help myself as a fellow book seller to rearrange books that have been misplaced or recommended books for your store based on the shelves. One such instance is a book titled “how to read water”; this book would have looked good next to The Cloud Collectors guide — a book on reading clouds”&lt;/p&gt;
&lt;h2 id="fourth-paragraph"&gt;Fourth Paragraph - How to End a Cover Letter&lt;/h2&gt;
&lt;p&gt;Fourth paragraph is the conclusion, where you wrap this all up. Reiterate why you want to work there and display that you are happy that you might have the opportunity to work there.&lt;/p&gt;
&lt;p&gt;“Your store is my favourite among the many Waterstones I have been to, and I’ve been to nearly all of them. I hope I have the opportunity to work at this fantastic store.&lt;/p&gt;
&lt;p&gt;I look forward to hearing back from you,&lt;/p&gt;
&lt;p&gt;&lt;span id="_2dlolyb"&gt;&lt;/span&gt;Brandon Skerritt”&lt;/p&gt;
&lt;p&gt;Another way to end this is:&lt;/p&gt;
&lt;p&gt;“Thank you for your time and consideration. I look forward to meeting with you to discuss my application further.&lt;/p&gt;
&lt;p&gt;Yours sincerely,&lt;/p&gt;
&lt;p&gt;&lt;span id="_sqyw64"&gt;&lt;/span&gt;Brandon Skerritt”&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;&lt;span id="_1rvwp1q"&gt;&lt;/span&gt;☐ Have you researched the company and you know what keywords to use?&lt;/p&gt;
&lt;p&gt;&lt;span id="_5225ueu5to2n"&gt;&lt;/span&gt;☐ Have you discussed what you can bring the company, not what the company can bring you?&lt;/p&gt;
&lt;p&gt;&lt;span id="_1un15tyjqrx5"&gt;&lt;/span&gt;☐ Have you customised it per job?&lt;/p&gt;
&lt;p&gt;&lt;span id="_9sc0aieyj89s"&gt;&lt;/span&gt;☐ Is your cover letter a PDF?&lt;/p&gt;
&lt;p&gt;&lt;span id="_ts1ag93is1n0"&gt;&lt;/span&gt;☐ Are you using active language (and not passive)?&lt;/p&gt;
&lt;p&gt;&lt;span id="_7i0kq3riiuh7"&gt;&lt;/span&gt;☐ Does the formality of the cover letter match the formality of the job?&lt;/p&gt;
&lt;p&gt;&lt;span id="_43jo0ik71hm6"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h1 id="chapter-3---personal-branding"&gt;Chapter 3 - Personal Branding&lt;/h1&gt;
&lt;p&gt;"What are you doing?"&lt;/p&gt;
&lt;p&gt;"I'm googling them" responded my friend with CVs strewn across her table.&lt;/p&gt;
&lt;p&gt;&lt;span id="_2r0uhxc"&gt;&lt;/span&gt;"This one’s bad" she stated with authority. The CV itself looked good enough for an interview but her research online showed she wasn't right for the job.&lt;/p&gt;
&lt;p&gt;One by one, she Googled them all. Education didn't matter, their experience - for the most part, didn't matter.&lt;/p&gt;
&lt;p&gt;Although this was a part-time waitressing job at a small local café, their online portrayal mattered. It mattered so much that people with amazing academical backgrounds and lots of experience were being tossed to the side.&lt;/p&gt;
&lt;p&gt;This is why personal branding is important. It is not only for the entrepreneurs out there but for every single person. Most people believe that personal branding doesn't affect them since they are not a celebrity. The truth is, everyone has a personal brand. It's up to you to decide when and how you'll take control of it. Your personal brand exists, whether you like it or not.&lt;/p&gt;
&lt;p&gt;A personal brand isn't makeup you're selling or being featured in magazines. It is everything about your public life. Your Twitter, Facebook, Instagram.&lt;/p&gt;
&lt;p&gt;You do not have to be an entrepreneur to care about your personal brand. When you apply for a job the recruiter will Google you. They'll want to know:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Does this person have a blog or website?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What does this person do in their spare time?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Any side projects?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Is there anything bad about them online?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you tick some of these boxes, you'll stand out from the rest.&lt;/p&gt;
&lt;p&gt;There is often a quote given out in running circles:&lt;/p&gt;
&lt;p&gt;“It's okay to run slowly. You're still running laps around the people sitting on the sofa.&lt;/p&gt;
&lt;p&gt;&lt;span id="_ji8e6sxieuat"&gt;&lt;/span&gt;The same can be said for a personal brand. It's okay if your personal brand doesn't have years of posts or tweets. It's okay if you only started today. You're still doing better than those who have not started.”&lt;/p&gt;
&lt;p&gt;Your personal brand will bring you more riches in life than any job you could have. When we work somewhere, we say that thing is us. "I am a lawyer" instead of "I practice law". "I am a programmer" instead of "I program at work".&lt;/p&gt;
&lt;p&gt;This way of thinking consumes your life. Your entire life rotates around this one job, this one title.&lt;/p&gt;
&lt;p&gt;This should not be the case. If you quit or you lose your job, then your title goes away. If your title goes away, your entire life crumbles.&lt;/p&gt;
&lt;p&gt;If you developed a personal brand and have friends and fans, then they will continue to be with you. It is a lot easier to switch jobs or find a new job when you have so many contacts on social media.&lt;/p&gt;
&lt;p&gt;As an example, you have have two people:&lt;/p&gt;
&lt;p&gt;Charlotte is a software engineer at Google. She regularly writes blog posts about software, goes to conferences, has a podcast. She does stuff outside of her job.&lt;/p&gt;
&lt;p&gt;Emily is another software engineer at Google. Emily's entire life is Google. She does not go to conferences, have a blog, or even cares about anything else. She is only a Googler.&lt;/p&gt;
&lt;p&gt;Both of these people are fired. Emily struggles to find a job having to apply to every company that has a position. Charlotte writes a quick tweet about it, it gets reshared a couple hundred of times and she has a new job before the weeks over.&lt;/p&gt;
&lt;p&gt;Your personal brand is like insurance for yourself and your job. Your personal brand, if you take it seriously, will transcend your career and will become your career.&lt;/p&gt;
&lt;h2 id="making-friends-not-connections"&gt;Making friends, not connections&lt;/h2&gt;
&lt;p&gt;Do not act like you only added someone on LinkedIn to increase your professional network. Try to become friends with them instead.&lt;/p&gt;
&lt;p&gt;A connection is just someone that acknowledges you exist at the best of times. Normally it’s when someone randomly connects with someone on LinkedIn to “increase their network”.&lt;/p&gt;
&lt;p&gt;Connections are meaningless. If you wanted a job at a company and you have a connection there, asking them to help you likely won’t work as they won’t know you.&lt;/p&gt;
&lt;p&gt;If you are friends with this person however, you are kind, generous and have helped them they are more likely to help you get the job.&lt;/p&gt;
&lt;p&gt;Friendships formed over social media are worth 100 times more than a simple connection to someone. This brings us into the second point, you need to care about them in order for them to care about you.&lt;/p&gt;
&lt;p&gt;One of the first rules of Dale Carnegie's book “How to win friends and influence people” states:&lt;/p&gt;
&lt;p&gt;&lt;span id="_3q5sasy"&gt;&lt;/span&gt;“Become genuinely interested in other people”&lt;/p&gt;
&lt;p&gt;If you don’t care about or celebrate someone's achievements, then when it is time for you to celebrate your achievements they likely won’t care.&lt;/p&gt;
&lt;p&gt;Not too long ago when I got into university, I posted about it on social media. No one cared because I didn’t care about their achievements. Now I regularly celebrate my friends’ achievements, small or big because I care about them and they celebrate mine.&lt;/p&gt;
&lt;p&gt;People will only care about you if you care about them. You need to make friends. Connecting with someone just isn’t enough anymore.&lt;/p&gt;
&lt;p&gt;We’re now in the thank you economy. You used to fake being big until you got big, now you have to be small; even if you are as big as Google. Do not pretend like your schedule is too big, treat the other person as a friend.&lt;/p&gt;
&lt;p&gt;Back in the day, you used to be able to fake being big. If you owned a company, you could play some background noise when on the phone to make it sound like you’re busy. Now we have public follower counts, you cannot fake being big. You need to be human.&lt;/p&gt;
&lt;h2 id="creating-content"&gt;Creating content&lt;/h2&gt;
&lt;p&gt;Content creation is the only way to build a personal brand. Whether that content is via tweets, Instagram points or blog posts.&lt;/p&gt;
&lt;p&gt;You are not going to make friends if you only ever like or retweet stuff. You need to produce content. Content is like seeds you plant in the ground. The more seeds you plant, the more likely they'll grow into a beautiful garden.&lt;/p&gt;
&lt;p&gt;The content does not have to be blog posts. It can be reviews, answers on Quora, open source software. As long as it is preferably free, online, and provides value to people it's good content.&lt;/p&gt;
&lt;p&gt;You may be able to get by without content creation if you are a big-name celebrity. Elon Musk rarely creates online content but is still famous. The likely chance of you not needing to create content online is slim.&lt;/p&gt;
&lt;p&gt;Content creation is what draws crowds, it’s what you can show your employer. People who look at your profile and see you are passionate about your cause will like you.&lt;/p&gt;
&lt;p&gt;The majority of your posts on social media should be about what you love. They should also show a side to you, have emotion in it. Nobody likes a re-posting Twitter bot.&lt;/p&gt;
&lt;p&gt;Your content has to be great content. Bad content is not good enough. If you have to take time to create good content instead of posting every day than do so. But great content always trumps mediocre content, even if the mediocre content is posted every day or even every hour.&lt;/p&gt;
&lt;h2 id="creating-content-from-other-content---the-pillars-of-content-creation"&gt;Creating content from other content - the pillars of content creation&lt;/h2&gt;
&lt;p&gt;This is a method that allows you to create a lot of content from one piece of content. You need to decide on your main content pillars. Let’s use YouTube or Medium (a blog) as an example.&lt;/p&gt;
&lt;p&gt;Once you’ve created this large piece of content, a large 5000-word article or a YouTube video you pick out things to repost to your relevant social media channels. Often your readers / watchers will point out the exact moments they loved about your content.&lt;/p&gt;
&lt;p&gt;On Medium, readers highlight what they loved about your article. On YouTube, watchers post video timestamps in your comments.&lt;/p&gt;
&lt;p&gt;Once you know what they loved, you can post this specific line or clip of a video to your relevant social media. With content creation, you don’t need to make content for every single platform. Focus on your main pillar of content creation, make that as best as you can. Using this strategy, you can create amazing content from amazing content without straining yourself.&lt;/p&gt;
&lt;h2 id="blogging"&gt;Blogging&lt;/h2&gt;
&lt;p&gt;Blogging is the easiest way to create a personal brand. You can write about anything on a blog. Most bloggers who care for their personal brand will write about their industry. It's a way to show employers that you are enthusiastic about the industry.&lt;/p&gt;
&lt;p&gt;Starting a blog is easy, the hardest part is knowing what to write. Read lots, look at the news and wait. Ideas will come to you. Even if you think the ideas are stupid or insignificant, they're still better than the people who don't have a blog.&lt;/p&gt;
&lt;p&gt;The platform doesn't matter as much - as long as you write. Medium.com is an amazing platform for getting your voice out there. Although it isn't the best to write on and you're restricted no other blogging platform provides as much value as Medium does.&lt;/p&gt;
&lt;p&gt;Many bloggers start out on Medium and move their way to another platform overtime.&lt;/p&gt;
&lt;p&gt;If you build an entire business or brand on someone else’s platform you don't get much control over what happens to your business. The platform could fail, it could die like Vine did.&lt;/p&gt;
&lt;p&gt;There isn’t much on blogging here, as you can find so much content on starting a blog online.&lt;/p&gt;
&lt;h2 id="github"&gt;GitHub&lt;/h2&gt;
&lt;p&gt;If you write code and you’re not on GitHub, what are you doing? GitHub is a social network with its core functionality being that it is a version control system. You upload code, and friends or fans can see your code.&lt;/p&gt;
&lt;h3 id="green-boxes"&gt;Green boxes&lt;/h3&gt;
&lt;p&gt;GitHub has a section on everyone’s profile called “contributions”. It has a number on top of the green boxes, that number is how many contributions you have made in the last year. Every single day on GitHub, you get a new box. If you contribute on that day, you get a green box. The more contributions on a day, the darker the shade of green.&lt;/p&gt;
&lt;p&gt;A contribution is defined as doing something. You upload some code, you edit some code, you write some documentation. You leave comments on bugs software has. You create “issues” which are reports of bugs you have encountered on other people’s code.&lt;/p&gt;
&lt;p&gt;The more you interact and support the open source community, the more green boxes you get. The more green boxes, the more it looks like you’re passionate about coding.&lt;/p&gt;
&lt;h3 id="bio"&gt;Bio&lt;/h3&gt;
&lt;p&gt;Nothing special here. Just copy and paste the bio you use on Twitter / Instagram here.&lt;/p&gt;
&lt;h3 id="stars"&gt;Stars&lt;/h3&gt;
&lt;p&gt;Think of stars as likes. You can star a project you find interesting and others can see them.&lt;/p&gt;
&lt;h3 id="repositories"&gt;Repositories&lt;/h3&gt;
&lt;p&gt;Repositories are projects of code. If you’ve created a cool coding project, create a repository for it.&lt;/p&gt;
&lt;h2 id="facebook"&gt;Facebook&lt;/h2&gt;
&lt;p&gt;There’s no point in me trying to explain what Facebook is, you already know.&lt;/p&gt;
&lt;h3 id="facebook-groups"&gt;Facebook Groups&lt;/h3&gt;
&lt;p&gt;Facebook groups are just like LinkedIn groups (discussed later). Find groups that interest you. There are groups for Women in Tech, LGBT+ groups, People of Colour and more. Find professional groups that appeal to you and join them.&lt;/p&gt;
&lt;p&gt;I’ve seen hackathons advertised where winners get a guaranteed interview at Apple in Facebook tech groups before, so it’s worth joining Facebook groups just in case.&lt;/p&gt;
&lt;h3 id="facebook-targeted-adverts"&gt;Facebook Targeted adverts&lt;/h3&gt;
&lt;p&gt;I have friends that &lt;strong&gt;love&lt;/strong&gt; their Facebook adverts. If you go to a lot of tech events, read a lot on tech and regularly interact with the tech world - you’ll get adverts targeted at you. Some of these adverts are useful. Some of them could be hackathons, or events you can go to. Whenever you see an advert that is useful to you, click “see more of this” to let Facebook know that this is relevant to you.&lt;/p&gt;
&lt;p&gt;The idea is to get adverts that can directly improve your life.&lt;/p&gt;
&lt;h3 id="following-influencers"&gt;Following Influencers&lt;/h3&gt;
&lt;p&gt;Just like you can follow Richard Branson on Twitter, you can also follow him on Facebook. Follow as many influencers in your field as possible and interact with them or with people in the comments.&lt;/p&gt;
&lt;h3 id="facebook-stories"&gt;Facebook stories&lt;/h3&gt;
&lt;p&gt;Facebook stories is another way you can build your personal brand. Not many people use Facebook stories, so when you do use it, you’ll stand out amongst your peers. Facebook groups also have a story function, so you can post stories to Facebook groups.&lt;/p&gt;
&lt;h3 id="community-facebook-pages"&gt;Community Facebook pages&lt;/h3&gt;
&lt;p&gt;Make sure to follow &amp;amp; like Facebook pages that interest you. Be aware that others can see what pages you have liked, so don’t go liking anything too silly that may jeopardise your future career.&lt;/p&gt;
&lt;h3 id="facebook-events"&gt;Facebook events&lt;/h3&gt;
&lt;p&gt;Facebook events are ways to find out about events happening near you. From society's or companies posting events, you could find an event for anything.&lt;/p&gt;
&lt;p&gt;Facebook will also display “related” events in the sidebar. If you find an event you like make sure to check out related events.&lt;/p&gt;
&lt;p&gt;Lastly, there is a wealth of information out there about upcoming tech events. Companies are trying to get their events known and get more personal with their potential customers and attendees. Hackathons and workshops are very frequently posted on Facebook too, so keep an eye out for events by looking at posts in Facebook groups, and using the Facebook search bar.&lt;/p&gt;
&lt;p&gt;On top of that, to see even more you might be interested in, look at the Related Events in the sidebar.&lt;/p&gt;
&lt;h3 id="url"&gt;URL&lt;/h3&gt;
&lt;p&gt;This is the first thing you will want to do to brand yourself, a vanity URL is your customised domain on Facebook. Instead of facebook.com/e2434h394oij you can get facebook.com/joeshmoe. Go to the Customized URL page on Facebook and set yours now. If you can’t find out how to do it, just Google “Facebook customised URL”. I’m not including instructions here, in case they change it after I’ve published this.&lt;/p&gt;
&lt;h3 id="photo"&gt;Photo&lt;/h3&gt;
&lt;p&gt;Upload the same one you use on LinkedIn. Some people will disagree with me on this and say that you should give visitors a unique Facebook experience – this is fine, just as long as it’s not harmful to your brand.&lt;/p&gt;
&lt;p&gt;As a rule, I would say the picture should be related to what type of person you are, being an authentic representation of your personal brand. If you are on the summit of Kilimanjaro in your profile picture, you had better be into your mountaineering in other words.&lt;/p&gt;
&lt;h2 id="twitter"&gt;Twitter&lt;/h2&gt;
&lt;p&gt;Twitter is a microblogging platform allowing users to upload "tweets" which are 280 characters long. The user can comment on, like, or retweet a tweet.&lt;/p&gt;
&lt;h3 id="handle"&gt;Handle&lt;/h3&gt;
&lt;p&gt;You need to have a professional Twitter handle. This is often your name such as: "&lt;a class="mentioned-user" href="https://dev.to/brandonskerritt"&gt;@brandonskerritt&lt;/a&gt;" or @brandon_skerritt".&lt;/p&gt;
&lt;p&gt;If someone else is using a Twitter handle you want and they're not using it (no tweets or activity), then you can submit a request to get that handle.&lt;/p&gt;
&lt;p&gt;To do this, you need to have your own domain and email address. Let's say you want the handle "@skerritt". To claim this handle, you need to own an email address, such as: brandon@skerritt.tech and own a website or domain similar to skerritt.com.&lt;/p&gt;
&lt;p&gt;Once you own those, you can file for impersonation on the Twitter handle you want. To get a customised email, just Google it.&lt;/p&gt;
&lt;h3 id="twitter-engagement"&gt;Twitter Engagement&lt;/h3&gt;
&lt;p&gt;Your Twitter engagement score is a key performance indicator (KPI) of how a tweet has performed.&lt;/p&gt;
&lt;p&gt;Twitter engagement is calculated using:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Likes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Retweets&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Replies&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mentions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Follows&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Profile clicks&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Permalink clicks&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tweet expansion clicks&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Link clicks&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In short: It's a popularity score for each of your tweets.&lt;/p&gt;
&lt;p&gt;Here are some statistics directly from Twitter &lt;sup&gt;6&lt;/sup&gt;on how to improve your engagement:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Photos average a 35% boost in Retweets&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Videos get a 28% boost&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Quotes get a 19% boost in Retweets&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Including a number receives a 17% bump in Retweets&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hashtags receive a 16% boost&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Twitter polls are a good way to gain engagement. Most people want to find out the result of a poll, so they'll vote on it just to see the result.&lt;/p&gt;
&lt;h3 id="getting-people-to-care-about-you"&gt;Getting people to care about you&lt;/h3&gt;
&lt;p&gt;Know what industry you’re in. Find a hashtag that relates to this industry. If you’re a programmer, #100daysofcode is a good hashtag.&lt;/p&gt;
&lt;p&gt;If you don’t know of any hashtags, just search your industry and see what hashtags others are using.&lt;/p&gt;
&lt;p&gt;Once you’ve found a hashtag, interact with people. Congratulate people, answer questions they may have, just talk to them. Do this, day in and day out and you’ll eventually get more followers who care about your content.&lt;/p&gt;
&lt;p&gt;Another way to do this is to post content that helps others. If you help someone through your content, they will want to follow you as you could help them even more.&lt;/p&gt;
&lt;p&gt;Reply to every mention you get, and any tweets that you can relate to.&lt;/p&gt;
&lt;p&gt;Twitter's new feed is non-chronological. An algorithm selects what tweets a user may want to see, even if they don't want to see that tweet. The more you interact with a user, the more likely your tweets will appear in their feed.&lt;/p&gt;
&lt;h3 id="to-tweet-or-not-to-tweet"&gt;To tweet or not to tweet&lt;/h3&gt;
&lt;p&gt;Like any social network, Twitter rewards users who engage with other users. You need to reply to, like, and retweet other user.&lt;/p&gt;
&lt;p&gt;If you don't, Twitter won't show your tweets to people.&lt;/p&gt;
&lt;h3 id="twitter-spam-rules"&gt;Twitter Spam Rules&lt;/h3&gt;
&lt;p&gt;Twitter is incredibly strict with spammers. If you spam follow, like or retweet Twitter won’t show your tweets to many people.&lt;/p&gt;
&lt;p&gt;In fact, Twitter’s rules are so strict that you could get flagged for spamming even if you don’t mean to spam. If you like, follow, or retweet too much in a certain time period - you’re classed as a spammer. The exact rules and timing of the spam rules aren’t available to the public as spammers could use them to their advantage. Just be extremely careful when interacting with many people on Twitter.&lt;/p&gt;
&lt;h2 id="instagram"&gt;Instagram&lt;/h2&gt;
&lt;p&gt;Instagram is a social network for sharing photos. I’m not going over how to take good photos, since there are millions of photography guides available on the web.&lt;/p&gt;
&lt;h3 id="knowing-if-your-instagram-will-grow-or-not"&gt;Knowing if your Instagram will grow or not&lt;/h3&gt;
&lt;p&gt;Sometimes, it can feel like a lottery. Will your Instagram grow ridiculously large after 3 months? Or will it not grow at all for many months. There are a few tell-tale signs to watch out for.&lt;/p&gt;
&lt;h4 id="the-number-of-instagrammers-in-your-niche"&gt;The number of instagrammers in your niche&lt;/h4&gt;
&lt;p&gt;How many other Instagram accounts are creating &amp;amp; talking about the content like you are? The more there is, the harder it is for you to penetrate this community. Think about your niche, what are you targeting? Search Instagram for other accounts in this niche and see whether or not it’ll be harder for you to grow here.&lt;/p&gt;
&lt;p&gt;You can measure how many people are in a niche from hashtags. This method isn’t perfect, but it’s the best we have. Search your niche like “#Yoga” and see how many posts are under that hashtag. #Yoga has 60 million posts, so it’s a very hard community to penetrate into and grow.&lt;/p&gt;
&lt;p&gt;If you search ‘#BuildUpDevs’ you’ll find out this hashtag has a small amount of posts in it, but it’s still an active hashtag. This is an easy hashtag to penetrate into.&lt;/p&gt;
&lt;h4 id="how-unique-your-instagram-account-is"&gt;How unique your Instagram account is&lt;/h4&gt;
&lt;p&gt;The uniqueness of your account within its content category has a direct correlation with the likelihood of growing an engaged audience fast. How are you going to make your account different from all of the other accounts in your niche?&lt;/p&gt;
&lt;p&gt;Your unique selling point could be that you post the most visually appealing photos, or you include dogs in your photos. You have to be unique, so you can grow in your chosen niche.&lt;/p&gt;
&lt;p&gt;No one wants to follow another account that just posts the same images as everyone else does. You need to be unique, stand out and attract attention.&lt;/p&gt;
&lt;h3 id="picking-your-niche"&gt;Picking your niche&lt;/h3&gt;
&lt;p&gt;The simplest way to pick your niche is to just pick something that makes you happy to look at. That’s it. Just being happy is all that matters.&lt;/p&gt;
&lt;p&gt;You may choose to pick a niche that relates to the area you want to work in the future. As a computer scientist, I post about coding on Instagram.&lt;/p&gt;
&lt;p&gt;As a general rule, the more specific your niche is the more potential you have to grow. Remember there has to be a want for your niche. Dogs in cute jumpers is an example of a specific niche that has a large demand.&lt;/p&gt;
&lt;h3 id="when-to-post"&gt;When to post&lt;/h3&gt;
&lt;p&gt;Knowing when to post is unique per Instagram account. If you’re running a business and want extremely high growth, you may be posting up to 5 or 7 times a day. You should experiment to see how many posts you should post per day.&lt;/p&gt;
&lt;p&gt;Start out posting once on 3 separate days in a week. Then go up to 5, then up to 7. Try posting X per week, record how many followers you gain. Do this for a couple of weeks until you find out how many posts your niche wants. I try to post daily in my coding Instagram.&lt;/p&gt;
&lt;h3 id="hashtags"&gt;Hashtags&lt;/h3&gt;
&lt;p&gt;Hashtags are what gets you noticed in the community. Hashtagging is important and vital for your instagram posts. On Instagram, you have communities. These communities communicate and are built around hashtags. In order to join a community, you need to post regularly to hashtags and follow those who also post to those hashtags.&lt;/p&gt;
&lt;p&gt;Users can now follow hashtags, so they can see your posts in that hashtag even if they don’t follow you. Hashtags can also be featured in Instagram stories, to get your story seen by people who follow that hashtag.&lt;/p&gt;
&lt;p&gt;You can add hashtags to your profile’s bio. You’ll appear in searches for the hashtags you select. It’s a good idea to use hashtags in your bio to attract a larger audience.&lt;/p&gt;
&lt;p&gt;The easiest way to get the best hashtags for your niche is to find top posters in that niche and copy their hashtags. They’ve done all the hard work for you - by finding the hashtags that work.&lt;/p&gt;
&lt;p&gt;One of the problems with this approach is that the larger accounts already have a large following - whereas you’re just starting out. Let’s assume the poster with the large account is posting in #Yoga, with 16 million posts in it. This poster has 20,000 followers - so when their fans see the photo, they like it. This boosts it through the other posts in #yoga and makes it appear at the top - where it gets more likes.&lt;/p&gt;
&lt;p&gt;If someone with little to no followers tried to post under #Yoga, their photo would be lost in the hundreds of photos posted to that hashtag every day.&lt;/p&gt;
&lt;p&gt;When starting out, you want a mix of popular hashtags and not so popular hashtags. You want those popular, big hashtags so just in case your photo blows up it can blow up more. You want those smaller hashtags, so others can find you. You’re allowed a maximum of 30 hashtags, so 25 of those should be smaller and 5 should be larger.&lt;/p&gt;
&lt;p&gt;The smaller hashtags have to actually exist. You can’t just make your own hashtags, as no one will discover them. Once you become a bigger account you may choose to make your own hashtags.&lt;/p&gt;
&lt;p&gt;The easiest way to find smaller hashtags is to look for smaller creators in your niche and check through the hashtags they use. Knowing what hashtags are “small” and which are “big” depends entirely on the niche, only you can decide that.&lt;/p&gt;
&lt;p&gt;When you search a hashtag, Instagram will show you related hashtags to the hashtag you have searched. Click through these and see if you can find any good hashtags you can include in your posts.&lt;/p&gt;
&lt;p&gt;When I started my own coding Instagram, I copied someone else’s hashtags and pasted them into my notes app. Now I just copy and paste every time I post something.&lt;/p&gt;
&lt;p&gt;When posting hashtags, it’s better to include them in a comment on your post rather than having them in the description of the post. This makes it look cleaner. When posting in a comment, write 5 full stops:&lt;/p&gt;
&lt;p&gt;“&lt;/p&gt;
&lt;p&gt;.&lt;/p&gt;
&lt;p&gt;.&lt;/p&gt;
&lt;p&gt;.&lt;/p&gt;
&lt;p&gt;.&lt;/p&gt;
&lt;p&gt;.&lt;/p&gt;
&lt;p&gt;#hashtags #go #here&lt;/p&gt;
&lt;p&gt;“&lt;/p&gt;
&lt;p&gt;This will make your hashtags hidden in a comment, so the post looks cleaner overall.&lt;/p&gt;
&lt;h3 id="interactions"&gt;Interactions&lt;/h3&gt;
&lt;p&gt;You should see by now that the most important aspect of social media is to be social. Reply to every comment you get, talk to people. Be sociable. These apps reward people for using them. They want you to be social. Make the algorithm work for you by being sociable and interacting with others.&lt;/p&gt;
&lt;h3 id="tagging-reposters"&gt;Tagging reposters&lt;/h3&gt;
&lt;p&gt;Reposters are some of the biggest players in the Instagram game. You tag them in a photo related to the niche, and they repost it. They give you credit, and you get hundreds of thousands of follows / likes / comments.&lt;/p&gt;
&lt;p&gt;Usually the biggest posters in a hashtag are reposters. Click on a post. Are they giving credit, like “Photo by &lt;a class="mentioned-user" href="https://dev.to/brandon"&gt;@brandon&lt;/a&gt;.codes”? If the profile is not of a person, they might be a reposter.&lt;/p&gt;
&lt;p&gt;When you tag a reposting account in your posts, you have the chance of being reposted. These reposting accounts are usually the biggest in the niche, so your post will be seen by thousands of followers. This increases your own visibility and will enable you to get a larger follower.&lt;/p&gt;
&lt;h3 id="location"&gt;Location&lt;/h3&gt;
&lt;p&gt;As well as tagging your photos with hashtags &amp;amp; people, you can also tag your photos with a location. Just like with hashtags, each location has its own Instagram feed. It’s worth tagging your photos with a location, simply because it puts you in one more feed.&lt;/p&gt;
&lt;h3 id="grid-visuals"&gt;Grid Visuals&lt;/h3&gt;
&lt;p&gt;How your grid looks is important to your brand. Your grid has to be consistent, neat, and aesthetically pleasing. People will follow you if you keep a consistent theme in your grids. Here are some simple grid systems you can use.&lt;/p&gt;
&lt;h4 id="normal"&gt;Normal&lt;/h4&gt;
&lt;p&gt;Just post the same type of content - without worrying how it looks in the bigger picture. Stick to the same colour combination and the same theme, you’ll do well.&lt;/p&gt;
&lt;h4 id="diagonals"&gt;Diagonals&lt;/h4&gt;
&lt;p&gt;With diagonals, you’re aiming to match the same type of photo diagonally. Think Connect Four, but with photos. With diagonal photos you should stick to the same overall niche, such as “Yellow” or “Coffee” but each diagonal should be different from the other diagonals. One diagonal could be yellow cars, another could be yellow coats.&lt;/p&gt;
&lt;h4 id="tiles"&gt;Tiles&lt;/h4&gt;
&lt;p&gt;Much like a black &amp;amp; white tiled floor, you’ll want to tile your photos here. Your tiles need to look different in order for the effect to take place.&lt;/p&gt;
&lt;h4 id="row-by-row"&gt;Row by row&lt;/h4&gt;
&lt;p&gt;Every row has its own unique style. Much like diagonal, each row has to differentiate itself from the others.&lt;/p&gt;
&lt;h4 id="lines"&gt;Lines&lt;/h4&gt;
&lt;p&gt;You can place a column of photos down the middle that all follow a theme, or down one of the sides.&lt;/p&gt;
&lt;h4 id="rainbow-feeds"&gt;Rainbow feeds&lt;/h4&gt;
&lt;p&gt;The colour of your feed gradually changes over time - giving the impression of a rainbow. This is quite hard to pull off, but it makes your feed look amazing.&lt;/p&gt;
&lt;h4 id="borders"&gt;Borders&lt;/h4&gt;
&lt;p&gt;Having white borders around your photos can give more space in the feed to each item, making it look that much cooler.&lt;/p&gt;
&lt;h3 id="following-hashtags-to-get-more-followers"&gt;Following hashtags to get more followers&lt;/h3&gt;
&lt;p&gt;From December 2017, you can now follow hashtags. This is monumental, since you can see the posts of people you don’t follow in your Instagram feed. Follow as many hashtags as you can and engage with everyone on Instagram. The more you engage, the more you’ll grow.&lt;/p&gt;
&lt;h3 id="creating-unique-content-series"&gt;Creating unique content &amp;amp; series&lt;/h3&gt;
&lt;p&gt;In order to stand out, you may wish to create a unique series of content. My friend, Sasha, has a weekly Instagram stories series called “Colour Tuesday”. Every Tuesday, people send her their favourite colours and she posts them into her story.&lt;/p&gt;
&lt;p&gt;This interaction with her fan base strengthens their liking for her. When Instagram sees all these hundreds of people interacting with her, they reward her by putting her posts higher up in the Instagram feed.&lt;/p&gt;
&lt;p&gt;You can interact with your followers via polls, question &amp;amp; answer sessions, live sessions and much, much more. Instagram is adding more features to enable users to interact more. If you interact more, the more Instagram will like you.&lt;/p&gt;
&lt;p&gt;&lt;span id="_2koq656"&gt;&lt;/span&gt;One of the series I have started recently is mini-blogs on topics that my followers suggest to me. They tell me to cover something, like the Turing Completeness of PowerPoint. Ok, I admit, this sounds boring. I can hear your eyes closing as I write this. But I’m a computer scientist, this is what people find fun in my field.&lt;/p&gt;
&lt;h2 id="linkedin"&gt;LinkedIn&lt;/h2&gt;
&lt;p&gt;LinkedIn is a social network for professionals. It's built for anybody and everybody that wants to become more professional. You can think of LinkedIn as the virtual version of going to a careers fair. You'll be able to meet lots of people, make connections &amp;amp; friends and more on LinkedIn.&lt;/p&gt;
&lt;p&gt;Your LinkedIn profile is like a general CV. Your CV is customised per job &amp;amp; position, your LinkedIn is generalised.&lt;/p&gt;
&lt;h3 id="keep-your-profile-updated"&gt;Keep your profile updated&lt;/h3&gt;
&lt;p&gt;This is a general rule for all social media. It's important to keep your profile updated. Whenever you get a new job or anything else professionally related, update your profile. If you do something cool, update your network.&lt;/p&gt;
&lt;h3 id="the-headline"&gt;The headline&lt;/h3&gt;
&lt;p&gt;The headline is the first thing someone sees when they see you on LinkedIn. At minimum, the headline should be your current job and company.&lt;/p&gt;
&lt;p&gt;The headline has a 120-character maximum. Your headline helps people find you. When someone searches you in LinkedIn search, they get your profile picture, your name and your headline.&lt;/p&gt;
&lt;p&gt;Most people on LinkedIn just have their job title(s) as the headline, but you should add much more to it. You can include your expertise, any awards you've won. Even include keywords in your header that you want to come up for in LinkedIn search.&lt;/p&gt;
&lt;p&gt;You can include things such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Who you help&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What you do&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What you’re passionate about&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Proof that you are credible (PhD, awards etc)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span id="_4iylrwe"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;If someone searches "freelance graphic designer" on LinkedIn and that's your headline, you'll appear in the search.&lt;/p&gt;
&lt;p&gt;Instead of having:&lt;/p&gt;
&lt;p&gt;&lt;span id="_2y3w247"&gt;&lt;/span&gt;“Student”&lt;/p&gt;
&lt;p&gt;As your headline, you can instead have:&lt;/p&gt;
&lt;p&gt;&lt;span id="_1d96cc0"&gt;&lt;/span&gt;“Student specialising in mental health applications of VR”&lt;/p&gt;
&lt;p&gt;You need to be creative. Don’t be cliché. Don’t have a headline like this:&lt;/p&gt;
&lt;p&gt;&lt;span id="_3x8tuzt"&gt;&lt;/span&gt;“Student of life, school of hard knocks”&lt;/p&gt;
&lt;h3 id="the-photo"&gt;The photo&lt;/h3&gt;
&lt;p&gt;LinkedIn profiles which have a picture are 11 times more likely to be viewed, according to LinkedIn.&lt;/p&gt;
&lt;p&gt;Your LinkedIn picture should be recent, and it should look professional. It shouldn't be you in a nightclub or your Tinder profile picture. If you can, pay someone to take it for you. Do you know any photography students? Kindly ask them if they could take a photo of you.&lt;/p&gt;
&lt;p&gt;It should be an ordinary, professional headshot of yourself. Another good tip is to have a photo of you doing something as your LinkedIn profile. If you're a VR specialist, you in a VR headshet would work. You still need to look professional. Look ahead and smile.&lt;/p&gt;
&lt;p&gt;If your industry doesn’t wear suits (technology), then don’t wear a suit in your profile picture.&lt;/p&gt;
&lt;p&gt;The background of your photo matters a lot. It should be minimalistic, nothing going on in the background. Preferably a white background would be perfect.&lt;/p&gt;
&lt;p&gt;Make sure to use the same profile picture across all of your professional social media. Your brand recognition matters. You don’t want people searching for you on Twitter and getting confused as to whether it’s really you or not.&lt;/p&gt;
&lt;p&gt;Try to name the photo file “Firstname.Lastname.png”. Search engine optimisation means that you want to optimise your online presence to appear higher in search engines (Google) results. By naming your profile picture to this, you’ll appear higher in search engine results for your name.&lt;/p&gt;
&lt;p&gt;You’ll also only want to use the .png file extension. The .jpeg or .jpg is a compressed version of .png, meaning it won’t look as good. Try to only take pictures on .png. If you have taken pictures on your phone or a camera, it’s likely that this file is a .png file. If your photo name ends in .png, it’s a png.&lt;/p&gt;
&lt;h3 id="the-profile-cover-photo"&gt;The profile cover photo&lt;/h3&gt;
&lt;p&gt;The background picture also needs to be professional. It can be you speaking to an audience or some code you've written. It should be clean and professional. If you've never done this than any photos of you at an event you've been to related to the industry will do.&lt;/p&gt;
&lt;p&gt;If you’re still stuck, pick a nice landscape photo or something.&lt;/p&gt;
&lt;h3 id="summary"&gt;Summary&lt;/h3&gt;
&lt;p&gt;This is vital to your LinkedIn. The summary is a paragraph section about you. It includes your professional summary, any hopes or aspirations you have in your career.&lt;/p&gt;
&lt;p&gt;Before you write your summary, it's important to understand these things:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Who your audience is&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What do you want them to know?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Your summary should be general enough to cover any job you may apply to but specific enough to let you appear in search results. If you want to include bullet points in your summary, Google “Ascii bullet point” then copy and paste it, it’ll look like this “•”.&lt;/p&gt;
&lt;p&gt;To appear in search results, you must utilise keywords. Understand what industry you want to go into and Google the keywords relevant to that industry.&lt;/p&gt;
&lt;p&gt;You can also find keywords from job postings.&lt;/p&gt;
&lt;p&gt;On mobile, the first 92 characters of your LinkedIn summary are visible. For the user to see the rest they must click "show more". This means that the first 92 characters matter the most, make sure every character counts.&lt;/p&gt;
&lt;p&gt;Also, write in first person. It’s creepy and weird to read something that says:&lt;/p&gt;
&lt;p&gt;&lt;span id="_1qoc8b1"&gt;&lt;/span&gt;“Brandon is a creative genius who loves ice cream”&lt;/p&gt;
&lt;p&gt;On someone's profile, when you know for a fact, they’ve written it themselves.&lt;/p&gt;
&lt;p&gt;Your summary is going to let you expand on your headline, what problems you solve and why you love doing it. It should be a story and if possible, it should prove your credentials. If you claim to be knowledgeable in macroeconomics, why are you knowledgeable?&lt;/p&gt;
&lt;p&gt;If you can, include a call to action. A call to action is you calling the user to take action on something. In your LinkedIn profile, this action is typically to connect with you. Give them a reason to connect and tell them to connect with you.&lt;/p&gt;
&lt;h3 id="spellcheck"&gt;Spellcheck&lt;/h3&gt;
&lt;p&gt;This shouldn’t be said, but just in case, everything needs to be spell checked.&lt;/p&gt;
&lt;h3 id="own-a-business-or-brand-check-out-this-cool-trick"&gt;Own a business or brand? Check out this cool trick&lt;/h3&gt;
&lt;p&gt;Under your Contact Info, LinkedIn gives you the option to link to a website or blog. But by default, the text that shows in your profile is the extremely dull "Blog" or "Website." Anyone visiting your profile has no clue where they'll end up if they click on that.&lt;/p&gt;
&lt;p&gt;Want to use your actual brand or business name? You can! Here's a simple little trick.&lt;/p&gt;
&lt;p&gt;When editing the Websites area of your profile, select the "Other" option. Now you can add your own website title and URL.&lt;/p&gt;
&lt;h3 id="personalise-your-url"&gt;Personalise your URL&lt;/h3&gt;
&lt;p&gt;Not many people know this, but you can personalise your URL on LinkedIn to a vanity URL. Instead of pointing to LinkedIn/In/3857239 you can make it point to LinkedIn/In/FirstnameLastname instead. Here’s instructions directly from LinkedIn on how to do this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Click the &lt;em&gt;Me&lt;/em&gt; icon at the top of your LinkedIn homepage.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;em&gt;View profile&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On your profile page, click &lt;em&gt;Edit public profile &amp;amp; URL&lt;/em&gt; on the right rail.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Under &lt;em&gt;Edit URL&lt;/em&gt; in the right rail, click the &lt;em&gt;Edit&lt;/em&gt; icon next to your public profile URL.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It'll be an address that looks like &lt;em&gt;www.linkedin.com/in/yourname-numbers&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Type the last part of your new custom URL in the text box.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;em&gt;Save&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Note: these instructions might have changed since the publication of this book.&lt;/p&gt;
&lt;h3 id="sections"&gt;Sections&lt;/h3&gt;
&lt;p&gt;You can create sections in LinkedIn. We’re going to go over all of the sections available to you.&lt;/p&gt;
&lt;h4 id="experience"&gt;Experience&lt;/h4&gt;
&lt;p&gt;The experience section is a reverse-chronological listing of all of your professional experience. Typically, this will include jobs or work experience you have undertaken.&lt;/p&gt;
&lt;p&gt;You’ll want to have descriptive job titles here in order to let any recruiters know exactly what you were doing. Keywords are always the key. If you include keywords in your job descriptions, you’ll appear higher in search results (SEO).&lt;/p&gt;
&lt;p&gt;If you have done an internship at Barclays learning about investing, instead of having:&lt;/p&gt;
&lt;p&gt;&lt;span id="_j8sehv"&gt;&lt;/span&gt;“Internship at Barclays”&lt;/p&gt;
&lt;p&gt;You should put:&lt;/p&gt;
&lt;p&gt;&lt;span id="_338fx5o"&gt;&lt;/span&gt;“Investment analyst internship at Barclays”&lt;/p&gt;
&lt;p&gt;&lt;span id="_1idq7dh"&gt;&lt;/span&gt;Like with a CV, we’ll want to include achievements in your descriptions of the job. Include any testimonials here, if you have them, and any promotions you have received in the description of your experience.&lt;/p&gt;
&lt;h4 id="education"&gt;Education&lt;/h4&gt;
&lt;p&gt;LinkedIn has a 2000-word count on your education here, so go wild if you want. Include your achievements, modules, activities &amp;amp; societies and anything else you can think of. You can also include “media” which lets people see a media attachment related to this education. With permission of my lecturers, I’ve included PowerPoints I’ve given.&lt;/p&gt;
&lt;p&gt;The media attachments will let anyone look at your work, if they care. In reality it’s incredibly unlikely that someone will look at your work, but it makes your education stand out since LinkedIn gives you a pretty “Media” section on your education.&lt;/p&gt;
&lt;p&gt;Here’s my own example of my education section:&lt;/p&gt;
&lt;p&gt;“&lt;em&gt;Activities and Societies: Duke of Edinburgh Gold, Free Code Camp Kent, Body Combat&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Modules:&lt;/p&gt;
&lt;p&gt;Unit 1 - Business Skills for e-Commerce (core module) - Level 4 (15 credits)&lt;/p&gt;
&lt;p&gt;Unit 2 - Computer Systems (core module) - Level 4 (15 credits)&lt;/p&gt;
&lt;p&gt;Unit 3 - Employability and Professional Development (core module) - Level 4 (15 credits)&lt;/p&gt;
&lt;p&gt;Unit 7 - Research Skills - Level 4 (15 credits)&lt;/p&gt;
&lt;p&gt;Unit 14 - Website Design - Level 4 (15 credits)&lt;/p&gt;
&lt;p&gt;Unit 19 - Object Oriented Programming - Level 4 (15 credits)&lt;/p&gt;
&lt;p&gt;Unit 23 - Mathematics for Software Developers - Level 4 (15 credits)&lt;/p&gt;
&lt;p&gt;Unit 24 - Networking Technologies - Level 4 (15 credits)&lt;/p&gt;
&lt;p&gt;As well as studying for the MTA certification scheme.&lt;/p&gt;
&lt;p&gt;Alongside this, I am also undertaking Gold DofE&lt;/p&gt;
&lt;p&gt;Achievements while here:&lt;/p&gt;
&lt;p&gt;100% in mock interview for University with University of Kent&lt;/p&gt;
&lt;p&gt;Amazon Web Services award at the University of Nottingham's hackathon, HackNotts 2016, representing my college. http://bit.ly/2lo7NGO&lt;/p&gt;
&lt;p&gt;Passport to Employment, twice.&lt;/p&gt;
&lt;p&gt;&lt;span id="_2hio093"&gt;&lt;/span&gt;60% increase in student voice representation”&lt;/p&gt;
&lt;h4 id="section-2"&gt;&lt;/h4&gt;
&lt;h4 id="volunteer-experience"&gt;Volunteer experience&lt;/h4&gt;
&lt;p&gt;This section is designed the exact same way that experience is, except your volunteer experience goes here. There isn’t much to say here, since most of it was covered in the previous section.&lt;/p&gt;
&lt;h4 id="skills-endorsements"&gt;Skills &amp;amp; Endorsements&lt;/h4&gt;
&lt;p&gt;In this section, you list skills you have, and your connections can endorse you for those skills. As an example, you could list “writing” as a skill and have 13 connections confirm that you’re a good writer.&lt;/p&gt;
&lt;p&gt;You can physically move these skills up and down the list. I recommend having the most in-demand skills or most impressive skills at the top, to catch the eye of your employer.&lt;/p&gt;
&lt;p&gt;Don’t try to have the same skill but worded differently. For example, you could have these skills:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Microsoft Office&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;PowerPoint&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Word&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Excel&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;But Microsoft Office covers them all. You’re only allowed 30 skills, use them wisely.&lt;/p&gt;
&lt;p&gt;To get your connections to endorse you for skills, simply endorse them. Going back to what we said earlier, if you want people to care you need to care about them. If you want endorsements, you need to endorse them.&lt;/p&gt;
&lt;p&gt;Another way to get endorsements is to ask for them. Create a message, copy and paste it to people you know on LinkedIn. Very few people actively use LinkedIn, so this is a good way to get endorsements.&lt;/p&gt;
&lt;p&gt;While a little spammy, it works.&lt;/p&gt;
&lt;h4 id="recommendations"&gt;Recommendations&lt;/h4&gt;
&lt;p&gt;People will write you recommendations, and you can write other recommendations. These are testimonials that someone knows you and they think you’re good. It’s usually a short paragraph or two of why you are amazing.&lt;/p&gt;
&lt;p&gt;Some recruiters don’t like recommendations so much, since it’s very much a case of you writing one for your friends and they write one for you.&lt;/p&gt;
&lt;p&gt;The key to getting recommendations is the same as getting endorsements, you write one for them and they’ll write one for you. You can also request a recommendation from people by following these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Click the &lt;em&gt;Me&lt;/em&gt; icon at the top of your LinkedIn homepage.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select &lt;em&gt;View profile&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scroll down to the &lt;em&gt;Recommendations&lt;/em&gt; section and click &lt;em&gt;Ask to be recommended&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Type the name of the connection you'd like to ask for a recommendation in the &lt;em&gt;Who do you want to ask?&lt;/em&gt; field.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select the name from the dropdown that appears.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Fill out the &lt;em&gt;Relationship&lt;/em&gt; and &lt;em&gt;Position at the time&lt;/em&gt; fields of the recommendations pop-up window and click &lt;em&gt;Next&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can include a personalized message with your request by changing the text in the message field.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;em&gt;Send&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id="accomplishments"&gt;Accomplishments&lt;/h4&gt;
&lt;p&gt;This is a whole section dedicated to your accomplishments. We’re going to go over each sub-section here.&lt;/p&gt;
&lt;h5 id="languages"&gt;Languages&lt;/h5&gt;
&lt;p&gt;This is simple, what languages do you know? If you’re a computer programmer, you can include programming languages here too. Nothing so special here.&lt;/p&gt;
&lt;h5 id="qualifications"&gt;Qualifications&lt;/h5&gt;
&lt;p&gt;This is where all of your qualifications go. All of your GCSE’s, A levels and university degrees as well as more. If you have taken any online courses, include them here. If you have a first aid certificate from work or you have a DBS check, include them here. Unlike with a CV, there’s no set rule to having “too much” on LinkedIn.&lt;/p&gt;
&lt;p&gt;Recruiters can filter searches by qualifications, so make sure to include as many of these as you can. Your National Citizen Service or Duke of Edinburgh award goes here too.&lt;/p&gt;
&lt;p&gt;There are many new sections you can add to your LinkedIn profile. From awards to volunteer work, there's a section for you.&lt;/p&gt;
&lt;h5 id="projects"&gt;Projects&lt;/h5&gt;
&lt;p&gt;Your projects section details any projects you’ve worked on. It’s designed like the experience section where you can have dates on the project, descriptions and titles.&lt;/p&gt;
&lt;p&gt;The same advice from experience works here. You can also add the other people who have worked on the project with you.&lt;/p&gt;
&lt;h5 id="organisations"&gt;Organisations&lt;/h5&gt;
&lt;p&gt;What organisations are you a part of? If your degree is accredited, include that here. For example, my computer science degree is accredited by the British Computing Society, so I have them listed here.&lt;/p&gt;
&lt;p&gt;I’ve also listed the organisations I’ve volunteered with here.&lt;span id="_38czs75"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h5 id="courses"&gt;Courses&lt;/h5&gt;
&lt;p&gt;What courses have you done? Any online courses? First Aid course? Your modules? Anything course related can go here.&lt;/p&gt;
&lt;h3 id="connections"&gt;Connections&lt;/h3&gt;
&lt;p&gt;On LinkedIn, you can connect with anyone you want. Kind of. If too many people report as not knowing you, you’ll no longer be able to connect with people. You need to connect with people you’ve met. But, even when you’ve met people, they still may not remember you.&lt;/p&gt;
&lt;p&gt;This is why it’s important to include a personalised message to everyone you connect with. A simple “I met you at [place here]” or "I'm interested in your work on X, can we connect so I can stay up to date?”&lt;/p&gt;
&lt;p&gt;When you get past 500 connections on LinkedIn, it’ll only show on your LinkedIn profile as “500+ connections”. It’s way more impressive if you have 500+ connections than 499. Even if you only have 501 connections. People on LinkedIn can’t tell the difference between 501 connections and 171,326 connections. It always shows as “500+ connections”.&lt;/p&gt;
&lt;h3 id="blog-posts"&gt;Blog Posts&lt;/h3&gt;
&lt;p&gt;You can write blog posts and articles directly in LinkedIn. This feature isn't used so well but can be used to increase your reach.&lt;/p&gt;
&lt;p&gt;If you want to write one, click “write an article” under the “update your status” section of the LinkedIn homepage.&lt;/p&gt;
&lt;h3 id="groups"&gt;Groups&lt;/h3&gt;
&lt;p&gt;There are many groups on LinkedIn you can join. You should find groups that interest you. You can find a group for web development, investing, and much more.&lt;/p&gt;
&lt;p&gt;Once you’ve joined a group, comment on things and post things in that group. Interact with people in the group, it’ll help you make friends in that industry.&lt;/p&gt;
&lt;p&gt;Groups can be an easy way to make friends and increase the number of connections you have.&lt;/p&gt;
&lt;h2 id="conclusion-1"&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;I'm not going to create a checklist for every single social media that was brought up here, it'll be too long. Just go through each section that applies to you.&lt;/p&gt;
&lt;p&gt;☐ Have you gone through each of your social media accounts and applied the recommendations laid out in this chapter?&lt;/p&gt;
&lt;p&gt;☐ Have you decided what type of content you're going to produce and how?&lt;/p&gt;
&lt;p&gt;☐ Have you started to make friends, not connections?&lt;/p&gt;
&lt;p&gt;&lt;span id="_3ls5o66"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h1 id=""&gt;How to Prepare for an Interview&lt;/h1&gt;
&lt;p&gt;Interviews are essential to job positions. Almost every single job will involve an interview of some kind. Most people believe that an interview is where the employer sees if you are the right candidate for the job. While that is true, an interview is also where you see whether the employer is right for you.&lt;/p&gt;
&lt;p&gt;When it comes to interviews, practice makes perfect. Get as much practice as possible. Ask your university careers service if they do practice interviews. The more interviews you do, the better you'll get at them.&lt;/p&gt;
&lt;p&gt;Later on in this book, we'll go over a lot of possible interview questions.&lt;/p&gt;
&lt;h2 id="interview-formats"&gt;Interview Formats&lt;/h2&gt;
&lt;p&gt;These interview formats can be mix and matched or on their own. It depends on how the employer wants to do things.&lt;/p&gt;
&lt;h3 id="face-to-face"&gt;Face to Face&lt;/h3&gt;
&lt;p&gt;The normal physical interview format. There will be 1 or 2 people at most interviewing you. They’ll ask you questions relating to the job. They might also make you solve puzzles in front of them, in order to understand your problem-solving process.&lt;/p&gt;
&lt;h3 id="online-video-interview"&gt;Online Video Interview&lt;/h3&gt;
&lt;p&gt;The interviewer will give you a set of questions and you'll have to record yourself for 15 to 30 minutes answering the questions.&lt;/p&gt;
&lt;p&gt;The interviewer loves this format because if you bore them after the first 15 seconds they can stop watching.&lt;/p&gt;
&lt;p&gt;Some companies (such as Barclays) use Artificial Intelligence to read your face and use that to determine whether you go onto the next stage. If you know an AI is going to face read you then you need to have a good internet connection and camera quality, as the AI can’t read your face otherwise.&lt;/p&gt;
&lt;p&gt;Like any interview, you'll need to dress for the occasion. Even if it's not a human interviewing you, they may still be able to detect what you're wearing.&lt;span id="_3z7bk57"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h3 id="skype-interview"&gt;Skype Interview&lt;/h3&gt;
&lt;p&gt;The employer will Skype you and will ask you questions as if it is face to face. Whatever you do, make sure you’re in a quiet environment with good internet.&lt;/p&gt;
&lt;p&gt;If you don't want to approach your careers service and would rather ask friends for this, this is the easiest interview type to ask for help with.&lt;/p&gt;
&lt;p&gt;Your friend could be in bed reading out a list of questions whilst on Skype. However, you must act professional. You cannot be in bed or not dressed for the occasion. This is interview practice, not question time practice. If you do not take practice interviews seriously, you'll falter at the real interview.&lt;/p&gt;
&lt;p&gt;When completing video interviews or Skype interviews, look behind you. What’s behind you? That’s what the interviewer will see. Try to interview with a boring, plain white background if you can. Your universities careers team may let you take video / Skype interviews in a nice, monotone office.&lt;/p&gt;
&lt;p&gt;Don’t look sad, smile. Smiling is the key to interviews, even if they can’t physically see you. Don’t wear a headset or headphones, it makes you look unprofessional&lt;/p&gt;
&lt;p&gt;You can have notes in front of you while doing this interview. Take this to your advantage. Place your CV, company information, questions you want to ask and any more right in front of you, so your interviewer can’t see them. Don’t Google things mid-interview.&lt;/p&gt;
&lt;h3 id="phone-interview"&gt;How to Prepare for a Telephone Interview&lt;/h3&gt;
&lt;p&gt;This is used to determine whether you are worth the time and effort to interview in person. This type of interview is almost always one employee interviewing you.&lt;/p&gt;
&lt;p&gt;Just like with the Skype and video interviews, you can have things in front of you. Have your CV, questions and whatever else you think you may need. Just make sure not to play around with the paper too loudly.&lt;/p&gt;
&lt;p&gt;You need to make sure it’s a high-quality phone call too. If you don’t get signal in your home, find somewhere that does have signal and is quiet. Your universities careers team would probably let you make a call in one of their offices, if you asked.&lt;/p&gt;
&lt;p&gt;You’re allowed to quietly Google things this time, as long as it’s quiet and you don’t leave too much of a gap in your speech. Do not type directly onto your phone while calling someone, they’ll hear it.&lt;/p&gt;
&lt;p&gt;It’s a good idea to disable phone notifications as well. You don’t want the recruiter to hear your phone buzzing from your Snapchat notifications.&lt;br&gt;
&lt;br&gt;
When answering the phone, answer with:&lt;/p&gt;
&lt;p&gt;&lt;span id="_3dhjn8m"&gt;&lt;/span&gt;“Hello, [YOUR NAME] here”.&lt;/p&gt;
&lt;p&gt;I would answer as:&lt;/p&gt;
&lt;p&gt;&lt;span id="_1smtxgf"&gt;&lt;/span&gt;“Hello, Brandon here”&lt;/p&gt;
&lt;p&gt;&lt;span id="_4cmhg48"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Smile. Even if they don’t see you. Smiling comes through on the phone, so smile a lot and be happy.&lt;/p&gt;
&lt;p&gt;Assessment Centres&lt;/p&gt;
&lt;p&gt;An assessment centre is a building or office designed to assess your criteria for the job. Assessment centres typically follow this schedule:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Meet the group&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lunch with your group&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Group problem&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Individual interview&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Most of the time you will be asked to give a presentation during the assessment centre. Your team will be assigned a problem and some reading material, to produce a presentation. More on presentations can be found on page 149&lt;/p&gt;
&lt;p&gt;Very commonly you’ll be asked to retake the tests you’ve done online such as verbal reasoning and numerical reasoning. Sometimes people get their friends to do these online, so this is a test to make sure you know what you’re doing. More on these tests can be found on page 145.&lt;/p&gt;
&lt;p&gt;You may do all of these things, you may do some of these things. If you have an assessment centre coming up and you know what will happen there, feel free to only read the parts that apply to you.&lt;/p&gt;
&lt;h4 id="social-events"&gt;Social events&lt;/h4&gt;
&lt;p&gt;Social events are any part of the assessment centre that is said to be “informal”. This will typically be lunch. This can and will still affect your outcome. Use the time to ask lots of questions, make notes that may be useful in any future interviews with the company.&lt;/p&gt;
&lt;h4 id="in-tray-e-tray-exercises"&gt;In-Tray / e-Tray Exercises&lt;/h4&gt;
&lt;p&gt;This is similar to a role-playing scenario. You will pretend to be a newly appointed manager with a bunch of tasks in a tray / inbox. You have to choose which tasks are the most important. You may also be asked to complete the tasks in the tray. The tray exercises will feature an abundance of sources. It could be emails, voicemails, letters or charts.&lt;/p&gt;
&lt;h4 id="group-activities"&gt;Group Activities&lt;/h4&gt;
&lt;p&gt;When undertaking group exercises one or two instructors will watch you. Don’t dominate the discussion, let everyone speak and if someone's quiet ask them for their input. Try to present your idea as it’ll make you stand out from the group. Don’t worry if one person is seen as too dominating as it likely won’t impress the recruiter.&lt;/p&gt;
&lt;p&gt;In group exercises you must be inclusive, you must include everyone in solving a problem. What they're looking for here is someone who works well in a team. You do not have to be the "best" in the team. You're not going to be knocked out of the process during the group problem for not being the "best". You must display excellent communication skills and teamwork skills.&lt;/p&gt;
&lt;p&gt;Normally you’ll encounter one of these problems:&lt;/p&gt;
&lt;h5 id="business-scenarios"&gt;Business scenarios &lt;/h5&gt;
&lt;p&gt;Often linked to the business. This can include coming up with new ideas for the company, setting a budget, planning a holiday, making a new product, case studies of charities.&lt;/p&gt;
&lt;h5 id="ranking-exercises"&gt;Ranking exercises &lt;/h5&gt;
&lt;p&gt;As the name implies, you have to rank things. Whether this is your top 10 favourite songs or favourite prime ministers. The interviewer could give you a list of people and tell you only 5 or 10 can survive - who do you kill?&lt;/p&gt;
&lt;h5 id="physical-tasks"&gt;Physical tasks &lt;/h5&gt;
&lt;p&gt;This is anything that involves physical activity. It can be building a radio or building a tower of blocks in a weird fashion. It could also be things like Football or table tennis. It depends on how wacky the company is. If it's a tech company, it's a good indication that they might have something wacky such as table tennis.&lt;/p&gt;
&lt;h5 id="section-3"&gt;&lt;/h5&gt;
&lt;h5 id="role-plays"&gt;Role plays  &lt;/h5&gt;
&lt;p&gt;Your team will have to roleplay a scenario. This can involve selling an item to someone, management roles or pretending to fire an employee.&lt;/p&gt;
&lt;h3 id="panel-interview"&gt;Panel Interview&lt;/h3&gt;
&lt;p&gt;You will be interviewed by a panel of people, as opposed to just 1 or 2 people. This is very similar to a face to face interview.&lt;/p&gt;
&lt;h3 id="group-interview"&gt;Group Interview&lt;/h3&gt;
&lt;p&gt;You will be interviewed as a group. As in multiple candidates will be interviewed by one interviewer (or panel). This is also normally a face to face style interview. It is unusual to have a group interview over Skype or the phone.&lt;/p&gt;
&lt;p&gt;Employers do this type of interview because it is efficient, they can interview multiple candidates at once.&lt;/p&gt;
&lt;p&gt;In this style you want to stand out. You can do this by:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Being confident and respectful. Understand that group interviews are efficient and no, the employers do not hate you.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Be a leader. If you are working on a team project, find an opportunity to lead. This does not mean you get to be a dictator and control the group.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Be yourself and be authentic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Follow up — Send a thank you email after the interview.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="styles-of-interview"&gt;Styles of Interview&lt;/h2&gt;
&lt;p&gt;There can be many different styles of interviews that match the formats of interviews. This section is designed to give a broad overview of the different styles of interview possible. Further on in this book we will discuss interview questions&lt;/p&gt;
&lt;h3 id="competency-interview"&gt;WWhat is a Competency Interview?&lt;/h3&gt;
&lt;p&gt;Competency interviews require candidates to talk about specific times they have solved problems. They want to see you are competent. This is where the project(s) comes into play as well, talked about on page 161. What better way to prove you’re good at something if you’ve actually done it?&lt;/p&gt;
&lt;p&gt;Competency based interviews will usually have the interviewer read questions off of a bit of paper or their laptop. They will likely take notes throughout the interview.&lt;/p&gt;
&lt;p&gt;The type of questions that come up here will be strictly formatted. None of those “what’s your favourite colour?” questions.&lt;/p&gt;
&lt;p&gt;The best way to prepare for a competency interview is to read through the questions listed later in this book and try to answer them yourself.&lt;/p&gt;
&lt;p&gt;Competency based interview questions can be found in the next chapter.&lt;/p&gt;
&lt;h2 id="strength-based-interviews"&gt;Strength Based Interviews&lt;/h2&gt;
&lt;p&gt;A strength-based interview focuses on what you enjoy doing, rather than what you can do like in a competency-based interview. Strength based interviews come from “positive” psychology. The theory states that by matching you with what you enjoy doing you’ll be happier in your role, will perform better and stay with the company for longer.&lt;/p&gt;
&lt;p&gt;The interviewer will likely not have any questions written down for this, or not many. They may ask something like “tell me about your favourite day out” and they will ask questions based on your answers to really gage you as a person. These types of interviews will normally feel like a formal chat with a friend rather than a one on one interview.&lt;/p&gt;
&lt;p&gt;More and more companies are switching to strength-based interviews. These companies publicly state they use them:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Aviva&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;BAE Systems&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Barclays&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cisco&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;EY&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Nestle&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Royal Mail&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Strength based questions don’t have a binary “right or wrong” answer. But, do be a decent human being. Don’t talk badly about other people, don’t lie, just be nice.&lt;/p&gt;
&lt;p&gt;Just like every other type of interview you’ll need to include examples to back up your responses.&lt;/p&gt;
&lt;p&gt;Here are some examples of strength-based interview questions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;What do you like to do in your spare time?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What energises you?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How would your close friends describe you?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Do you most like starting tasks or finishing them?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Do you prefer the big picture or the small details?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Describe a successful day. What made it successful?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What are you good at?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What are your weaknesses?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What did you enjoy studying at school or university?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When did you achieve something, you’re really proud of?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What do you enjoy doing the least?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Do you find there are enough hours in the day to complete your to-do list?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What tasks are always left on your to-do list?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How do you stay motivated?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How do you feel about deadlines?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Have you ever done something differently the second time around?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Do you think this role will play to your strengths?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We’ll go over how to answer these in chapter 6.&lt;/p&gt;
&lt;h2 id="stress-based-interviews"&gt;Stress Based Interviews&lt;/h2&gt;
&lt;p&gt;A stress-based interview is designed to make you stressed, to put you under pressure to see how well you do.&lt;/p&gt;
&lt;p&gt;The logic is that the way you respond under stress during the interview is indicative of the way you’ll handle similar situations on the job.&lt;/p&gt;
&lt;p&gt;They can be problematic because it may make the applicant develop a negative attitude towards the company. Sometimes, even the most successful applicants will turn down an offer on account of the nature of the interview alone.&lt;/p&gt;
&lt;p&gt;Here’s some stress-based interview questions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;How do you feel this interview is going?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How would you handle undeserved criticism from a superior?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How many other jobs are you applying for?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What would you do if you saw a colleague stealing supplies or equipment?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What did you do when you had a boss you didn’t get along with?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What would you do if a colleague took credit for your idea, and got a promotion?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Was the stress of your previous job too much for you?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What would you do if a colleague admitted to lying on their resume to get the job?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What would you do if a customer verbally insulted you in front of co-workers?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What would you change about the design of a baseball hat?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Why were you fired from your previous job?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How successful do you think you’ve been so far?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Again, we’ll go over these questions in the next chapter.&lt;/p&gt;
&lt;h2 id="technical-interviews"&gt;Technical Interviews&lt;/h2&gt;
&lt;p&gt;A technical interview is used heavily in the technology industry. It usually involves coding.&lt;/p&gt;
&lt;p&gt;There are so much out there about technical interviews ranging from 800-page books to entire video guides on how to pass technical interviews so I’m not going to cover this in detail here. Because of this, I’m not going to write about them here. I recommend the book “Cracking the Coding Interview”, a link to this book can be found at the end of this book.&lt;/p&gt;
&lt;h2 id="structured-interview"&gt;Structured Interview&lt;/h2&gt;
&lt;p&gt;A structured interview is another describing word for a certain type of interview. A structured interview will usually follow a structure. The interviewer asks the questions in a standard pace and the questions are normally read off of a sheet of paper.&lt;/p&gt;
&lt;h2 id="unstructured-interview"&gt;Unstructured Interview&lt;/h2&gt;
&lt;p&gt;Like above, an unstructured interview is another describing word.&lt;/p&gt;
&lt;p&gt;There isn't a strict structure to these types of interviews. Usually the interviewer will ask you 1 or 2 questions to start you off. The rest of the questions and the way the interview goes will depend on your answers to the first 1 or 2 questions.&lt;/p&gt;
&lt;h2 id="the-lunch-interview"&gt;The Lunch Interview&lt;/h2&gt;
&lt;p&gt;One of the more informal types of interviews. The interviewer will buy you lunch and will interview you over lunch.&lt;/p&gt;
&lt;p&gt;Do some research on the restaurant you are going to. Try to decide what you will order in advance, before reaching the restaurant. Although a restaurant might feel more informal than an interview, make sure to dress the part.&lt;/p&gt;
&lt;p&gt;If you’re applying for Google or something similar,, where everyone wears jeans and hoodies then wear jeans and a hoodie. Make sure you know what the company expects. Most businesses will require suits and formal wear.&lt;/p&gt;
&lt;p&gt;If you’re not sure on the dress code, just take a step back and think for a second. Is the company some super serious fortune 100 bank or investment firm? It’s formal all the way. Are they a tech start-up? Likely informal. If you Google “[companies name] dress code” you might find them. When in doubt, dress smart.&lt;/p&gt;
&lt;p&gt;Try to arrive 15 minutes before the time of the reservation and meet the employer outside the restaurant.&lt;/p&gt;
&lt;p&gt;The best thing you can do here is to take the lead from your interviewers. When you sit down, casually ask if they’ve been to the restaurant before and what they think are good options. Hopefully their recommendations will give you a sense of an appropriate price range. If not, when the wait staff arrives, try to have your interviewer order first and choose something at that price point (or less).&lt;/p&gt;
&lt;p&gt;Also, be sure to pick an option that will be easy to eat while you’re talking. (Hint: Forkfuls of Caesar salad are easier to manoeuvre than a massive, messy sandwich.)&lt;/p&gt;
&lt;p&gt;Finally, no matter how casual your employer may be, you want to put forward your very, very best self. This means: Stay away from ordering alcohol, even if the interviewers do. If you get the job, you will have plenty of opportunities to share a drink with them — the interview is not the time or place to start.&lt;/p&gt;
&lt;p&gt;There’s a couple stories going around about interviewers asking the waitressing staff to purposely get the interviewees order wrong. This is so the interviewer can see how the applicant behaves in this situation. This is an important example to talk about because while lunch interviews are informal – they are still interviews.&lt;/p&gt;
&lt;h2 id="conclusion-2"&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;☐ Find out what interview you're having&lt;/p&gt;
&lt;p&gt;☐ Try to match the interview to the types listed in this chapter&lt;/p&gt;
&lt;p&gt;☐ Read up on those types of interviews and practice them&lt;/p&gt;
&lt;p&gt;☐ Practice those specific styles again (practice makes perfect)&lt;/p&gt;
&lt;p&gt;☐ Find out the formality of the company&lt;/p&gt;
&lt;h2 id="section-4"&gt;
&lt;br&gt;
&lt;/h2&gt;

&lt;h1 id="chapter-6---interview-questions"&gt;How to Answer Interview Questions&lt;/h1&gt;

&lt;p&gt;This chapter is all about interview questions. Before we get into them, let’s first go through some basics of answering interview questions.&lt;/p&gt;

&lt;h2 id="answering-interview-questions"&gt;Answering Interview Questions&lt;/h2&gt;

&lt;p&gt;The STAR method (see below) is appropriate to use for talking about examples and situations you have been in that are beneficial to talk about during the interview. As you’ll come to see, most interview questions require you to answer with an example.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Situation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;What situation were you in? Give some background details. Were you at university? An internship?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Task&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;What was you tasked with? What were you asked to do, was there a team? Why did you have to do it?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Action&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;What actions did you take? What did you actually do to solve the task? This is the largest part of the STAR method, you should talk more here than any other part.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Result&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;What was the result? What happened because you took action?&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2 id="know-yourself"&gt;Know Yourself&lt;/h2&gt;

&lt;p&gt;They will ask questions about your CV. People regularly forget what they have put on their CV. Make sure you understand the projects and work you’ve put on there.&lt;/p&gt;

&lt;p&gt;If you’ve done any projects, I use this table to help me remember any projects I’ve worked on (shown on next page). I recommend you fill this out before an interview, as it will help you.&lt;/p&gt;

&lt;p&gt;&lt;span id="_fcdo2wkiacih"&gt;&lt;/span&gt;“If you know the enemy and know yourself, you need not fear the result of a hundred battles. If you know yourself but not the enemy, for every victory gained you will also suffer a defeat. If you know neither the enemy nor yourself, you will succumb in every battle.” - Sun Tzu, Art of War&lt;/p&gt;

&lt;p&gt;If you’ve researched the company and you know yourself, you’ll come out on top most of the time.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Project Name&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Project Date&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;What was the project?&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Who was it for?&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;3 achievements from this project&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;3 failures from this project, and what you learnt&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;I also use this table below to find out examples / projects that may be beneficial when answering interview questions. Replace project with example if you haven’t worked on projects. Pick 3 projects you want to really focus on, that you think will benefit you in the interview. Once you’ve picked 3, complete this table.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Common questions&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Project 1&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Project 2&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Project 3&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;What challenges did you face?&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;What mistakes / failures did you make?&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;What did you enjoy?&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;What conflicts with other team members came up?&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;What would you do differently?&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Tell me about a time you showed leadership in this project&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Once you’ve filled out these tables, you should have a really good idea of who you are and what you’ve done. Congratulations! You’re already better than 60% of the other applicants. Let’s make you better than 80% of the other applicants in our next section.&lt;/p&gt;

&lt;h2 id="interview-questions"&gt;15 Interview Questions&lt;/h2&gt;

&lt;p&gt;Interview questions, loved by some, hated by many. These are often seen as the hardest part of the interview. What do you say? What do you do? What's the "right" answer here?&lt;/p&gt;

&lt;p&gt;Interview questions make up 95% of an interview. The whole purpose of an interview is to ask questions and be asked questions. Luckily for you and I, according to Reed, one of the largest recruitment agencies in the world, there are only 15 interview questions. All other interview questions stem from these magic 15.&lt;/p&gt;

&lt;p&gt;The Pareto Principle states that 80% of the rewards comes from 20% of the work. We only need to know how to answer 20% of the interview questions to answer 80% of all the questions asked of you. The other 20%, well, that should come from your research on the company. Later on, in this book, we will discuss how to research a company.&lt;/p&gt;

&lt;p&gt;Let's get right into these interview questions.&lt;/p&gt;

&lt;h3 id="tell-me-about-yourself"&gt;Tell me about yourself&lt;/h3&gt;

&lt;p&gt;Don't make the mistake of thinking this is about your personal life. They do not care about your personal life. It doesn't matter whether you have a dog or a cat. They want to hear your professional life story.&lt;/p&gt;

&lt;p&gt;Make sure to tell a story. Like previously discussed, humans are naturally prone to enjoying stories. Stories make the other person interested. Don't give out a bullet pointed list, talk with them.&lt;/p&gt;

&lt;p&gt;This question is a combination of these things: How well the candidate has prepared, their confidence, and what they've done in their professional life.&lt;/p&gt;

&lt;p&gt;Even if you haven't done something interesting in your professional life, you can spin any story to make it sound amazing. In the world of news, bad stories are often spun into a good light. You can spin something non-interesting into interesting.&lt;/p&gt;

&lt;p&gt;Let's say you work part-time at McDonalds. I chose this because this is the most mediocre thing I could think of. While working at McDonalds, you discovered that it's faster to type in the order as the person says it rather than to type it at the end. This isn't ground-breaking stuff, just a simple observation. We're going to spin this story to make you sound mind-blowingly amazing.&lt;/p&gt;

&lt;p&gt;&lt;span id="_exw3yxbvji4j"&gt;&lt;/span&gt;“In my teenage years I worked at a rapid quickfire fast food chain. On average, we served around 400 customers an hour and during our peaks the store would get so busy the line would go out the door. In this environment, I learnt that I thrive under extreme amounts of pressure. Not only did I have to make sure that every single customer was over-joyous with their meals, but I had to do it fast.&lt;/p&gt;

&lt;p&gt;&lt;span id="_4ekz59m"&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span id="_2tq9fhf"&gt;&lt;/span&gt;Whilst working here, I created a new system that increased the speed and accuracy of processing information into an End Point of Sales system. This new system allowed us to serve twice as many customers per minute all whilst keeping the customer satisfaction levels high.&lt;/p&gt;

&lt;p&gt;&lt;span id="_18vjpp8"&gt;&lt;/span&gt;One time, my store ran out of milk. My manager chose me to partake on this critical mission. To refill our stock supplies and refill them fast. Not only did I achieve this mission within 5 minutes, but I managed to achieve it before any customers requested items containing milk. Considering this restaurant serves 10 people a minute, I'll say that's some achievement.”&lt;/p&gt;

&lt;p&gt;The point I'm trying to make here is that no matter how mediocre of a job you think you had, you can always spin it to make you sound amazing.&lt;/p&gt;

&lt;p&gt;Back to the question at hand. Businesses have elevator pitches. These are 30 second speeches that describe the business. The idea is if you are in an elevator with an investor, you have around 30 seconds to convince them to invest in the company. People can have elevator pitches too, and this is used to answer this question.&lt;/p&gt;

&lt;p&gt;Your elevator pitch should be customised per job position. Hopefully you'll understand that nearly everything should be customised per job position. I can't tell you what to say, as I don't know you.&lt;/p&gt;

&lt;p&gt;Don't make it sound like someone has never asked this question to you before. Act confident. Practice on your friends or in your mirror. Don't "uhm" or "ehh" before answering. This makes you look like you haven't prepared, that you're not confident. Look them in the eye, smile, and say it out loud like you've rehearsed it every day of your life.&lt;/p&gt;

&lt;p&gt;Always start your pitch with what you currently do (professionally). End that paragraph with something that leads the interviewer back in time. You want to tell a story. You also want to talk about your most recent things first.&lt;/p&gt;

&lt;p&gt;&lt;span id="_3sv78d1"&gt;&lt;/span&gt;“I'm a computer science student at the University of Liverpool. I'm aiming to get a first-class degree. Previously I was studying a level 4 diploma at a local college”&lt;/p&gt;

&lt;p&gt;The next part leads back into your past. Notice how I ended the first part with "Previously I was". This gently pushes you and the reader back into the past. I'm a student, and the likely chance is that you are a student. Education is the thing that defines us, but if you have any part time jobs working in industry you can put them here.&lt;/p&gt;

&lt;p&gt;If you are a software engineer, you can say something like this:&lt;/p&gt;

&lt;p&gt;&lt;span id="_280hiku"&gt;&lt;/span&gt;“I'm a computer science student at the University of Liverpool. I'm aiming to get a first-class degree. I'm also a software engineer part-time.”&lt;/p&gt;

&lt;p&gt;Make sure each section smoothly leads into the other.&lt;/p&gt;

&lt;p&gt;The second section should talk about your achievements. Don't talk about your responsibilities, what you had to do. Talk about what you have achieved.&lt;/p&gt;

&lt;p&gt;In my case, it'll look like this:&lt;/p&gt;

&lt;p&gt;“While at college I became the student union's higher education vice president. During this role I ran the collective college partnership’s Student Union consisting of 5 colleges. Towards the end of my role, every student was filling out the annual student survey. Every section for the student union in the survey had improved ten-fold. Most noticeably, the student union satisfaction rating went up from 30% to ~85%.&lt;/p&gt;

&lt;p&gt;&lt;span id="_n5rssn"&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span id="_375fbgg"&gt;&lt;/span&gt;This role required me to be an effective leader and team player. I needed to communicate complex ideas to the board members within meetings. I had to learn to deal with fast paced deadlines and even how to interview and select an appropriate replacement candidate. I believe all of these skills I have obtained will come in very useful within this job.”&lt;/p&gt;

&lt;p&gt;Remember earlier when I said it's all about spinning a story? Make sure to include statistics if you can. This section is ripe for you to spin, to make yourself sound amazing. At the time, my job required me to go to a meeting once a month and pop into classrooms to discuss student issues. That doesn't seem like much, but I can spin it to make it sound amazing. Also, the statistics help a lot.&lt;/p&gt;

&lt;p&gt;When you end this, you have to make the interview aware that you have finished. With this question, sometimes there is a few awkward seconds of the interviewer wondering "did they finish?"&lt;/p&gt;

&lt;p&gt;In my case, I like to end it with:&lt;/p&gt;

&lt;p&gt;&lt;span id="_1maplo9"&gt;&lt;/span&gt;“If there is anything else you would like to know, feel free to ask me.”&lt;/p&gt;

&lt;p&gt;Most candidates fail this question because they have not practiced. They do not know how to answer or what to talk about. This results in the candidate vomiting out positions and words until they are satisfied that they've covered the question.&lt;/p&gt;

&lt;p&gt;Throughout all of these questions in this book, I urge you to practice them. It simply is not enough to read it and forget it, you need to write your own answer to these questions. This question especially. This question is asked in pretty much every interview, and normally right at the start of an interview. Because it's asked at the start, it counts towards your first impression. If you do not answer this question confidently then the interviewer will likely not hire you, even if you answer every other question well.&lt;/p&gt;

&lt;p&gt;The interviewer asks this question because it allows them to get a rough idea of your background and experience. Sure, they could read your CV. But the interviewer sees this as an "easy" question and it helps to calm your nerves.&lt;/p&gt;

&lt;h3 id="why-are-you-applying"&gt;2. Why are you applying?&lt;/h3&gt;

&lt;p&gt;This question helps the employer understand what you can do for them. You could rephrase this question as "What can you do that we need you to do?" They want to know what problems you can solve. They want to know if you have the determination and motivation to work for the.&lt;/p&gt;

&lt;p&gt;In the Reed book "Why You?" they say that an answer to this question can be expressed in one single sentence:&lt;/p&gt;

&lt;p&gt;&lt;span id="_2lfnejv"&gt;&lt;/span&gt;"I'm applying because my skills, experience, and motivation are the best fit for the job."&lt;/p&gt;

&lt;p&gt;Like all interview questions, you have to customise it per job interview. Don't give out a blanket answer here. Don't mention these in your answer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You need money&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You want to get out of the house&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A shorter commute is better than a longer one&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You want to work at this job because you love it. Even if you don't love it, don't let the interviewer know. The interviewer wants to hire someone who is in love with the company and the job, don't give them any reason to doubt you.&lt;/p&gt;

&lt;p&gt;You want to research the job role here to see how you can fit into the job role. Interviewing is all about making yourself look like the perfect candidate for the job. Here's an example of an answer to this question:&lt;/p&gt;

&lt;p&gt;&lt;span id="_10kxoro"&gt;&lt;/span&gt;“I want this job because it emphasises helping others and integrity, two things that make up the core of who I am. In my previous job, I helped fundraise over £5000 for charity in one month and always put the customer first. I know I could bring my 3 years of experience to this company, and continue your years of growth”&lt;/p&gt;

&lt;h3 id="what-are-your-greatest-strengths"&gt;3. What are your greatest strengths?&lt;/h3&gt;

&lt;p&gt;To answer this question, you have to customise it to the job description. Reflect what the job description says here. It's no use talking about how great you are at welding if you're applying for an office job.&lt;/p&gt;

&lt;p&gt;This question is giving you the opportunity to boast about yourself, but don't come across as arrogant. This is not the time to be humble, you need to sell yourself like you're absolutely perfect for the job.&lt;/p&gt;

&lt;p&gt;There isn't much I can say here to help you, since this question is customised per job. You need to think about how you'll answer this question and write down your answer.&lt;/p&gt;

&lt;p&gt;Instead, let's go over what makes a great answer. Look at this answer:&lt;/p&gt;

&lt;p&gt;&lt;span id="_1zpvhna"&gt;&lt;/span&gt;“I’m an extremely hard worker. I often don’t pick up many projects but when I do, I go all in. Recently I’ve picked up blogging, managing to amass more than 80,000 monthly readers in less than 8 months.”&lt;/p&gt;

&lt;p&gt;The statistics in this answer make it hit hard. 80,000 people read my blog every month, and I've achieved that in 6 months? Notice how I've managed to boast here without sounding too big-headed. You could rephrase this as:&lt;/p&gt;

&lt;p&gt;&lt;span id="_4jpj0b3"&gt;&lt;/span&gt;"I've grown my blog to tens of thousands of readers every single month, and it has taken me less than a year!"&lt;/p&gt;

&lt;p&gt;This one sounds like I'm obsessed with myself. If you add statistics, you're allowed to boast about yourself without sounding obsessive or insane.&lt;/p&gt;

&lt;p&gt;Another way to rephrase this is:&lt;/p&gt;

&lt;p&gt;&lt;span id="_2yutaiw"&gt;&lt;/span&gt;"My blog posts get twice as many people reading them as there are people in Lichtenstein"&lt;/p&gt;

&lt;p&gt;This is using statistics. There are around 30,000 people in Lichtenstein and 80,000 people read my blog, but this sounds big headed. You have to say the numbers directly. Notice how if we change this to include numbers it doesn't make sense:&lt;/p&gt;

&lt;p&gt;&lt;span id="_1e03kqp"&gt;&lt;/span&gt;"My blog posts get 80,000 readers per month. There are 30,000 people in Lichtenstein. My blog gets more than twice as many readers per month then there are people in Lichtenstein".&lt;/p&gt;

&lt;p&gt;Statistics and hard numbers are incredibly important.&lt;/p&gt;

&lt;p&gt;Make sure the statistic is relevant to the job. If I'm applying for a job that has nothing to do with writing, I probably wouldn't bring this up.&lt;/p&gt;

&lt;p&gt;With statistics, you don't have to be given one to use it. You can work out the statistic yourself. Let's say you work in a bookshop and you regularly talk to customers. You could say:&lt;/p&gt;

&lt;p&gt;&lt;span id="_3xzr3ei"&gt;&lt;/span&gt;"I regularly engage with customers and sell them more books then what they came in for. On average, every customer I serve buys more than £50 worth of books".&lt;/p&gt;

&lt;p&gt;Sometimes, it's better to present something you're only slightly good at then it is to present something you are amazing at. If the thing you are amazing at doesn't match the job description, don't mention it. If the thing you are slightly good at does, do mention it.&lt;/p&gt;

&lt;h3 id="what-are-your-greatest-weaknesses"&gt;4. What are your greatest weaknesses?&lt;/h3&gt;

&lt;p&gt;Many people fail this question because they believe that the right answer is "I don't have any weaknesses". What? Are you human? Everyone has a weakness. Please do not answer with a weakness similar to these:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;I’m a hard worker.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I work so much.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I’m the best at teamwork, no one is better than me at working in a team.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Yeah, sure it may have worked for your granddad but employers could see the lies from miles away. Use an actual weakness here, something that you suck at. But don't admit to something insane such as:&lt;/p&gt;

&lt;p&gt;&lt;span id="_sabnu4"&gt;&lt;/span&gt;“Sometimes I get really vivid thoughts of murdering people that interview me… :)”&lt;/p&gt;

&lt;p&gt;The secret to answering this question is to use a real problem you've faced. But make sure you talk about how you've overcome this. If you're still overcoming the problem, that's okay. You can still talk about this. An example taken from myself would be:&lt;/p&gt;

&lt;p&gt;&lt;span id="_3c9z6hx"&gt;&lt;/span&gt;“I used to be terrified of phone call I’m still overcoming this but I’m not as bad as I was a year or two ago.”&lt;/p&gt;

&lt;p&gt;But don’t make the weakness a part of the job description. If the job description says&lt;/p&gt;

&lt;p&gt;&lt;span id="_1rf9gpq"&gt;&lt;/span&gt;“you need to be really good at talking to people”&lt;/p&gt;

&lt;p&gt;Never say&lt;/p&gt;

&lt;p&gt;&lt;span id="_4bewzdj"&gt;&lt;/span&gt;“I’m really bad at talking to someone”.&lt;/p&gt;

&lt;p&gt;You have to say how you overcame your weakness and turn it into something positive. Mould it into a story.&lt;/p&gt;

&lt;p&gt;Show that this won’t be a problem at your current company. Say something along the lines of:&lt;/p&gt;

&lt;p&gt;&lt;span id="_2qk79lc"&gt;&lt;/span&gt;“I believe this won’t be a problem in this company”&lt;/p&gt;

&lt;p&gt;and then say why. Mine would be:&lt;/p&gt;

&lt;p&gt;“I used to be terrified of phone calls. The idea of phoning someone was a no go for me. Having worked in a student’s union and at multiple events it was inevitable for me to phone people so I’ve gotten used to it. I’m still overcoming this but I’m not as bad as I was a year or two ago. I believe this won’t be a problem at this company because I’m passionate for the cause of this company which would allow me to talk more on the phone to people revolving around this company. That’s one of the reasons I want to join this company, because I get to do what I love, and I get to push my boundaries and get out of my comfort zone, to grow both personally and professionally.”&lt;/p&gt;

&lt;p&gt;&lt;span id="_15phjt5"&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;It has to be very clear that this question is as normal as giving your name and address, do not act like they are forcing information out of you. Whatever you do, under all circumstances, never ever reply with any of these:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;I’m a perfectionist!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I work too hard&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I don’t have any!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Chocolate / food&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id="what-will-your-skills-and-ideas-bring-to-this-company"&gt;5. What will your skills and ideas bring to this company?&lt;/h3&gt;

&lt;p&gt;To put it bluntly, this question is:&lt;/p&gt;

&lt;p&gt;&lt;span id="_24ufcor"&gt;&lt;/span&gt;“Why should we care about you? What can you do that others can’t?”&lt;/p&gt;

&lt;p&gt;This is one of the best questions that could possibly come up in an interview. This question is:&lt;/p&gt;

&lt;p&gt;&lt;span id="_jzpmwk"&gt;&lt;/span&gt;"What can you do that others can't?"&lt;/p&gt;

&lt;p&gt;The recruiter is asking you to mow down your competition. Do not show mercy to your competition, make it very clear that you are the best. If you've worked on a project (discussed later), now is the time to talk about it. If you're a software developer, you might say something like:&lt;/p&gt;

&lt;p&gt;&lt;span id="_33zd5kd"&gt;&lt;/span&gt;"I saw your company used this Python package on GitHub, but that Python package is deprecated. I’ve actually made a Python package that works the same but uses all the conventions that Python requires now. It’s also a little bit faster."&lt;/p&gt;

&lt;p&gt;You have to customise this per job. There aren't many interview questions that you can't customise per job. Also, you want to beat your components but don't talk badly about them. Focus on your strengths, not your components' weaknesses.&lt;/p&gt;

&lt;p&gt;If you haven't completed a project, talk about what you've done in the past for other, but similar, companies. Make it sound like these past achievements are something that you can do for this company. An example might be:&lt;/p&gt;

&lt;p&gt;&lt;span id="_1j4nfs6"&gt;&lt;/span&gt;“I turned a failing product from 30 sales a month to 10,000 a week, I want to sell as many of Product X as possible”.&lt;/p&gt;

&lt;p&gt;Or here’s another example:&lt;/p&gt;

&lt;p&gt;&lt;span id="_434ayfz"&gt;&lt;/span&gt;“I will bring my unique vision to your company. I can see your company achieving X in the future, and I want to help you achieve this. I am experienced in A, B, C related to [company’s goals]. For example, I helped improve student retention rates at my previous college by over 45%. My marketing background, along with my ability to see potential future problems, will help you grow.”&lt;/p&gt;

&lt;h3 id="whats-your-preferred-management-style"&gt;6. What’s your preferred management style?&lt;/h3&gt;

&lt;p&gt;This question is just the interviewer wanting to know if you are going to get along together.&lt;/p&gt;

&lt;p&gt;There’s 3 main steps to this question.&lt;/p&gt;

&lt;h4 id="define-what-good-management-is"&gt;Define what good management is&lt;/h4&gt;

&lt;p&gt;They obviously care about good management, so it’s important that you and the interviewer get on the same page about what good management is. Here’s an answer example answer:&lt;/p&gt;

&lt;p&gt;&lt;span id="_1wjtbr7"&gt;&lt;/span&gt;“Management style is hard to describe, but I think a good manager gives clear directions and stays hands-off but is ready and available to jump in and offer expertise or help when needed.”&lt;/p&gt;

&lt;h4 id="add-your-own-take"&gt;2. Add your own take&lt;/h4&gt;

&lt;p&gt;Now say something that makes you unique. You want to stand out, not appear to be another sheep in the candidate pool. Here’s a good response for the second part from Forbes&lt;/p&gt;

&lt;p&gt;&lt;span id="_2vor4mt"&gt;&lt;/span&gt;“In terms of what makes me unique, I go out of my way to fully understand a problem and try to solve it as best as I can before seeking help. When I do, it’s quite a short chat since I know exactly what the problem is, and I know what questions I need to ask in order to solve it.”&lt;/p&gt;

&lt;h4 id="add-an-example"&gt;3. Add an example&lt;/h4&gt;

&lt;p&gt;Examples always work in interview answers. Back up what you’ve said. Here’s an answer to this part:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;span id="_3utoxif"&gt;&lt;/span&gt;“&lt;em&gt;I remember one project at [previous company name here] where I had to work on achieving X in 2 weeks. I worked tirelessly to make it the best it can be, but I came across a problem. I researched for hours on the problem itself before seeking help from my manager. Because of my research, I knew exactly what the problem was. A quick 2- or 3-minute chat with my manager fixed everything for me. I realised this problem may be experienced by more new employees, so I created a text document containing common problems and fixes which allowed our manager to work less on helping others and more on making sure goals are met on time&lt;/em&gt;.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id="where-do-you-see-yourself-in-five-years-time"&gt;7. Where do you see yourself in five years’ time?&lt;/h3&gt;

&lt;p&gt;The recruiter is asking this question because they want to know if you plan to work there for a long time. Every employer expects you to work there for a very long time, even if it's a small part time job.&lt;/p&gt;

&lt;p&gt;Brand loyalty is important here. Even if you don't plan to work there forever, make it seem like it. You can say something along the lines of:&lt;/p&gt;

&lt;p&gt;&lt;span id="_p49hy1"&gt;&lt;/span&gt;“I don’t know your company well enough, but I would like to think I would still be working here. In 5 years’ time I would have liked to learnt enough to be able to train people in future roles.”&lt;/p&gt;

&lt;p&gt;What you want to do here is mix "I love your company and I want to work here forever" with "I'm quite ambitious and I would love to take on some bigger roles in my career".&lt;/p&gt;

&lt;h3 id="how-would-you-approach-this-job"&gt;8. How would you approach this job?&lt;/h3&gt;

&lt;p&gt;This question is strange. It's kind of a trick question. You will never completely know how a company works without working at that company. Don’t answer like you’re an expert on this but you do need to answer like you have a relatively good idea of what you’re doing.&lt;/p&gt;

&lt;p&gt;An answer like this will work:&lt;/p&gt;

&lt;p&gt;&lt;span id="_1o97atn"&gt;&lt;/span&gt;“Well, the best way to do this job won’t come clear to me until I start this job. But I’ll start by getting to know my colleagues and team, listening, taking notes, building relationships, and helping people out where I can. After all that, I’ll have a good idea of how to do this job in the best way possible. At my last job I did…”&lt;/p&gt;

&lt;p&gt;Notice the example again. Talk about how you best undertook your last job but don’t go on forever about it. You don't need to answer every question with a long-winded story. Most interviews have time constraints, so don’t answer every question like you did with the first.&lt;/p&gt;

&lt;h3 id="what-have-you-achieved-in-other-roles"&gt;9. What have you achieved in other roles?&lt;/h3&gt;

&lt;p&gt;This is quite similar to question 3. This questions is giving you permission to toot your own horn, to show off. This is not the time to be humble. Talk about your proudest achievement at another role. This is highly personal, but an example of mine would be:&lt;/p&gt;

&lt;p&gt;“My role as Higher Education Vice President started off on a bad turn. There were supposed to be 5 student union officers, but only I wanted to do the job. Effectively leaving me in charge of the work of 5 people, all whilst the student union staff who work with us had left to go to another job.&lt;/p&gt;

&lt;p&gt;Luckily this was perfect for me, as I stepped up when no one else would. I travelled to every campus as much as possible to make sure all students were listened to. When a group of students came to me telling me that their course isn’t being properly funded, I demanded a meeting with the principle of East Kent College to fix this.&lt;/p&gt;

&lt;p&gt;&lt;span id="_2ne53p9"&gt;&lt;/span&gt;As well as this I repeatedly represented the students in a democratic way at both a local (Kent) way and in a national way. I was chosen to attend the National Union of Student’s National Conference, where I elected the next NUS officer team and chose to represent my college on a national scale.&lt;/p&gt;

&lt;p&gt;By the end of the year the students were asked to fill out a survey about their time at college. Student union approval ratings were previously laying around 30%, with about 5 questions about the student’s union. By the time I finished, it laid around 90% with comments from students saying about how amazing it was for their problems to be fixed so easily.&lt;/p&gt;

&lt;p&gt;On top of this, I received a letter from the Chief Executive President of Student Welfare saying that I was the best Student Union’s Officer ever and rewarding me with a £50 Amazon voucher.&lt;/p&gt;

&lt;p&gt;&lt;span id="_12jfdx2"&gt;&lt;/span&gt;"&lt;/p&gt;

&lt;p&gt;Talk about your achievements, talk about the statistics that back these achievements up. But make sure it’s in a story, humans really like stories. Make sure it’s about &lt;strong&gt;past&lt;/strong&gt; achievements in previous roles and not current achievements, things that you are achieving right now.&lt;/p&gt;

&lt;h3 id="what-did-you-like-and-dislike-about-your-last-job"&gt;10. What did you like and dislike about your last job?&lt;/h3&gt;

&lt;p&gt;When answering this question, you want to balance two things. On one hand, you don't want to sound like a moaner who hated your last job. But you also want to be authentic. Since it's easy to talk about what you liked about your last job, we'll discuss how to talk about the negatives here.&lt;/p&gt;

&lt;p&gt;The interviewer is asking you to say something negative about your last job. Don't pretend there wasn't anything negative, everyone doesn't like something about their job. Even if it's really small, be authentic and you'll do fine.&lt;/p&gt;

&lt;p&gt;Don't discuss people. This will make you come off as cruel or bad of heart. Discuss the circumstances or tasks you had.&lt;/p&gt;

&lt;p&gt;Here's a good answer you can model your own answer on:&lt;/p&gt;

&lt;p&gt;&lt;span id="_21od6so"&gt;&lt;/span&gt;“I loved many things about my previous job. An environment where I was regularly challenged, amazing people and cool projects. But there was one thing I didn’t like. Expectations were sometimes unclear. I would complete a project with little to no guidelines and then told that parts of it were wrong. I’ve since learned that communication is key here. If I don’t understand something, I need to ask my manager for help on what they want me to do. Two people can look at the same guidelines and draw vastly different conclusions as to what to do. I’ll always be thankful for the learning opportunity at this company, as it helps me improve myself.”&lt;/p&gt;

&lt;p&gt;This answer is good. It talks about a negative in your job and how you overcame it. The employer is trying to trick you up, by seeing if there is something negative about you. Give them what they want but talk about how you turned this negative into a positive.&lt;/p&gt;

&lt;h3 id="tell-me-about-a-time-you-worked-in-a-team"&gt;11. Tell me about a time you worked in a team&lt;/h3&gt;

&lt;p&gt;You’re very likely going to work in a team, so the interviewer wants to know how good you are at team work.&lt;/p&gt;

&lt;p&gt;You need to talk about an experience and weave it into a story. You need to talk about what you did and the problems your team overcame. Don't badmouth your team, only talk well about them. And remember, the interview cares about your team. There's no "I" in team, so don't only talk about how you did everything in the team.&lt;/p&gt;

&lt;p&gt;This is really personal and customised to you, so no examples from me here. You should form your own answers. Just make it a happy story, talk about a problem your team faced and how you overcame it.&lt;/p&gt;

&lt;h3 id="what-do-your-co-workers-say-about-you"&gt;12. What do your co-workers say about you?&lt;/h3&gt;

&lt;p&gt;If you have testimonials or reference letters, now is a good time to ask if you can show them. Never just pull out your phone or paper documents without asking if it's okay.&lt;/p&gt;

&lt;p&gt;If you don't have testimonials, you need to talk about yourself from an outside perspective. An answer like this would work:&lt;/p&gt;

&lt;p&gt;&lt;span id="_1fyl9w3"&gt;&lt;/span&gt;"My colleagues have told me that I am extremely organized and excellent at time management. During one project, my team members praised me for developing and sticking to a timeline for all the phases of the project. (Give a brief summary of what the project was.) We ended up successfully completing it ahead of time, and it was a hit"&lt;/p&gt;

&lt;p&gt;Notice how we talked about a time in a team, and how we used a story to tell it. This is effective. Talking about what team members think about you is more authentic than talking about what you think people you only hang out with at lunch think about you.&lt;/p&gt;

&lt;h3 id="how-do-you-deal-with-stress-and-failure"&gt;13. How do you deal with stress and failure?&lt;/h3&gt;

&lt;p&gt;Don’t pretend like you’ve never experienced stress. Talk about how you deal with stress and failure. This is highly personal so again customise this to you. My answer would be:&lt;/p&gt;

&lt;p&gt;&lt;span id="_2f3j2rp"&gt;&lt;/span&gt;“I once was rejected by 5 universities. I had no idea what I would be doing come September.&lt;/p&gt;

&lt;p&gt;This was a highly stressful time for me because I expected to get into at least one university. I went running, I took a few days off work and I decided on my options. I could either of been sad, moany and upset for the rest of that month or I could have manned up, accepted what had happened and decided on my next step. I chose the latter.”&lt;/p&gt;

&lt;h3 id="how-much-money-do-you-want"&gt;14. How much money do you want?&lt;/h3&gt;

&lt;p&gt;As well as how to answer this question, I’m also going to show you how to increase your salary year on year.&lt;/p&gt;

&lt;p&gt;What If I told you that you can get £25,000 by reciting a Shakespeare poem? You would say “Sign me up!”. You’ll memorise the entirety of that poem, knowing every single thing about it. Now, what If I told you that anyone can get this money by reciting a poem? You’ll want to tell everyone you know. What if you told your friends and they said:&lt;/p&gt;

&lt;p&gt;&lt;span id="_3e8gvnb"&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span id="_80zs3ca3adxq"&gt;&lt;/span&gt;“Well…. I don’t like poetry. I don’t read books much either. That’s a ridiculous proposition. I’m an architect, not a poet. I don’t know the first thing about poetry.”&lt;/p&gt;

&lt;p&gt;Sounds ridiculous. They’re giving up £25,000 because they don’t want to recite poetry for a couple of minutes. This example is exactly like salary negotiation. You can make thousands, sometimes even hundreds of thousands by just spending a few minutes negotiating. You don’t need to be an expert or have studied it to negotiate. I’m going to walk you through everything to make sure you get a well-paying graduate job.&lt;/p&gt;

&lt;p&gt;Questions on salary are difficult. Once you give a number, you lose. They know that’s your maximum, so don’t try and be the first one to give a number. The interviewer might ask:&lt;/p&gt;

&lt;p&gt;&lt;span id="_1tdr5v4"&gt;&lt;/span&gt;“What’s your current salary?”&lt;/p&gt;

&lt;p&gt;Which is just a trick to find out how much money you’re okay with. Here’s what a typical normal salary negotiation looks like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Find job on recruitment site (e.g. Monster)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Send in a CV&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Complete prior tests&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Get an interview&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Get asked how much you want to be paid&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You answer&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And that’s it. You’re stuck there. You could be worth £60k a year and if you answer with “£20k” that’s it. That’s your salary now.&lt;/p&gt;

&lt;p&gt;Here’s what it looks like if you’ve followed this book:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Once you have established yourself in your field, post an “I’m looking for a job” Tweet / LinkedIn post / any other site you use.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Loads of people message you, asking you to work at their companies or they can recommend you for company X.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;While these people are working to get you hired at their company, you explore your options on recruitment sites. You find a few jobs you like the look of.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You reach out to friends that work at these companies and ask for recommendations (if you’re really interested in applying).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Your recruiter asks you how much money you want. You tell them “It’ll be good if we can come to a mutually fulfilling offer, what were you thinking?”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;They reply back with X&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Boom. You got them. Once they say a number, they lose. The second you say a number you lose. Whoever says the number first is the loser. Let’s explore this some more, including what to do if they refuse to give the number first.&lt;/p&gt;

&lt;p&gt;You should avoid questions such as “how much money do you want”. Don’t give them any numbers. If they ask one of these questions simply say:&lt;/p&gt;

&lt;p&gt;&lt;span id="_4ddeoix"&gt;&lt;/span&gt;“I’m not comfortable sharing that information at this point”&lt;/p&gt;

&lt;p&gt;At some point in the process you achieve something which I describe as “Yes, if…” rather than “No, but…”. “Yes, we want to work with you, if we can come to a mutually satisfactory offer,” which is distinguished from, “No, we don’t want to work with you, but we might work with you if it turns out that you’re disgustingly cheap.” After you have agreement in principle that, “We want you to work here. What’ll it take to make that happen?” — then and only then do you start negotiating.&lt;/p&gt;

&lt;p&gt;&lt;span id="_2sioyqq"&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;This is &lt;strong&gt;really&lt;/strong&gt; important. Only when everything else is said and done do you negotiate salary. You do not have a foot to stand on until this part. If you try to negotiate off the bat, you’ll be thrown out. The more interviews, forms and tests you’ve taken for the company the better. It costs &lt;strong&gt;thousands&lt;/strong&gt; for a company to get you this far. Some people think that companies just put out adverts and that’s it, people apply and they get jobs filled quickly. This isn’t the truth.&lt;/p&gt;

&lt;p&gt;The truth is that the company has already paid hundreds of thousands just to find applicants. They have to put out adverts, advertise on job boards (which costs money), hire people to write tests and interview questions, hire people to conduct interviews with you, hire people to double check that you can legally work at the company. Sometimes employers will pay you to travel there for an interview. Some employers can conduct as many as 16 interviews over a period of 12 months (Palantir does this for each applicant, not 16 total. 16 interviews for one applicant).&lt;/p&gt;

&lt;p&gt;If you’re applying for a weapons company (BAE Systems) they have to pay to get you security clearance before you’re even allowed to show up on site for an interview.&lt;/p&gt;

&lt;p&gt;The point I’m trying to make is that replacing candidates late in the process isn’t cheap. In fact, it’s incredibly expensive. If you ask for £25,000 more when they’ve spent £100,000 just to get you to that final stage, they’re likely to say yes, as getting someone to that same stage costs too much.&lt;/p&gt;

&lt;p&gt;The sunk cost fallacy is an important economic principle to think about here. If you’ve spent £5,000 on trying to fix a car and you haven’t fixed it yet, you’re more likely to carry on trying to fix that car rather than buy a new one due to the sunk cost fallacy. The same is for jobs. Once you get to the late stages, the company would rather close the deal than find someone new to replace you.&lt;/p&gt;

&lt;p&gt;Do not feel like you owe the company a favour because they have selected you. If the deal makes economic sense, everything will be fine. If not, they’ll replace you. They hold no feelings for you, why should you hold feelings for them?&lt;/p&gt;

&lt;p&gt;When negotiating salary, try to get them to negotiate over email. It gives you time to think about what’s being said and time to reply. You also have concrete proof of a salary in case they try to trick you.&lt;/p&gt;

&lt;p&gt;It never hurts to negotiate, statistics show that 87% of companies won’t pull a job offer if a candidate negotiate their salary (Why You? — James Reed).&lt;/p&gt;

&lt;p&gt;You need to prepare for this question. You need to research what other employees are earning at this company. And what people with the same job title but at different companies are earning. You can use Google, Glassdoor, PayScale to find this information. The location of the job matters too and will affect salary.&lt;/p&gt;

&lt;p&gt;Have 3 numbers in your head. The perfect amount which is the highest amount possible for this job. The lowest amount, at which point you may as well walk away from the job offer and the medium amount, which is the middle of the 2.&lt;/p&gt;

&lt;p&gt;If the company offers you stock options, don’t play around with that. Nothing beats cold hard salary. It’s very unlikely the company you work at is going to be the next Facebook. Try to convert the stock options into cash as soon as you can.&lt;/p&gt;

&lt;p&gt;When you get to the point of emailing the employer, ask “what do you think I’m worth?” or “How much were you thinking?”. The first person to give a solid number loses. You know how in Pawn Stars they always haggle down? That’s because the seller always gives the price first. They know that’s their maximum, so they try to save themselves money.&lt;/p&gt;

&lt;p&gt;Once you give a number the employer will do exactly the same. They’ll haggle down. If the employer gives a salary number first, you can haggle up. You’re in control.&lt;/p&gt;

&lt;p&gt;However, in the real world this probably isn’t going to happen. They’ll likely offer you half of your highest maximum salary number. This is where you can haggle up. They’re allowed to haggle you down, so why don’t you haggle up?&lt;/p&gt;

&lt;p&gt;If you have to fill out a form with the salary you want on it, make it as low as the form will allow you. Try £1, that ought to give them a laugh.&lt;/p&gt;

&lt;p&gt;What if they object to your “never give a number” strategy with something like “I really need a number to move the process forward”?&lt;/p&gt;

&lt;p&gt;Firstly, they’re lying to you. They want you to compromise your negotiating position. You should answer with:&lt;/p&gt;

&lt;p&gt;&lt;span id="_17nz8yj"&gt;&lt;/span&gt;“I’m more concerned at the moment with talking to you about discovering whether we’re a mutual fit. If we’re a great fit, then I can be flexible on the numbers with you and you can be flexible on the numbers with me. If we’re not a great fit, then the numbers are ultimately irrelevant, because your company only hires the best and I only work at roles I would be the best at.”&lt;/p&gt;

&lt;p&gt;If they object again, say:&lt;/p&gt;

&lt;p&gt;&lt;span id="_3rnmrmc"&gt;&lt;/span&gt;“No seriously, I’m more interested in if we’re a good mutual fit or not. Money is irrelevant if we’re not a mutual fit.”&lt;/p&gt;

&lt;p&gt;If they call you out and say “Great try at dodging, but seriously I need a number” there’s a myriad of ways to responded to this. If you’re in STEM you can just say:&lt;/p&gt;

&lt;p&gt;&lt;span id="_26sx1u5"&gt;&lt;/span&gt;“Well, I would hate to walk away from this company over this. Working at the company would have been great for both of us. But you know, I hear the hiring market is tight right now, would you like me to introduce you to other candidates? To save you a few months of you trying to find someone else for this position.”&lt;/p&gt;

&lt;p&gt;STEM has a tight hiring market. It’s tough for companies to find the right employees. There’s more STEM positions to fill than there are employees to take them. You have the advantage here, not them.&lt;/p&gt;

&lt;p&gt;If you’re not in STEM, you can say:&lt;/p&gt;

&lt;p&gt;&lt;span id="_ly7c1y"&gt;&lt;/span&gt;“Well, I’m looking for £[The maximum salary you found out from earlier]”&lt;/p&gt;

&lt;p&gt;Remember what things have been said in the process. If they said “It’s taken 6 months just to find someone to interview” during the interview, use this to your advantage. Say:&lt;/p&gt;

&lt;p&gt;&lt;span id="_35xuupr"&gt;&lt;/span&gt;“I understand that this is a little more money than you might be thinking, but this is an opportunity to get this job position filled without delaying your company for 6 more months”.&lt;/p&gt;

&lt;p&gt;Always put the company’s best interests first. Dale Carnegie’s How to Win Friends and Influence People talks about why people often don’t care about your problems. If you say “we”, and “us” a lot, it opens their mind a lot more to a mutual problem.&lt;/p&gt;

&lt;p&gt;There’s a story floating around about a man who had offers from Google, Apple, Airbnb and more. Over the course of a week, he pitted each company against each other. “Hey Apple, Airbnb is offering me £88,000 and your offer is £80,000. I would like to work at Apple, but the offer from Airbnb is persuasive, what can you do about it?”. Eventually, he got a starting salary of $250,000&lt;sup&gt;7&lt;/sup&gt;. Up from $120,000. Also, if you’re not in STEM, yes Silicon Valley salaries are crazy high. Bear in mind that the average rent is around $2500 a week though.&lt;/p&gt;

&lt;p&gt;What you have to keep in mind is that if you’re applying to Fortune 100 companies, they have so much money that an extra £130,000 is peanuts. Apple is literally worth $1 trillion. £130,000 is absolutely nothing to them. Don’t be afraid of negotiating.&lt;/p&gt;

&lt;h3 id="show-me-your-creativity"&gt;15. Show me your creativity&lt;/h3&gt;

&lt;p&gt;This question can come out in many forms, but they all reference creativity.&lt;/p&gt;

&lt;p&gt;Almost all employers look for creativity.&lt;/p&gt;

&lt;p&gt;Creativity does not have to be you painting a picture or creating a sculpture.&lt;/p&gt;

&lt;p&gt;You might decide to create a Google Sheets document so everyone on your course knows all the deadline dates for course work.&lt;/p&gt;

&lt;p&gt;As with all interview questions it’s important to provide examples here and I can’t tell you what examples to include as I don’t know you.&lt;/p&gt;

&lt;p&gt;Here’s a good answer from here:&lt;/p&gt;

&lt;p&gt;&lt;span id="_452snld"&gt;&lt;/span&gt;“While working at SalesCompany, I developed a lead generalization email that generated an unheard of 37% response rate — well above the previous record of 12%, using a friendly tone that made the email prepare casual and personally written, despite being a template.”&lt;/p&gt;

&lt;h2 id="general-interview-tips"&gt;How to Ace an Interview - General Tips &lt;/h2&gt;

&lt;h3 id="change-uhhhh-to"&gt;Change “uhhhh” to “ “&lt;/h3&gt;

&lt;p&gt;Instead of saying “uhhhh” and “ehhhhhh” just pause. Smile.&lt;/p&gt;

&lt;h3 id="ask-for-a-pause"&gt;Ask for a pause&lt;/h3&gt;

&lt;p&gt;In Karate we have something called a Kata, which is like a dance of all the moves you’re supposed to know at your level. It’s perfectly okay that between moves you take a short pause, a little break to think about what your next move is but when you perform the next move you do it strongly and fast.&lt;/p&gt;

&lt;p&gt;The same can be said for interviews. It’s perfectly okay to say&lt;/p&gt;

&lt;p&gt;&lt;span id="_1yib0wl"&gt;&lt;/span&gt; “Sorry, I’m feeling a little nervous. Do you mind if I have a few seconds to myself, so I can calm down?”&lt;/p&gt;

&lt;p&gt;The interviewer knows your nervous. The difference here is that you’ve recognised this, and you’ve done something to try to mitigate it. Most people who are interviewed are nervous and they never stop being nervous. They just talk and talk and talk and rush through everything.&lt;/p&gt;

&lt;p&gt;In Karate if you rushed through your Kata it would be extremely ugly and convoluted. The same holds for interviews. Do not rush through questions. Don’t even worry about a time limit. If you’re calm and careful the interviewer will keep track of time.&lt;/p&gt;

&lt;h3&gt;What to bring into the interview room&lt;/h3&gt;

&lt;p&gt;Whatever they asked for, but preferably some qualfications, physical portfolios, a copy of your CV. Anything that may help you in the interview.&lt;/p&gt;

&lt;h2 id="questions-to-ask-your-interviewer"&gt;Questions to ask your interviewer&lt;/h2&gt;

&lt;p&gt;After an interview you want to make sure to ask questions to seem intrigued. Normally you’ll generate questions when talking to the interviewer but if you can’t think of any here are some useful questions to ask:&lt;/p&gt;

&lt;p&gt;“What skills and experiences would make an ideal candidate?” This question makes the interviewer say out loud what they are looking for&lt;/p&gt;

&lt;p&gt;“How would you describe a typical day and week in this position?” This question is just making sure that you are a good match for the position.&lt;/p&gt;

&lt;p&gt;“When can I expect to hear from you?” This question is handy to prevent your nerves from getting the better of you.&lt;/p&gt;

&lt;p&gt;“Describe the culture of the company.” This makes sure you are comfortable with the culture of the company.&lt;/p&gt;

&lt;p&gt;“What do you like most about working for this company?” This lets you connect with the interviewer on a personal level.&lt;/p&gt;

&lt;p&gt;“Do you have an email address so If I have any questions, I can follow up with you?” This question lets you send a thank you email after every interview.&lt;/p&gt;

&lt;h3 id="small-hints-for-asking-questions"&gt;Small Hints for Asking Questions&lt;/h3&gt;

&lt;p&gt;Avoid questions that are about you like the salary, vacation time, work hours etc.&lt;/p&gt;

&lt;p&gt;Avoid questions that can be answered “yes” or “no”.&lt;/p&gt;

&lt;p&gt;Like most things in job hunting you’ll want to customise these questions per company. The ones above are general but a good specific question about something the interviewer said will show you are listening.&lt;/p&gt;

&lt;h2 id="following-up-after-an-interview"&gt; Following up after an interview&lt;/h2&gt;

&lt;p&gt;After the interview, email the interviewer to say thank you. Try to mention something specific so the interview will remember you. It doesn’t even have to be an email. It can even be on a social network as long as it’s professional.&lt;/p&gt;

&lt;p&gt;Here’s a direct message I sent to someone after going to one of their talks:&lt;/p&gt;

&lt;p&gt;&lt;span id="_13qzunr"&gt;&lt;/span&gt;“Dear Cain, I was at your NatWest talk at the University of Liverpool. I really enjoyed it and I noticed you talked about API’s and Cryptocurrencies. Being a computer scientist, this really intrigued me! Do you happen to have any upcoming talks about fintech, cryptocurrencies, apps or maybe even personal brand development at NatWest?”&lt;/p&gt;

&lt;p&gt;Here’s a message my friend Kunal sent to someone as a follow up:&lt;/p&gt;

&lt;p&gt;“Hello, I was at the technology showcase event in Manchester today and found your input in the panel very interesting. I have already secured a place on the spring week in Radbroke and look forward to potentially working with you.&lt;/p&gt;

&lt;p&gt;&lt;span id="_3nqndbk"&gt;&lt;/span&gt;Many thanks, Kunal Agarwala”&lt;/p&gt;

&lt;p&gt;The key here is to let the person reading the follow up know where they know you from. If you had just interviewed with them, and you talked about your love for cats you can follow up with:&lt;/p&gt;

&lt;p&gt;“Hello! I’m Emma, you interviewed me today and we talked about cats. I just wanted to say thank you for this wonderful opportunity to have an interview at [companies name] and I look forward to potentially working with you.&lt;/p&gt;

&lt;p&gt;&lt;span id="_mn0wn8vu5okk"&gt;&lt;/span&gt;Many thanks,&lt;/p&gt;

&lt;p&gt;&lt;span id="_22vxnjd"&gt;&lt;/span&gt;Emma Smith”&lt;/p&gt;

&lt;h2 id="interview-red-flags"&gt;Interview Red Flags&lt;/h2&gt;

&lt;p&gt;Here are some red flags of interviews, because an interview is a two-way process. The employer is looking for the perfect employee, you’re looking for the perfect job:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Your interviewer is very late. A little late is okay, but very late? They obviously do not care about you.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Your interviewer disrespects members of staff in front of you If they disrespect other members of staff, they are likely going to disrespect you.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;They haven’t read your CV, at all.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;They speak negatively about past employees. Again, if they disrespect past employees, they’ll likely disrespect you.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;They swear and cuss. Not professional. At all.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The company has high turnover, they repeatedly lose employees. There’s a reason they lose a lot of employees.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The company’s online reviews are bad.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If any of these appear in the interview, you should think twice about working there.&lt;/p&gt;

&lt;h2 id="conclusion-3"&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;☐ Have you read your own CV?&lt;/p&gt;

&lt;p&gt;☐ Have you filled out the tables in this chapter?&lt;/p&gt;

&lt;p&gt;☐ Create your own answers to each interview question&lt;/p&gt;

&lt;p&gt;☐ Remember to take it slowly&lt;/p&gt;

&lt;p&gt;☐ Prepare questions to ask your interviewer&lt;/p&gt;

&lt;p&gt;☐ Re-read the answers to the possible interview questions, really get to know them.&lt;/p&gt;

&lt;p&gt;☐ Keep in mind the interview redflags&lt;/p&gt;

&lt;p&gt;☐ Follow up after the interview&lt;/p&gt;

&lt;h2 id="section-5"&gt; &lt;/h2&gt;

&lt;h1 id="section-6"&gt;
&lt;br&gt;
&lt;/h1&gt;

&lt;h1 id="chapter-7---psychometric-tests"&gt;Chapter 7 - Psychometric Tests&lt;/h1&gt;

&lt;p&gt;All of these tests are strictly timed, usually giving you 30 minutes for 30 questions. Some companies do not care if you don’t complete the entire test in time. One recruiter even told me that they make them harder to put people under stress, and it’s not expected for applicants to complete the whole test on time.&lt;/p&gt;

&lt;p&gt;Your employability team may have access to online psychometric tests for you to take. The only way to get good at these tests, is to practice them. I’m not going to walk you through the top 15 most popular questions, as there are many tutorials found online that will allow you to do this.&lt;/p&gt;

&lt;p&gt;If your employability team doesn’t offer psychometric tests, Google “numeracy test free” or “verbal reasoning test free” to find some free ones online.&lt;/p&gt;

&lt;p&gt;If you complete a psychometric test, it is common for them to make you complete another one during an assessment centre or interview. Sometimes, people get their friends to take the tests for them, so this is a way for them to be sure.&lt;/p&gt;

&lt;p&gt;The way I practiced interviewing and psychometric tests is to apply for jobs that I had no interest in. For example, I applied for a technology internship at Tesco - even though I had no intention of actually taking it up. It was good practice. When I applied to companies I did want to work at, the interviews and psychometric tests were a lot easier since I had been through the process before.&lt;/p&gt;

&lt;h2 id="numeracy-tests"&gt;Numeracy Tests&lt;/h2&gt;

&lt;p&gt;A numeracy test is a test designed to gauge how well your daily maths skills are and how well they can be applied to a company's situation. The test will feature a variety of questions. Some questions will involve reading graphs and charts. Other questions will involve calculating percentages or anything you may be expected to do in the job.&lt;/p&gt;

&lt;p&gt;You should use your own calculator. Make sure to know how your calculator works. Most calculators can do amazing things these days, such as calculating percentages easily. There are loads of calculator videos on YouTube to teach you how to use your calculator. I use a Casio FX-991ESPLUS, it's one step down from a graphing calculator but without the cost.&lt;/p&gt;

&lt;p&gt;Make sure to use rough paper for calculations. These psychometric tests are usually done online, even if you're in person. Bring a notebook along to any interviews to perform rough calculations.&lt;/p&gt;

&lt;p&gt;Before you submit an answer, make sure to double check it. Sometimes the online test does not let you go back to a previous answer.&lt;/p&gt;

&lt;p&gt;Also, check your units. These online tests can sometimes trick you, presenting you with data in one unit but asking for data in a different unit. Make sure you know exactly what you're calculating.&lt;/p&gt;

&lt;h2 id="verbal-reasoning"&gt;Verbal Reasoning&lt;/h2&gt;

&lt;p&gt;In the verbal reasoning test, you have to read a paragraph and answer questions about that paragraph. You will normally be able to re-read the paragraph when answering the questions.&lt;/p&gt;

&lt;p&gt;When answering a verbal reasoning test, you should take every word literally. You are being asked a question and the answer is in the paragraph they have given you. Do not try to use outside knowledge to answer a question. The answer should be presented to you somewhere in the text.&lt;/p&gt;

&lt;p&gt;For this reason, it is important to read the questions carefully. Since the answers are given to you in the text, quite often the questions will attempt to trick you.&lt;/p&gt;

&lt;p&gt;Practice makes perfect. You can find verbal reasoning tests by Googling "verbal reasoning test".&lt;/p&gt;

&lt;h2 id="personality-test"&gt;Personality Test&lt;/h2&gt;

&lt;p&gt;A personality test is used to gauge how you behave in different situations and to see if you will fit in with the company's culture.&lt;/p&gt;

&lt;p&gt;A personality test is usually used to tell:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;How you relate to other people&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How you work with other people&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How you work&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Your motivation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Your preferences and attitudes&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The good news is that in a personality test there isn't a clear-cut right or wrong answer. Although there is no right or wrong answer, you can still fail a personality test.&lt;/p&gt;

&lt;p&gt;To do well in this test you need to understand what your employer wants. Once you do, answer accordingly to how you think the perfect employee will answer.&lt;/p&gt;

&lt;h2 id="conclusion-4"&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Practice the tests as much as you can in your own free time.&lt;/p&gt;

&lt;h1 id="chapter-8---presentations"&gt;Chapter 8 - Presentations&lt;/h1&gt;

&lt;h2 id="section-7"&gt; &lt;/h2&gt;

&lt;p&gt;Presentations are difficult. People have written entire books about presentations. In this section, I'm going to try and distil some of the knowledge I have learnt from reading these books.&lt;/p&gt;

&lt;h2 id="passion"&gt;Passion&lt;/h2&gt;

&lt;p&gt;Presentations without passion is just bad noise. Passion is what makes your presentation exciting and enjoyable. Science shows that passion is contagious. You will inspire others if you are passionate. Passion is defined as something profoundly meaningful to you as an individual.&lt;/p&gt;

&lt;p&gt;If you do not have passion, it will be hard to generate enthusiasm for your presentation. You want people to love your presentation. How can they love your presentation if you don’t love it?&lt;/p&gt;

&lt;p&gt;People who are passionate about their subject make better speakers. They inspire their audience in a way that non-passionate people can never do. Ralph Waldo Emerson once said:&lt;/p&gt;

&lt;p&gt;&lt;span id="_32rsoto"&gt;&lt;/span&gt;“Nothing great has ever been achieved without passion.”&lt;/p&gt;

&lt;p&gt;You can have effective slides, amazing body language &amp;amp; a good message, but none of that matters if you aren’t passionate.&lt;/p&gt;

&lt;p&gt;You can’t fake passion. Simon Sinek, a world renowned TED speaker once said:&lt;/p&gt;

&lt;p&gt;&lt;span id="_owjsbvb8sur0"&gt;&lt;/span&gt;“When it comes to presentations, I cheat. I never do a presentation on something I’m not passionate about.”&lt;/p&gt;

&lt;h2 id="stories"&gt;Stories&lt;/h2&gt;

&lt;p&gt;Throughout this book, you’ll have seen that stories make the world go around. No exception to presentations. Stories are the single, most effective way to reach people's hearts and minds. You need to tell a story that emotionally connects you to your audience.&lt;/p&gt;

&lt;p&gt;Your audience has to trust you. If you tell a story with something too esoteric and disconnected from the lives of normal people, it’s harder for your audience to engage with you.&lt;/p&gt;

&lt;p&gt;The audience has to seem like they are on your level. You need to relate to them somehow. Everyone has a family, tell a story about family. If you had to give a presentation on some monthly numbers for SanDisk, you can open up by talking about your love for SanDisk. You can talk about how all of your family photos are on SanDisk. Show them photos of your family on a SanDisk device. Talk about how you’ll only trust SanDisk with your family photos.&lt;/p&gt;

&lt;p&gt;The most effective way of delivering information is through the emotional; connection of a story.&lt;/p&gt;

&lt;p&gt;When you hear:&lt;/p&gt;

&lt;p&gt;&lt;span id="_41wqhpa"&gt;&lt;/span&gt;“The smell of lavender”&lt;/p&gt;

&lt;p&gt;The part of your brain associated with smell activates. When you hear:&lt;/p&gt;

&lt;p&gt;&lt;span id="_2h20rx3"&gt;&lt;/span&gt;“It felt of velvet”&lt;/p&gt;

&lt;p&gt;The part of your brain associated with touch activates. You can make people use their 7 senses by speaking.&lt;/p&gt;

&lt;p&gt;No story is complete without villains or heroes. Make the story have at least one person the audience can root for.&lt;/p&gt;

&lt;p&gt;Start with the end in mind. It’s easy to think about what you want to talk about, but think about what you want the audience to get out of your presentation. Start with the end in mind, or start with a story. These are the most authenticate ways to create stories. To start with the end in mind, deconstruct the final argument you want to give at the end.&lt;/p&gt;

&lt;p&gt;Simon Sinek says don’t start with facts &amp;amp; figures. They don’t attract people’s attention, start with a story. Stories suck people in and get them to pay attention.&lt;/p&gt;

&lt;h2 id="avoid-overused-buzzwords-clichés"&gt;Avoid overused buzzwords &amp;amp; clichés&lt;/h2&gt;

&lt;p&gt;These are empty, meaningless. Overused metaphors are boring. In a study, overused metaphors like “a rough day” are treated simply as words akin to “and”, “hello” and other boring words.&lt;/p&gt;

&lt;h2 id="conversation-not-lecture"&gt;Conversation, not lecture&lt;/h2&gt;

&lt;p&gt;You don’t want to sit at the front of a room and lecture to people, you want to have a conversation with the audience as if you were talking to a close friend. Practice relentlessly until you can give your presentation as if you were just having a normal conversation.&lt;/p&gt;

&lt;p&gt;There are four elements to verbal delivery, these are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Rate - The speed at which you speak.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pitch - The pitch at which you speak.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Volume - How loud or quiet you are.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pauses - How many pauses you use.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When you’re forced to read a university textbook, it’s natural to highlight import sentences. The verbal equivalent is to alter one of the four elements of verbal delivery.&lt;/p&gt;

&lt;p&gt;Pace is how fast or slowly you talk. The perfect pace to use is always slower than your normal conversation rate. You want to be slow. You want everyone to understand each word you say. If you speak at a normal conversational rate, it may bore some people.&lt;/p&gt;

&lt;p&gt;Alongside pace, the average TED talk length is 18 minutes. In fact, almost no TED talks are longer than 18 minutes. TED has found that 18 minutes is perfect, so it’s best to stick to this rule. If your presentation has to be more than 18 minutes - switch it up and add some breaks in. Get some audience participation going.&lt;/p&gt;

&lt;p&gt;You should switch up the four elements of verbal delivery in order to make your presentation interesting.&lt;/p&gt;

&lt;p&gt;Don't be monotone. You'll bore the audience. A presentation is a form of entertainment, make sure to entertain the audience by acting excited and speaking well.&lt;/p&gt;

&lt;h2 id="pictures"&gt;Pictures&lt;/h2&gt;

&lt;p&gt;Pictures attract people. Pictures are worth a thousand words. Ever watched an Apple / TED presentation? You’ll notice that they barely have any words. Try to disclude as much text as possible in replacement for pictures. If you’re talking at the same time as a wall of text on the presentation, the audience won’t know what to read / listen to and will get confused.&lt;/p&gt;

&lt;p&gt;Although don't be afraid to write. If you need some text on there to convey a message, put some text on there.&lt;/p&gt;

&lt;h2 id="body-language"&gt;Body Language&lt;/h2&gt;

&lt;p&gt;Gestures make a strong argument even stronger. The world’s most charismatic leaders use great body language.&lt;/p&gt;

&lt;p&gt;Studies have shown that complex thinkers use gestures and that the gestures give the audience confidence in the speaker. Some people go as far to say that talking to someone is 80% body language, 20% talking.&lt;/p&gt;

&lt;p&gt;The simplest fix for a presentation lacking effective body language is to use hand gestures. Many presenters have their hands by their sides when they present. This bores people to death. You want to use hand gestures to help convey your messages.&lt;/p&gt;

&lt;p&gt;In a study published in the Journal of Experimental Science, Bob Fennis and Marielle Seel performed ground-breaking studies on hand gestures in supermarkets. 71% of people were more likely to buy a box of sweets when a sales representative displayed an eager-nonverbal style rather than one who had a more reserved style. The sales representative who had better body language and gestures had a higher sales rate.&lt;/p&gt;

&lt;p&gt;Don’t go overboard with hand gestures. Your gestures should be natural, if you force it it’ll come across as ill-conceived.&lt;/p&gt;

&lt;p&gt;Most speakers keep their hands in their pockets when talking. Don’t do this. It makes you appear uninteresting and boring.&lt;/p&gt;

&lt;p&gt;It’s not enough to rehearse the words when you’re practicing. The presentation is 80% body language, 20% speaking. Why only practice the speaking part when your body language is 4 times more important? You need to stand up and practice the movements, the motions of speaking.&lt;/p&gt;

&lt;h2 id="novelty"&gt;Novelty&lt;/h2&gt;

&lt;p&gt;Novelty and interesting are almost synonyms. Novelty is defined as:&lt;/p&gt;

&lt;p&gt;&lt;span id="_19mgy3x"&gt;&lt;/span&gt;“The quality of being new, original, or unusual”&lt;/p&gt;

&lt;p&gt;Reveal something new or unique. Or offer a new answer to an old problem to your audience. The human brain loves novelty much like how it loves stories.&lt;/p&gt;

&lt;p&gt;Martha Burns, a neuroscience professor at the North-western University says that learning something new activates the same area in your brain as gambling does. When dopamine is present in the brain, we tend to remember more than when it is not. Novelty creates this dopamine effect in your brain. Burns says that the easiest way to create dopamine in your audience is to make information new and exciting. The very definition of novelty.&lt;/p&gt;

&lt;h2 id="be-emotional"&gt;Be emotional&lt;/h2&gt;

&lt;p&gt;If you connect with an audience’s emotional side, they will be more receptive and less distracted.&lt;/p&gt;

&lt;h2 id="statistics"&gt;Statistics&lt;/h2&gt;

&lt;p&gt;Every single great presentation contains some kind of statistic. Whether that’s information being portrayed in a new light or just a plain old statistic. The best statistics are jaw-dropping statistics. Take this quote from a TED talk as an example:&lt;/p&gt;

&lt;p&gt;&lt;span id="_nwp17c"&gt;&lt;/span&gt;“Why are we ignoring the oceans? If you compare NASA’s annual budget to explore the heavens, that one-year budget will fund NOAA’s budget to explore the oceans for 1600 years.”&lt;/p&gt;

&lt;p&gt;Persuasion occurs when you reach a person’s head and heart. Make numbers meaningful. Don’t just give them out as dull numbers, put life into them.&lt;/p&gt;

&lt;h2 id="dont-be-too-serious"&gt;Don’t be too serious&lt;/h2&gt;

&lt;p&gt;Humans love humour. Don’t take your subject too seriously and learn to make a joke now and again. When we meet people with good humour, we are more likely to attribute other desirable traits to them - such as being smart or being beautiful. By being funny, it’s more likely that your audience will trust you.&lt;/p&gt;

&lt;p&gt;Most laughs in a presentation come from the audience relating to the speaker through a story. If something happened to you and you found it humorous, there’s a good chance that others will also find it funny.&lt;/p&gt;

&lt;h2 id="flow"&gt;Flow&lt;/h2&gt;

&lt;p&gt;Your presentation slides need to flow from one another like the sea flows into rivers – natural. You don’t find many people marking the exact spot where the sea becomes a river, because it’s natural and flows well. Your presentation slides need to flow just as well.&lt;/p&gt;

&lt;h2 id="standing"&gt;Standing&lt;/h2&gt;

&lt;p&gt;Do not stand in front of the screen when presenting. Stand away from the screen. Your presentation shouldn’t have so much text and images that you need to physically point to them.&lt;/p&gt;

&lt;p&gt;The rule of 3 states that a list of 3 things is more interesting than a list of 2 things. Leverage this to engage your audience. A presentation is all about engaging and entertaining your audience. By limiting slides to a maximum of 3 items you limit the need to physically point at your slides.&lt;/p&gt;

&lt;p&gt;Feel free to repeat points. You can use the rule of three to repeat a point twice or 3 times or to add humour to your presentation. As an example, a presentation slide could look to answer the question "What's the most popular way people prepare to present?"&lt;/p&gt;

&lt;h2 id="templates-templates-templates"&gt;Templates templates templates&lt;/h2&gt;

&lt;p&gt;Templates are what makes the world go around. Use a template. Templates can be leveraged to create nice looking presentations in a short period of time.&lt;/p&gt;

&lt;h2 id="practicing-your-presentation"&gt;Practicing your presentation&lt;/h2&gt;

&lt;p&gt;Your presentation, although it looks amazing on your laptop, may look horrible on a larger screen. If you do not have access to a larger screen to test, use high quality images and graphics. Images ending in the ".png" file extension are high quality and can scale well.&lt;/p&gt;

&lt;p&gt;You can become amazing at presentations by practicing. No one starts out naturally good at anything, with some practice you can be in the top 10% of presenters. In many cities around the United Kingdom there are presentation practice groups. I recommend finding one of these groups by Googling it. If you don't want to go to one of these events you can practice at home but try to make sure people are watching, you.&lt;/p&gt;

&lt;p&gt;The most important key to public speaking is confidence. You can only build confidence by publicly speaking, not by reading a book on it. Your first presentations may not be the best, but with practice and time you'll get so much better.&lt;/p&gt;

&lt;p&gt;Always record your presentations if you can and look back on them later on, correcting any issues and mistakes you may have had. Keep a log / diary of all the presentations you’ve done and how you can improve. Self-improvement is the only improvement that matters. If you constantly seek to improve yourself, nothing can stop you.&lt;/p&gt;

&lt;p&gt;"If you are not willing to learn, no one can help you. If you're willing to learn, no one can stop you."&lt;/p&gt;

&lt;p&gt;Know your audience before you create a presentation. You have to customise your presentation to your audience. Customisation. The number one key to anything in this book is customisation.&lt;/p&gt;

&lt;p&gt;If you're talking to a very technical audience than a technical presentation will be good. If you're talking to a non-technical audience then it won't go so well.&lt;/p&gt;

&lt;p&gt;Think about what idea do you want people to leave your presentation with. Your presentation should present one solid idea distilled through many slides. It can answer a question, it can present a question, it can give a new mental model. Once you understand the purpose of the presentation you can begin to tailor it and improve it.&lt;/p&gt;

&lt;p&gt;Humour in the presentation is amazing. Your job is to distil an idea into the audience in an entertaining fashion. Humour helps you do this, and it keeps the audience engaged. No one likes being forced to listen / watch a boring presentation.&lt;/p&gt;

&lt;h2 id="conclusion-5"&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Next time you have to create a presentation, re-read this chapter and apply some of these rules. Practice it, a lot. You’ll get better the more you do presentations.&lt;/p&gt;

&lt;h2 id="section-8"&gt; &lt;/h2&gt;

&lt;h1 id="section-9"&gt;
&lt;br&gt;
&lt;/h1&gt;

&lt;h1 id="chapter-9---projects"&gt;Chapter 9 - Projects &lt;/h1&gt;

&lt;p&gt;Projects are vital to your university life. No one cares about your university degree, unless you get less than a 2:1. If you get a 2:1 or a first, congratulations. You’re just like every other person that has applied to the job. Because of this, the company doesn’t care.&lt;/p&gt;

&lt;p&gt;Don’t get me wrong, if you have less than a 2:1 then most large companies will just push you aside. If you do get a 2:1 or above, the companies don’t care but will still give you a chance. It’s mean, right? Because your university degree doesn’t matter, you need to differentiate yourself. Thousands of other applicants all have the same degree, what do you have that others do not?&lt;/p&gt;

&lt;p&gt;Projects are what will make you stand out. Whether it’s a project in an internship or projects you’ve taken on outside of university. Internships and projects in this day and age are just as necessary as a university degree to get a good job.&lt;/p&gt;

&lt;p&gt;If you’re a coder or designer, congratulations! All you need to do is design / code things in your spare time. That’s it. Just pick problems and fix them, design things. In fact, if you’re doing any technical degree, I would argue that you could easily do the technicalities in your spare time. Are you a chemist? You can start a YouTube channel about chemistry. If you’re an engineer, just engineer things outside of your degree.&lt;/p&gt;

&lt;p&gt;When in doubt, create content around your subject. Sure, sometimes you’re an engineer of oil rigs. You can’t just build an oil rig in your spare time. But what you can do is teach others, create content about oil rigs.&lt;/p&gt;

&lt;p&gt;If you’re doing a Bachelor of Arts, create things. Content creation is one of the easiest projects you can do and will make you stand out. Companies want to hire people who are so passionate about their subject that some of their free time is spent in the subject, rather than someone who only goes to university and that’s it.&lt;/p&gt;

&lt;p&gt;If no one else is creating content for your subject, perfect! No competition. You’ll look even more amazing when you graduate. Don’t be afraid to try new things. Failure is what it’s called when you give up. If you never give up, you never fail. Learn from your mistakes and make great content.&lt;/p&gt;

&lt;h2 id="preprojects"&gt;Preprojects&lt;/h2&gt;

&lt;p&gt;A preproject is a project you work on prior to working at the company you have applied for. The project benefits the company. Let’s see an example.&lt;/p&gt;

&lt;p&gt;There's an engineer called Nina who wanted to work at Airbnb. She created Nina4AirBnB.com to display what Airbnb are doing wrong and how they can improve it. Nina also talked about emerging markets such as introducing Airbnb into Dubai.&lt;/p&gt;

&lt;p&gt;Because Nina had worked on this pre-project, she got an interview straight away. A pre-project takes time, research and dedication, but what better way to show your interest in a company than providing this for free? Once you've made a pre-project, you're almost guaranteed an interview.&lt;/p&gt;

&lt;p&gt;The difference between you and everyone else applying is not much. Some of you may have gotten better grades, others may have interesting hobbies. But you're all graduate university students, you need a way to stand out. If you complete a pre-project, not only will you stand out, but you'll be one of the only people being interviewed who has worked on the company.&lt;/p&gt;

&lt;p&gt;A pre-project will get you noticed, will make you unique and will get your foot in the door. At YCombinator’s Startup school they talk about how all employees must be passionate and dedicated to the business. It is rumoured that at Airbnb they ask the question “If you only have 1 year to live, would you still work here?” to see how passionate someone is about their cause. You can represent how passionate you are about a company’s cause by working on a pre-project.&lt;/p&gt;

&lt;p&gt;Pre-projects don't only work for a technical role, they can work for any business that has projects. And all businesses have projects.&lt;/p&gt;

&lt;p&gt;As an example, you wanted to work at an amusement park like Thorpe Park. You can research and suggest an event for them based on your research. As an example, you could suggest that around Easter time they create an Easter event, like Fright Nights. Of course, you'll be a lot more creative than I am.&lt;/p&gt;

&lt;p&gt;To create a pre-project, you need to understand what the company can do better. Can they expand into emerging markets? Is their website accessible? How can this website cater to a younger audience? Once you know what they can do better, you can begin to work on the pre-project.&lt;/p&gt;

&lt;p&gt;The exact style and method you use for this project depends on what you are aiming to achieve. Make sure the document is divided up into sections and each section contains a goal. For example, to appeal to a younger audience you can have this section:&lt;/p&gt;

&lt;p&gt;&lt;span id="_3lbifu6"&gt;&lt;/span&gt;“Open a Snapchat account and regularly use it. 80% of millennials have a Snapchat account and thus this is a good platform to communicate with the younger generation.”&lt;/p&gt;

&lt;p&gt;If you do write something like this, make sure you write an "engagement plan". How you plan on growing the Snapchat account, how you'll engage with people directly through it. I know these sucks, since everyone our age knows Snapchat but older people like having plans for everything to do with social media.&lt;/p&gt;

&lt;p&gt;Once you've written a section, clearly define how you are the right person for this job. For example:&lt;/p&gt;

&lt;p&gt;&lt;span id="_20gsq1z"&gt;&lt;/span&gt;“Not only do I regularly use Snapchat, but I've used Snapchat professionally for a business before.”&lt;/p&gt;

&lt;p&gt;The idea is to not only display what you think they can do better, how they can do better, but to show that you are the person to execute these things. If you do not show you are the right person for the job, they'll simply take your plan and give it to someone else.&lt;/p&gt;

&lt;p&gt;It's all well and good creating a pre-project, but how are you going to get people to see your project? If no one sees it, then it would never have mattered. Nina created her website using Wix, which is a website designed to easily create an online website. You can use Squarespace, Wordpress or plain old HTML &amp;amp; CSS to build a website. There are many, many guides out there on how to build your own website, so that won't be covered here. Just understand that creating a website can be as easy as creating a PowerPoint presentation.&lt;/p&gt;

&lt;p&gt;If you don't want to create a website, you can create a PDF document or presentation to show off. It won't look as good as a website does, but it'll get the job done.&lt;/p&gt;

&lt;p&gt;Once you've created a nice website or document to show, you need to find the right people or person to show it to.&lt;/p&gt;

&lt;p&gt;Log into your LinkedIn profile and search for the company you want to work for. Click on "connections" in the tab and select "first and second connections". This will show you all your connections at the company, as well as connections of connections at the company. Go through the search and look for people in the appropriate department. If you found some cyber security bugs in their website, look for someone on their cyber security / networking team.&lt;/p&gt;

&lt;p&gt;If you can't find anyone on LinkedIn, not to worry. Find an online forum about that company by searching "[company] forum". Try to find a subreddit for the company if this doesn't work.&lt;/p&gt;

&lt;p&gt;If you can't find any subreddits or forums, find an email address. Every company has some sort of email address you can send email to.&lt;/p&gt;

&lt;p&gt;Once you've found the person / place to target, here's how you want to write it out. You'll want to explain who you are, what you've done, and tell them to pass it on if they aren't the right person.&lt;/p&gt;

&lt;p&gt;Here's an example:&lt;/p&gt;

&lt;p&gt;“Dear Chris, I’ve seen that Bank of America’s website isn’t accessible by everyone. I’ve redesigned it and written about it here [link here]. I would be grateful if you or someone you know could have a read and improve Bank of America’s website. Kind regards, Brandon”&lt;/p&gt;

&lt;p&gt;If you're posting into a forum, you can write:&lt;/p&gt;

&lt;p&gt;“Hey all! I really want to work for [company]. I've noticed some things about [company] and written up an improvement proposal here. What do you think?”&lt;/p&gt;

&lt;p&gt;The important thing here is that in the first one, don't ask for a job position directly from the person. In How to Win Friends and Influence People, Carnegie talks about never directly asking someone for something but making them think about it first. The idea is to talk to them, to make them friends with you. Once you've built up this position you may be offered a job, if not, you can ask. But never out-right ask for a job as your first message.&lt;/p&gt;

&lt;p&gt;You want them to think that they decided to hire you on their own merit, not based off of something that you have said or done.&lt;/p&gt;

&lt;h2 id="conclusion-6"&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;☐ Decide on what projects you're going to create&lt;/p&gt;

&lt;p&gt;☐ Work on those projects&lt;/p&gt;

&lt;p&gt;☐ Share those projects&lt;/p&gt;

&lt;p&gt;☐ Repeat&lt;/p&gt;

&lt;h1 id="section-10"&gt;
&lt;br&gt;
&lt;/h1&gt;

&lt;h1 id="chapter-10---networking-career-fairs"&gt;Chapter 10 - Networking &amp;amp; Career Fairs&lt;/h1&gt;

&lt;p&gt;Career Fairs. If you’re a university student, it is likely this word has been shoved down your throat since the October you arrived. Truth is, career fairs aren’t anything like how you imagined them. Some universities like to present career fairs as a way to get a job for graduation. Truth is, a careers fair is just a giant advertisement for hundreds of companies. No company will give you a job at a careers fair, instead they’ll redirect you to their website, so you can apply.&lt;/p&gt;

&lt;p&gt;What is the point of a careers fair then? Networking. Sure, you may not get a job directly from a careers fair, but meeting people &amp;amp; networking - that’s the reason you go. Your net worth is your network. Make friends with the people working at these companies. Ask them for tips on applying.&lt;/p&gt;

&lt;p&gt;The easiest way to get a job at a large company is by knowing someone on the inside and getting recommended. The easiest way to know someone on the inside is to attend careers fairs.&lt;/p&gt;

&lt;h2 id="should-i-bring-business-cards"&gt;Should I bring business cards?&lt;/h2&gt;

&lt;p&gt;Some people bring business cards to career fairs, but truth is outside of Asia they’re not really much of a thing. You can have them, but it’s unlikely that people will care about them as much as they might in other parts of the world.&lt;/p&gt;

&lt;h2 id="how-do-i-research-a-company"&gt;How do I research a company?&lt;/h2&gt;

&lt;p&gt;Most career fairs will publish a list of companies that will be attending. Often, this is a form of advertisement to convince people to come as big companies will be there. Use this list to decide what companies are the most important for you to see.&lt;/p&gt;

&lt;p&gt;Once you’ve made this list, research the companies. Not extensive research like it’s an interview, just some general knowledge about them - enough to be able to make a conversation about the company. Preferably reading their Wikipedia page &amp;amp; checking the news for any mentions of them.&lt;/p&gt;

&lt;h2 id="should-i-print-out-cvs"&gt;Should I print out CVs?&lt;/h2&gt;

&lt;p&gt;Print out copies of your CV and hand these out if companies don’t have a webpage / spreadsheet where they want you to input you email address. Often, smaller companies will prefer physical CVs to an online application.&lt;/p&gt;

&lt;h2 id="what-else-should-i-be-doing-beforehand"&gt;What else should I be doing beforehand?&lt;/h2&gt;

&lt;p&gt;Practice your elevator pitch. An elevator pitch is a 30 second pitch designed to let someone roughly know what you’re about. It should feature your current positions, any important past positions and your general goals and life motto. Mine is:&lt;/p&gt;

&lt;p&gt;&lt;span id="_3d0wewm"&gt;&lt;/span&gt;“Hi, I’m Brandon. Obsessive Learner and Problem Solver. Future world changer. Currently a computer science student at the University of Liverpool and a journalist for Hacker Noon. Previously Higher Education Vice President of the East Kent Group.”&lt;/p&gt;

&lt;p&gt;Your elevator pitch needs to be persuasive, it should make the listener interested in you. It should detail some skills you know and what your future goals are.&lt;/p&gt;

&lt;p&gt;Avoid rambling when giving an elevator pitch, don’t frown or speak monotonal and don’t restrict yourself to just one elevator pitch. You can have more than 1 depending on who you talk to.&lt;/p&gt;

&lt;p&gt;It’s best to make your elevator pitch more orientated to the company than to yourself. That’s right customise it per company. By now, this phrase should be so ingrained in your mind you wake up in cold sweats at 4am screaming “CUSTOMISE IT PER COMPANY”.&lt;/p&gt;

&lt;p&gt;As an example, from your research if you know a company is looking to implement artificial intelligence in their product you can approach the company at the careers fair and say “Hey, my name’s Brandon. I study artificial intelligence and I’ve implemented different forms of AI in companies before. I know your company is looking to implement AI too, I would love to help you.”&lt;/p&gt;

&lt;p&gt;You need to find these problems that the company has, and you need to show them that you are the one that can solve this. If you can prove you are the right person for the job you will get further than someone who isn’t proving themselves.&lt;/p&gt;

&lt;p&gt;Imagine 2 people: James &amp;amp; Eda.&lt;/p&gt;

&lt;p&gt;James approaches the company and says:&lt;/p&gt;

&lt;p&gt;“Hi, my names James. I have a first-class degree in business management, I run a YouTube Channel with 250,000 subscribers and in my spare time I volunteer at Pilgrims hospice”.&lt;/p&gt;

&lt;p&gt;Eda approaches with:&lt;/p&gt;

&lt;p&gt;“Hey, I’m Eda. I understand your company is having trouble getting younger people to sign on to your service. My dissertation was in marketing to young people and as a young person myself I know how to advertise to the new generations. Do you have any opportunities for someone like me to fix this problem at your company?”&lt;/p&gt;

&lt;p&gt;Eda would be the one who got hired, as she made it more about the company than about herself.&lt;/p&gt;

&lt;h2 id="what-to-wear"&gt;What to wear&lt;/h2&gt;

&lt;p&gt;Dress smart. Imagine it’s like a job interview. Most of the other people at the careers fair will be dressed smartly.&lt;/p&gt;

&lt;h2 id="best-questions-to-ask-at-a-careers-fair"&gt;Best Questions to Ask at a Careers Fair&lt;/h2&gt;

&lt;p&gt;The questions to ask can either be generic or tailored to the industry (which usually impresses recruiters but requires prior commercial awareness).&lt;/p&gt;

&lt;p&gt;Some common generic questions to ask are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Where do you see yourself in 5 years’ time? This forces the recruiter to talk about themselves and people love talking about themselves.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;What are some of the interesting projects you are working on right now?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;What are the challenges facing the company?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="general-tips"&gt;General Tips&lt;/h2&gt;

&lt;p&gt;At the very end of every conversation always ask, “can I contact you with further questions, do you have a business card?” and if they don’t write down their name, add their LinkedIn and add a customised message to the add so they know who you are.&lt;/p&gt;

&lt;h2 id="conclusion-7"&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;☐ Know who will be at the careers fair&lt;/p&gt;

&lt;p&gt;☐ Pick a small handful of companies you want to get into&lt;/p&gt;

&lt;p&gt;☐ Become friends with the people running the stalls for these companies&lt;/p&gt;

&lt;p&gt;☐ Ask lots of questions&lt;/p&gt;

&lt;p&gt;☐ Follow up with the friends you've made&lt;/p&gt;

&lt;h1 id="resources"&gt;Resources&lt;/h1&gt;

&lt;p&gt;Note: All links to Amazon in this section are Amazon Associate links. I will get a very small portion of what you pay if you use these links, at no extra cost to you.&lt;/p&gt;

&lt;h2 id="cracking-the-coding-interview"&gt;Cracking the Coding Interview &lt;/h2&gt;

&lt;p&gt;&lt;a href="https://amzn.to/2vJcq5b"&gt;&lt;em&gt;https://amzn.to/2vJcq5b&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cracking the Coding Interview is a monstrous 900-page books on everything you could ever want to know about coding interviews. It’s written by a recruiter for Amazon, Google, Microsoft, Apple. It features 200+ coding problems and walks you through the process for applying to the major tech companies.&lt;/p&gt;

&lt;h2 id="why-you-101-interview-questions-youll-never-fear-again"&gt;Why you? 101 interview questions you’ll never fear again&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://amzn.to/2OP1wDP"&gt;&lt;em&gt;https://amzn.to/2OP1wDP&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This book is written by Reed, who are a recruitment company. The 15 interview questions laid out in this book are answered more completely in this book by Reed.&lt;/p&gt;

&lt;h2 id="crushing-it"&gt;Crushing it! &lt;/h2&gt;

&lt;p&gt;&lt;a href="https://amzn.to/2nmFTyd"&gt;&lt;em&gt;https://amzn.to/2nmFTyd&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Good book on being a social media influence from social media influencer, Gary Vaynerchuk.&lt;/p&gt;

&lt;h2 id="how-to-win-friends-and-influence-people"&gt;How to Win friends and influence people&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://amzn.to/2AYnv8e"&gt;&lt;em&gt;https://amzn.to/2AYnv8e&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you interact with other humans, you need this book. If you have ever talked to someone or seen another human, this book is what you need. Everybody should read this book. No exceptions.&lt;/p&gt;



&lt;ol&gt;
&lt;li id="fn1"&gt;&lt;p&gt;&lt;a href="https://www.themuse.com/advice/185-powerful-verbs-that-will-make-your-resume-awesome"&gt;&lt;em&gt;https://www.themuse.com/advice/185-powerful-verbs-that-will-make-your-resume-awesome&lt;/em&gt;&lt;/a&gt; accessed at 07/08/2018.↩&lt;/p&gt;&lt;/li&gt;
&lt;li id="fn2"&gt;&lt;p&gt;Only if you must be a certain age for the job, such as selling alcohol.↩&lt;/p&gt;&lt;/li&gt;
&lt;li id="fn3"&gt;&lt;p&gt;Unless it is required for the job E.G eye test for commercial driving.↩&lt;/p&gt;&lt;/li&gt;
&lt;li id="fn4"&gt;&lt;p&gt;Only if there are requirements of the job that cannot be met with reasonable adjustments or the recruiter is asking to find out how to support you during the process. An employer is allowed to treat a disabled person more favourably than a non disabled person, so it may be best to put this down in some cases. Source: https://www.gov.uk/employer-preventing-discrimination/recruitment↩&lt;/p&gt;&lt;/li&gt;
&lt;li id="fn5"&gt;&lt;p&gt;An employer is allowed to choose someone who is under-represented such as Women in Tech over someone who is not under-represented, so it may be best to put this down if it helps your application. Source: https://www.gov.uk/employer-preventing-discrimination/recruitment↩&lt;/p&gt;&lt;/li&gt;
&lt;li id="fn6"&gt;&lt;p&gt;https://blog.twitter.com/official/en_us/a/2014/what-fuels-a-tweets-engagement.html↩&lt;/p&gt;&lt;/li&gt;
&lt;li id="fn7"&gt;&lt;p&gt;https://haseebq.com/farewell-app-academy-hello-airbnb-part-ii/↩&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;h1&gt;🚨 Scrolled straight to the bottom? 😉&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://page.skerritt.blog/job/"&gt;In the time it took you to do that, you could have obtained the PDF 😜 Click here for the PDF!&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;/p&gt;

</description>
      <category>career</category>
      <category>beginners</category>
      <category>opensource</category>
      <category>showdev</category>
    </item>
    <item>
      <title>What essential software do you install on a new computer?</title>
      <dc:creator>Autumn</dc:creator>
      <pubDate>Sun, 24 Nov 2019 13:57:14 +0000</pubDate>
      <link>https://dev.to/brandonskerritt/what-essential-software-do-you-install-on-a-new-computer-32n</link>
      <guid>https://dev.to/brandonskerritt/what-essential-software-do-you-install-on-a-new-computer-32n</guid>
      <description></description>
      <category>discuss</category>
    </item>
    <item>
      <title>Saving £1440 a year by switching from ConvertKit to Sendy 💐</title>
      <dc:creator>Autumn</dc:creator>
      <pubDate>Tue, 19 Nov 2019 14:15:42 +0000</pubDate>
      <link>https://dev.to/brandonskerritt/saving-1440-a-year-by-switching-from-convertkit-to-sendy-1j9i</link>
      <guid>https://dev.to/brandonskerritt/saving-1440-a-year-by-switching-from-convertkit-to-sendy-1j9i</guid>
      <description>&lt;p&gt;This is the story of how I saved £1440 a year. By reading this, you might also be able to save yourself some money every year.&lt;/p&gt;

&lt;p&gt;My blog itself costs about £350 a year, but my newsletter costs me £948 a year. &lt;/p&gt;

&lt;p&gt;Soon I'll hit the 8,000 mark. My email list will then cost £120! £1440 per year!&lt;/p&gt;

&lt;p&gt;At £120 a month on ConvertKit, it just didn't make sense.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F0d2twu8uvyngvti28bnz.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F0d2twu8uvyngvti28bnz.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The most costly part of my blog wasn't the blog itself, but instead an email list I maintained. How is this right? And here's the kicker - the more subscribers I get, the more exponentially expensive it grows. Even if I wasn't sending emails!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F32crgy5rj8f6xztfntjt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F32crgy5rj8f6xztfntjt.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My blog itself costs 17% of my total yearly spending. My email list costs 77%. This just doesn't make sense. Why am I spending so much money on my email list, but none on my blog?&lt;/p&gt;

&lt;p&gt;So I set about finding an alternative. I went through many free trials. Mailerlite, Mailchimp, Email Octopus. All of them grew with how many subscribers I had. &lt;/p&gt;

&lt;p&gt;The bigger my subscriber list became, the more expensive it became to communicate to them. I was seriously considering just storing a plain CSV file and using Gmail to send emails. But then, I discovered Sendy.&lt;/p&gt;

&lt;h1&gt;
  
  
  Sendy
&lt;/h1&gt;

&lt;p&gt;Sendy's website starts with:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Your subscriber base is growing and so is the cost per campaign. Going for the monthly plan means wasting more money if you don't send newsletters regularly enough.&lt;/p&gt;

&lt;p&gt;You're stuck. The bigger your subscriber base becomes, the more expensive it is to communicate with them. What if you can send without worrying about cost or deliverability?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Which was exactly my problem. I was scared to grow my list because doing so would mean more money spent. &lt;/p&gt;

&lt;p&gt;Sendy uses Amazon's SES to send emails. $0.10 per 1000 emails. If I send 10,000 emails a month, that's £1! &lt;strong&gt;£1 instead of £120.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While researching competitors, I often read "you're not paying to maintain the list, you're paying for the deliverability". &lt;strong&gt;This is not a problem with Sendy&lt;/strong&gt;. It uses Amazon SES which means Amazon handles the deliverability problems.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fqo75bevezyi5ysybg9nu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fqo75bevezyi5ysybg9nu.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sendy has a nice interface like Convertkit, but it is exponentially cheaper. You pay once for Sendy at $59, and then you pay for the Amazon SES fees which as we saw are just $0.10 per 1000 emails. Already in the first month, Sendy is half the price of ConvertKit.&lt;br&gt;
Even with 50,000 subscribers, Sendy costs £20 and ConvertKit costs £379 per month.&lt;/p&gt;

&lt;h1&gt;
  
  
  What are the downsides?
&lt;/h1&gt;

&lt;p&gt;What most people talk about is the deliverability aspect, which doesn't apply at all since Sendy uses Amazon's SES. However, you still have other downsides.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;To install Sendy, you need to create a server, set Sendy up on it (which takes about 2 hours for someone familiar with sysadmin). Then apply to Amazon SES and some other things. &lt;a href="https://sendy.co/get-started" rel="noopener noreferrer"&gt;All outlined on the website&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm not familiar with sysadmin work. It took me around 16 hours, it was my first time doing this okay 😅&lt;/p&gt;

&lt;p&gt;Luckily there are companies such as &lt;a href="https://sendybay.com/" rel="noopener noreferrer"&gt;Sendybay&lt;/a&gt; who do all of the work for you for the low  price of $3.99 a month. Or you can pay the Sendy creator $79 to install it for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Landing page who?
&lt;/h2&gt;

&lt;p&gt;Sendy does not have any landing pages, or pop-ups, or anything. It's all entirely built around the sending email aspect (which, it is very good at). &lt;/p&gt;

&lt;p&gt;It has 1 incredibly blank landing page:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fq34ev2ibn9lazkuqaukn.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fq34ev2ibn9lazkuqaukn.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sendy has an incredibly intuitive API. I'm not good with API's and even I understood it within seconds.&lt;/p&gt;

&lt;p&gt;It's possible to build your landing pages in HTML or CSS or w/e and use the Sendy API to add subscribers.&lt;/p&gt;

&lt;p&gt;But, I'm lazy. I don't want to spend hours working on landing pages, especially when I know nothing about web dev. So I signed up for Leadpages (£25 per month) to solve that issue.&lt;/p&gt;

&lt;p&gt;This still makes it cheaper than Convertkit.&lt;/p&gt;

&lt;p&gt;You can connect Leadpages to Sendy using Zapier, but if you use Zapier the number of subscribers that come from landing pages increases the cost of Zapier exponentially. The same problem we had earlier.&lt;/p&gt;

&lt;p&gt;To get around this, leadpages lets us write custom HTML right into the landing page. I simply inspect element the form, copied it and changed the form's POST and ta-da! We have Sendy integrated directly with Leadpages without the worry of paying more and more for every new subscriber we get.&lt;/p&gt;

&lt;p&gt;Did I mention Leadpages entire business is around making good landing pages, so naturally they are very good at their jobs. &lt;a href="https://page.skerritt.blog/algorithms/" rel="noopener noreferrer"&gt;Just look at how amazing this landing page for my latest book is!&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Templates
&lt;/h1&gt;

&lt;p&gt;Sendy has no templates. Which isn't a problem for me, as I'm a large advocate for plain text emails. &lt;a href="https://convertkit.com/fancy-email-templates" rel="noopener noreferrer"&gt;Check out this post for more on why fancy email templates aren't the answer.&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;With a little bit of knowledge about programming, it's possible to reduce my email list from £1440 a year to £12 a year. Without worrying about having too many subscribers!&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fmb665us745t3lzsbmi71.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fmb665us745t3lzsbmi71.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://page.skerritt.blog/main-signup/" rel="noopener noreferrer"&gt;ps: no affiliate links here. But if you want to sign up to my email list, please do so.&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>A Free Ebook on Greedy Algorithms, Divide &amp; Conquer, and Dynamic Programming </title>
      <dc:creator>Autumn</dc:creator>
      <pubDate>Thu, 24 Oct 2019 11:23:16 +0000</pubDate>
      <link>https://dev.to/brandonskerritt/a-free-ebook-on-greedy-algorithms-divide-conquer-and-dynamic-programming-1712</link>
      <guid>https://dev.to/brandonskerritt/a-free-ebook-on-greedy-algorithms-divide-conquer-and-dynamic-programming-1712</guid>
      <description>&lt;p&gt;This is a book I wrote on Algorithmic Design Paradigms (Greedy, Divide &amp;amp; Conquer, and Dynamic Programming). Gifted to you, for free ✨&lt;/p&gt;

&lt;p&gt;&lt;a href="https://page.skerritt.blog/algorithms/" rel="noopener noreferrer"&gt;Want it in a nicely formatted, typeset PDF?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://page.skerritt.blog/algorithms/" rel="noopener noreferrer"&gt;With extra examples, beautiful graphs + more. &lt;strong&gt;All for free?&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sign up to my email list below and I'll gift it to you 😁&lt;/p&gt;

&lt;p&gt;&lt;a href="https://page.skerritt.blog/algorithms/" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fbrandonskerritt%2FAlgorithmsBook%2Fmaster%2FCapture.PNG"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;👆 Just click this image above&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My book is also on GitHub (just the LaTeX code). Star it! 😁&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/bee-san" rel="noopener noreferrer"&gt;
        bee-san
      &lt;/a&gt; / &lt;a href="https://github.com/bee-san/AlgorithmsBook" rel="noopener noreferrer"&gt;
        AlgorithmsBook
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      📚 My algorithmic design paradigms book! 📚
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;AlgorithmsBook&lt;/h1&gt;

&lt;/div&gt;
&lt;p&gt;This is my repo for my algorithms book!&lt;/p&gt;
&lt;p&gt;Star it if you want :)
You can find my book at &lt;a href="https://skerritt.blog" rel="nofollow noopener noreferrer"&gt;https://skerritt.blog&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;How to get your name added to contributors&lt;/h1&gt;

&lt;/div&gt;
&lt;p&gt;Submit an issue fixing a typo, suggesting a better way to phrase the wording of a sentence or general improvements to the book overall.&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/bee-san/AlgorithmsBook" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;Note: the book has more content and is more up to date than this post. Check it out! 😁&lt;/p&gt;

&lt;h1&gt;
  
  
  Greedy Algorithms
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Greedy algorithms&lt;/strong&gt; aim to make the optimal choice at that given moment. Each step it chooses the optimal choice, without knowing the future. It attempts to find the globally optimal way to solve the entire problem using this method.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Are Greedy Algorithms Called Greedy?
&lt;/h2&gt;

&lt;p&gt;Algorithms are called &lt;em&gt;greedy&lt;/em&gt; when they utilise the greedy property. The greedy property is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;At that exact moment in time, what is the optimal choice to make?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Greedy algorithms are greedy. They do not look into the future to decide the global optimal solution. They are only concerned with the optimal solution locally. This means that the overall optimal solution may be different from the solution the algorithm chooses.&lt;/p&gt;

&lt;p&gt;They never look backwards at what they've done to see if they could optimise globally. This is the main difference between Greedy and &lt;a href="https://skerritt.blog/dynamic-programming/" rel="noopener noreferrer"&gt;Dynamic Programming&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Are Greedy Algorithms Used For?
&lt;/h2&gt;

&lt;p&gt;Greedy algorithms are very fast. A lot faster than the two other alternatives (Divide &amp;amp; Conquer, and Dynamic Programming). They're used because they're fast.&lt;/p&gt;

&lt;p&gt;Most of the popular algorithms using Greedy have shown that Greedy gives the global optimal solution every time. Some of these include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.cs.cmu.edu/~deva/papers/tracking2011.pdf" rel="noopener noreferrer"&gt;Dijkstra's Algorithm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://en.wikipedia.org/wiki/Kruskal%27s_algorithm" rel="noopener noreferrer"&gt;Kruskal's algorithm&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Prim%27s_algorithm" rel="noopener noreferrer"&gt;Prim's algorithm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Huffman_tree" rel="noopener noreferrer"&gt;Huffman trees&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We're going to explore greedy algorithms using a famous example - counting change. There isn't much to this paradigm.&lt;/p&gt;




&lt;h2&gt;
  
  
  How Do I Create a Greedy Algorithm?
&lt;/h2&gt;

&lt;p&gt;Your algorithm needs to follow this property:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;At that exact moment in time, what is the optimal choice to make?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And that's it. There isn't much to it. Greedy algorithms are generally easier to code than &lt;a href="https://dev.to/brandonskerritt/a-gentle-introduction-to-divide-and-conquer-algorithms-1ga"&gt;Divide &amp;amp; Conquer&lt;/a&gt; or &lt;a href="https://skerritt.blog/dynamic-programming/" rel="noopener noreferrer"&gt;Dynamic Programming&lt;/a&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  Counting Change Using Greedy
&lt;/h1&gt;

&lt;p&gt;Imagine you're a vending machine. Someone gives you £1 and buys a drink for £0.70p. There's no 30p coin in &lt;a href="https://en.wikipedia.org/wiki/Pound_sterling" rel="noopener noreferrer"&gt;pound sterling&lt;/a&gt;, how do you calculate how much change to return?&lt;/p&gt;

&lt;p&gt;For reference, this is the denomination of each coin in the UK:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1p, 2p, 5p, 10p, 20p, 50p, £1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The greedy algorithm starts from the highest denomination and works backwards. Our algorithm starts at £1. £1 is more than 30p, so it can't use it. It does this for 50p. It reaches 20p. 20p &amp;lt; 30p, so it takes 1 20p.&lt;/p&gt;

&lt;p&gt;The algorithm needs to return change of 10p. It tries 20p again, but 20p &amp;gt; 10p. It then goes to 10p. It chooses 1 10p, and now our return is 0 we stop the algorithm.&lt;/p&gt;

&lt;p&gt;We return 1x20p and 1x10p.&lt;/p&gt;

&lt;p&gt;This algorithm works quite well in real life. Let's use another example, this time we have the denomination next to how many of that coin is in the machine, &lt;code&gt;(denomination, how many)&lt;/code&gt;.&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;19&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The algorithm is asked to return change of 30p again. 100p (£1) is no. Same for 50. 20p, we can do that. We pick 1x 20p. We now need to return 10p. 20p has run out, so we move down 1.&lt;/p&gt;

&lt;p&gt;10p has run out, so we move down 1.&lt;/p&gt;

&lt;p&gt;We have 5p, so we choose 1x5p. We now need to return 5p. 5p has run out, so we move down one.&lt;/p&gt;

&lt;p&gt;We choose 1 2p coin. We now need to return 3p. We choose another 2p coin. We now need to return 1p. We move down one.&lt;/p&gt;

&lt;p&gt;We choose 1x 1p coin.&lt;/p&gt;

&lt;p&gt;In total, our algorithm selected these coins to return as change:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# (value, how many we return as change)
&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's code something. First, we need to define the problem. We'll start with the denominations.&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;denominations&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="c1"&gt;# 100p is £1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now onto the core function. Given denominations and an amount to give change, we want to return a list of how many times that coin was returned.&lt;/p&gt;

&lt;p&gt;If our &lt;code&gt;denominations&lt;/code&gt; list is as above, then &lt;code&gt;[6, 3, 0, 0, 0, 0, 0]&lt;/code&gt; represents taking 6 1p coins and 3 2p coins, but 0 of all other coins.&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;denominations&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="c1"&gt;# 100p is £1
&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;returnChange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;change&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;denominations&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;toGiveBack&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;denominations&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;coin&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;reversed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;enumerate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;denominations&lt;/span&gt;&lt;span class="p"&gt;))):&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We create a list, the size of denominations long and fill it with 0's.&lt;/p&gt;

&lt;p&gt;We want to loop backwards, from largest to smallest. &lt;code&gt;Reversed(x)&lt;/code&gt; reverses x and lets us loop backwards. Enumerate means "for loop through this list, but keep the position in another variable". In our example when we start the loop. &lt;code&gt;coin = 100&lt;/code&gt; and &lt;code&gt;pos = 6&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Our next step is repeatedly choosing a coin for as long as we can use that coin. If we need to give &lt;code&gt;change = 40&lt;/code&gt; we want our algorithm to choose 20, then 20 again until it can no longer use 20. We do this using a for loop.&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;denominations&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="c1"&gt;# 100p is £1
&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;returnChange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;change&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;denominations&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# makes a list size of length denominations filled with 0
&lt;/span&gt;    &lt;span class="n"&gt;toGiveBack&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;denominations&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# goes backwards through denominations list
&lt;/span&gt;    &lt;span class="c1"&gt;# and also keeps track of the counter, pos.
&lt;/span&gt;    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;coin&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;enumerate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;reversed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;denominations&lt;/span&gt;&lt;span class="p"&gt;)):&lt;/span&gt;
        &lt;span class="c1"&gt;# while we can still use coin, use it until we can't
&lt;/span&gt;        &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;coin&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;change&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While the coin can still fit into change, add that coin to our return list, &lt;code&gt;toGiveBack&lt;/code&gt; and remove it from change.&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;denominations&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="c1"&gt;# 100p is £1
&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;returnChange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;change&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;denominations&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# makes a list size of length denominations filled with 0
&lt;/span&gt;    &lt;span class="n"&gt;toGiveBack&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;denominations&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# goes backwards through denominations list
&lt;/span&gt;    &lt;span class="c1"&gt;# and also keeps track of the counter, pos.
&lt;/span&gt;    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;coin&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;enumerate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;reversed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;denominations&lt;/span&gt;&lt;span class="p"&gt;)):&lt;/span&gt;
        &lt;span class="c1"&gt;# while we can still use coin, use it until we can't
&lt;/span&gt;        &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;coin&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;change&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;change&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;change&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;coin&lt;/span&gt;
            &lt;span class="n"&gt;toGiveBack&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="nf"&gt;return&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;toGiveBack&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;returnChange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;denominations&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="c1"&gt;# returns [0, 0, 0, 1, 1, 0, 0]
# 1x 10p, 1x 20p
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;a href="https://skerritt.blog/you-need-to-understand-big-o-notation-now/" rel="noopener noreferrer"&gt;runtime&lt;/a&gt;of this algorithm is dominated by the 2 loops, thus it is O(n^2).&lt;/p&gt;




&lt;h2&gt;
  
  
  Is Greedy Optimal? Does Greedy Always Work?
&lt;/h2&gt;

&lt;p&gt;It is optimal locally, but sometimes it isn't optimal globally. In the change giving algorithm, we can force a point at which it isn't optimal globally.&lt;/p&gt;

&lt;p&gt;The algorithm for doing this is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pick 3 denominations of coins. 1p, x, and less than 2x but more than x.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We'll pick 1, 15, 25.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ask for change of 2 * second denomination (15)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We'll ask for change of 30. Now, let's see what our Greedy algorithm does.&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[5, 0, 1]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It choses 1x 25p, and 5x 1p. The optimal solution is 2x 15p.&lt;/p&gt;

&lt;p&gt;Our Greedy algorithm failed because it didn't look at 15p. It looked at 25p and thought "yup, that fits. Let's take it."&lt;/p&gt;

&lt;p&gt;It then looked at 15p and thought "that doesn't fit, let's move on".&lt;/p&gt;

&lt;p&gt;This is an example of where Greedy Algorithms fail.&lt;/p&gt;

&lt;p&gt;To get around this, you would either have to create currency where this doesn't work or to brute-force the solution. Or use Dynamic Programming.&lt;/p&gt;

&lt;p&gt;Greedy Algorithms are sometimes globally optimal. From earlier, we saw these algorithms are globally optimal:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.cs.cmu.edu/~deva/papers/tracking2011.pdf" rel="noopener noreferrer"&gt;Dijkstra's Algorithm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://en.wikipedia.org/wiki/Kruskal%27s_algorithm" rel="noopener noreferrer"&gt;Kruskal's algorithm&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Prim%27s_algorithm" rel="noopener noreferrer"&gt;Prim's algorithm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Huffman_tree" rel="noopener noreferrer"&gt;Huffman trees&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are other globally optimal solutions, but Greedy is faster and easier to program than these solutions.&lt;/p&gt;




&lt;h1&gt;
  
  
  Dijkstra's Algorithm
&lt;/h1&gt;

&lt;p&gt;Dijkstra's algorithm finds the shortest path from a node to every other node in the graph. In our example, we'll be using a &lt;a href="https://skerritt.blog/graph-theory/" rel="noopener noreferrer"&gt;weighted directed graph&lt;/a&gt;. Each edge has a direction, and each edge has a weight.&lt;/p&gt;

&lt;p&gt;Dijkstra's algorithm has many uses. It can be very useful within road networks where you need to find the fastest route to a place. The algorithm is also used for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ieeexplore.ieee.org/document/5381955" rel="noopener noreferrer"&gt;IP Routing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/brandonskerritt/a-primer-on-search-algorithms-1768-temp-slug-3978406"&gt;A* Algorithm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.sciencedirect.com/science/article/pii/S0020019006003498" rel="noopener noreferrer"&gt;Telephone networks&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The algorithm follows these rules:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Every time we want to visit a new node, we will choose the node with the smallest known distance.&lt;/li&gt;
&lt;li&gt;Once we've moved to the node, we check each of its neighbouring nodes. We calculate the distance from the neighbouring nodes to the root nodes by summing the cost of the edges that lead to that new node.&lt;/li&gt;
&lt;li&gt;If the distance to a node is less than a known distance, we'll update the shortest distance.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FBlank-Diagram-33-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FBlank-Diagram-33-.png" alt="Greedy Algorithms"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Our first step is to pick the starting node. Let's choose A. All the distances start at infinity, as we don't know their distance until we reach a node that does know the distance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FBlank-Diagram-35-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FBlank-Diagram-35-.png" alt="Greedy Algorithms"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We mark off A on our unvisited nodes list. The distance from A to A is 0. The distance from A to B is 4. The distance from A to C is 2. We updated our distance listing on the right-hand side.&lt;/p&gt;

&lt;p&gt;We then pick the smallest edge where the vertex hasn't been chosen. The smallest edge is A -&amp;gt; C, and we haven't chosen C yet. We visit C.&lt;/p&gt;

&lt;p&gt;Notice how we're picking the smallest distance from our current node to a node we haven't visited yet. We're being greedy. In this case, the greedy method is the global optimal solution.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FBlank-Diagram-36-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FBlank-Diagram-36-.png" alt="Greedy Algorithms"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can get to B from C. We now need to pick a minimum. min(4, 2 + 1) = 3.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FBlank-Diagram-37-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FBlank-Diagram-37-.png" alt="Greedy Algorithms"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since A -&amp;gt; C -&amp;gt; B is smaller than A -&amp;gt; B, we update B with this information. We then add in the distances from the other nodes we can now reach.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FBlank-Diagram-40-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FBlank-Diagram-40-.png" alt="Greedy Algorithms"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Our next smallest vertex with a node we haven't visited yet is B, with 3. We visit B.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FBlank-Diagram-41-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FBlank-Diagram-41-.png" alt="Greedy Algorithms"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We do the same for B. Then we pick the smallest vertex we haven't visited yet, D.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FBlank-Diagram-42-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FBlank-Diagram-42-.png" alt="Greedy Algorithms"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We don't update any of the distances this time. Our last node is then E.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FBlank-Diagram-43-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FBlank-Diagram-43-.png" alt="Greedy Algorithms"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are no updates again. To find the shortest path from A to the other nodes, we walk back through our graph.&lt;/p&gt;

&lt;p&gt;We pick A first, then C, then B. If you need to create the shortest path from A to every other node as a graph, you can run this algorithm using a table on the right hand side.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FScreenshot_2019-06-23-Greedy-Algorithms.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FScreenshot_2019-06-23-Greedy-Algorithms.png" alt="img"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using this table it is easy to draw out the shortest distance from A to every other node in the graph:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FBlank-Diagram-44-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FBlank-Diagram-44-.png" alt="Greedy Algorithms"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Fractional Knapsack Problem Using Greedy Algorithm
&lt;/h2&gt;

&lt;p&gt;Imagine you are a thief. You break into the house of Judy Holliday - &lt;a href="https://en.wikipedia.org/wiki/23rd_Academy_Awards" rel="noopener noreferrer"&gt;1951 Oscar winner for Best Actress&lt;/a&gt;. Judy is a hoarder of gems. Judy's house is lined to the brim with gems.&lt;/p&gt;

&lt;p&gt;You brought with you a bag - a knapsack if you will. This bag has a weight of 7. You happened to have a listing of all of Judy's items, from some insurance paper. The items read as:&lt;/p&gt;

&lt;p&gt;![](&lt;a href="https://skerritt.blog/content/images/2019/06/Screenshot_2019-06-23-Greedy-Algorithms-1-.png" rel="noopener noreferrer"&gt;https://skerritt.blog/content/images/2019/06/Screenshot_2019-06-23-Greedy-Algorithms-1-.png&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first step to solving the fractional knapsack problem is to calculate value/weight for each item.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FScreenshot_2019-06-23-Greedy-Algorithms-2-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FScreenshot_2019-06-23-Greedy-Algorithms-2-.png" alt="img"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And now we greedily select the largest ones. To do this, we can sort them according to value/weight} in descending order. Luckily for us, they are already sorted. The largest one is 3.2.&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;knapsack value = 16
knapsack total weight = 5 (out of 7)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we select Francium (I know it's not a gem, but Judy is a bit strange 😉)&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;knapsack value = 19
knapsack weight = 6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, we add Sapphire. But if we add Sapphire, our total weight will come to 8.&lt;/p&gt;

&lt;p&gt;In the fractional knapsack problem, we can cut items up to take fractions of them. We have a weight of 1 left in the bag. Our sapphire is weight 2. We calculate the ratio of:&lt;/p&gt;

&lt;p&gt;Weight of knapsack left / weight of item&lt;/p&gt;

&lt;p&gt;And then multiply this ratio by the value of the item to get how much value of that item we can take.&lt;/p&gt;

&lt;p&gt;1/2 * 6 = 3&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;knapsack value = 21
knapsack weight = 7
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The greedy algorithm can optimally solve the fractional knapsack problem, but it cannot optimally solve the {0, 1} knapsack problem. In this problem instead of taking a fraction of an item, you either take it {1} or you don't {0}. To solve this, you need to use &lt;a href="https://skerritt.blog/dynamic-programming/" rel="noopener noreferrer"&gt;Dynamic Programming&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://skerritt.blog/you-need-to-understand-big-o-notation-now/" rel="noopener noreferrer"&gt;runtime&lt;/a&gt;for this algorithm is O(n log n). Calculating value/weight is O(1). Our main step is sorting from largest value/weight, which takes O(n log n) time.&lt;/p&gt;




&lt;h2&gt;
  
  
  Greedy vs Divide &amp;amp; Conquer vs Dynamic Programming
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-10.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-10.png" alt="Greedy Algorithms"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Greedy algorithms are very fast, but may not provide the optimal solution. They are also easier to code than their counterparts.&lt;/p&gt;

&lt;h1&gt;
  
  
  Divide &amp;amp; Conquer
&lt;/h1&gt;

&lt;p&gt;Divide and conquer algorithms aren't really taught in programming textbooks, but it's something every programmer should know. Divide and conquer algorithms are the backbone of concurrency and multi-threading.&lt;/p&gt;

&lt;p&gt;Often I'll hear about how you can optimise a for loop to be faster or how switch statements are slightly faster than if statements. Most computers have more than one core, with the ability to support multiple threads. Before worrying about optimising for loops or if statements try to attack your problem at a different angle.&lt;/p&gt;

&lt;p&gt;Divide and Conquer is one of the ways to attack a problem from a different angle. Throughout this article, I'm going to talk about creating a divide and conquer solutions and what it is. Don't worry if you have &lt;strong&gt;zero&lt;/strong&gt; experience or knowledge on the topic. This article is designed to be read by someone with very little programming knowledge.&lt;/p&gt;

&lt;p&gt;I'm going to explain this using 3 examples. The first will be a simple explanation. The second will be some code. The final will get into the mathematical core of divide and conquer techniques. (Don't worry, I hate maths too).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No time to read this?&lt;/strong&gt; &lt;a href="https://pages.convertkit.com/f01a7359c0/8d197d69e0" rel="noopener noreferrer"&gt;Sign&lt;/a&gt; up to my email list to get this in PDF form. You'll also get some extra content that isn't in this post ✨ &lt;a href="https://pages.convertkit.com/f01a7359c0/8d197d69e0" rel="noopener noreferrer"&gt;Sign up here.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is divide and conquer? 🌎
&lt;/h2&gt;

&lt;p&gt;Divide and conquer is where you divide a large problem up into many smaller, much easier to solve problems. The rather small example below illustrates this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2FBlank-Diagram-14-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2FBlank-Diagram-14-.png" alt="A Gentle Introduction to Divide and Conquer Algorithms"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We take the equation "3 + 6 + 2 + 4" and we cut it down into the smallest  possible set of equations, which is [3 + 6, 2 + 4]. It could also be [2 + 3, 4 + 6]. The order doesn't matter, as long as we turn this one long equation into many smaller equations.&lt;/p&gt;

&lt;p&gt;Let’s say we have 8 numbers:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2FBlank-Diagram-43-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2FBlank-Diagram-43-.png" alt="A Gentle Introduction to Divide and Conquer Algorithms"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And we want to add them all together. We first divide the problem into 8 equal sub-problems. We do this by breaking the addition up into individual numbers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2Fimage-33.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2Fimage-33.png" alt="A Gentle Introduction to Divide and Conquer Algorithms"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We then begin to add 2 numbers at a time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2Fimage-34.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2Fimage-34.png" alt="A Gentle Introduction to Divide and Conquer Algorithms"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then 4 numbers into 8 numbers which is our resultant.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2Fimage-35.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2Fimage-35.png" alt="A Gentle Introduction to Divide and Conquer Algorithms"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Why do we break it down to individual numbers at stage 1? Why don't we just start from stage 2? Because while this list of numbers is even if the list was odd you would need to break it down to individual numbers to better handle it.&lt;/p&gt;

&lt;p&gt;A divide and conquer algorithm tries to break a problem down into as many little chunks as possible since it is easier to solve with little chunks. It typically does this with recursion.&lt;/p&gt;

&lt;p&gt;Formally the technique is, as defined in the famous &lt;a href="https://www.amazon.co.uk/Introduction-Algorithms-Thomas-H-Cormen/dp/0262033844/ref=as_li_ss_tl?keywords=Introduction+to+Algorithms&amp;amp;qid=1551954553&amp;amp;s=gateway&amp;amp;sr=8-1&amp;amp;linkCode=ll1&amp;amp;tag=brandon0fe-21&amp;amp;linkId=72a63dce0d8099988383cc3767340d40&amp;amp;language=en_GB" rel="noopener noreferrer"&gt;Introduction to Algorithms&lt;/a&gt; by Cormen, Leiserson, Rivest, and Stein is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Divide&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If the problem is small, then solve it directly. Otherwise, divide the problem into smaller subsets of the same problem.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Conquer&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Conquer the smaller problems by solving them recursively. If the subproblems are small enough, recursion is not needed and you can solve them directly.&lt;/p&gt;

&lt;p&gt;Recursion is when a function calls itself. It's a hard concept to understand if you've never heard of it before. This page provides a good explanation. In short, a recursive function is one like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;recur_factorial&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
   &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;
   &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nf"&gt;recur_factorial&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;recur_factorial&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I'll fully explain the code in a second.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Combine&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Take the solutions to the sub-problems and merge them into a solution to the original problem.&lt;/p&gt;

&lt;p&gt;With the code from above, some important things to note. The Divide part is also the recursion part. We divide the problem up at &lt;code&gt;return n * recur_factorial(n-1)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Specifically, the &lt;code&gt;recur_factorial(n-1)&lt;/code&gt; part is where we divide the problem up.&lt;/p&gt;

&lt;p&gt;The conquer part is the recursion part too, but also the if statement. If the problem is small enough, we solve it directly (by returning n). Else, we perform &lt;code&gt;return n * recur_factorial(n-1)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Combine. We do this with the multiplication symbol. Eventually, we return the factorial of the number. If we didn't have the symbol there, and it was &lt;code&gt;return recur_factorial(n-1)&lt;/code&gt; it wouldn't combine and it wouldn't output anything remotely similar to the factorial. (It'll output 1, for those interested).&lt;/p&gt;

&lt;p&gt;We're going to explore how divide and conquer works in some famous algorithms, Merge Sort and the solution to the Towers of Hanoi.&lt;/p&gt;




&lt;h3&gt;
  
  
  Merge Sort 🤖
&lt;/h3&gt;

&lt;p&gt;Merge Sort is a sorting algorithm. The algorithm works as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Divide the sequence of n numbers into 2 halves&lt;/li&gt;
&lt;li&gt;Recursively sort the two halves&lt;/li&gt;
&lt;li&gt;Merge the two sorted halves into a single sorted sequence&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2FBlank-Diagram-48-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2FBlank-Diagram-48-.png" alt="A Gentle Introduction to Divide and Conquer Algorithms"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this image, we break down the 8 numbers into separate digits. Just like we did earlier. Once we've done this, we can begin the sorting process.&lt;/p&gt;

&lt;p&gt;It compares 51 and 13. Since 13 is smaller, it puts it in the left-hand side. It does this for (10, 64), (34, 5), (32, 21).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2FBlank-Diagram-49-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2FBlank-Diagram-49-.png" alt="A Gentle Introduction to Divide and Conquer Algorithms"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It then merges (13, 51) with (10, 64). It knows that 13 is the smallest in the first list, and 10 is the smallest in the right list. 10 is smaller than 13, therefore we don't need to compare 13 to 64. We're comparing &amp;amp; merging two &lt;strong&gt;sorted&lt;/strong&gt; lists.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2FBlank-Diagram-50-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2FBlank-Diagram-50-.png" alt="A Gentle Introduction to Divide and Conquer Algorithms"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In recursion we use the term &lt;em&gt;base case&lt;/em&gt; to refer to the absolute smallest value we can deal with. With Merge Sort, the base case is 1. That means we split the list up until we get sub-lists of length 1. That's also why we go down all the way to 1 and not 2. If the base case was 2, we would stop at the 2 numbers.&lt;/p&gt;

&lt;p&gt;If the length of the list (n) is larger then 1, then we divide the list and each sub-list by 2 until we get sub-lists of size 1. If n = 1, the list is already sorted so we do nothing.&lt;/p&gt;

&lt;p&gt;Merge Sort is an example of a divide and conquer algorithm. Let's look at one more algorithm to really understand how divide and conquer works.&lt;/p&gt;




&lt;h3&gt;
  
  
  Towers of Hanoi 🗼
&lt;/h3&gt;

&lt;p&gt;The Towers of Hanoi is a mathematical problem which consists of 3 pegs and in this instance, 3 discs. This problem is mostly used to teach recursion, but it does have some &lt;a href="https://www.ibm.com/developerworks/community/blogs/jfp/entry/towers_of_hanoi_at_large1?lang=en" rel="noopener noreferrer"&gt;real world uses.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2FBlank-Diagram-57-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2FBlank-Diagram-57-.png" alt="A Gentle Introduction to Divide and Conquer Algorithms"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each disc is a different size. We want to move all discs to peg C so that the largest is on the bottom, second largest on top of the largest, third largest (smallest) on top of all of them. There are some rules to this game:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;We can only move 1 disc at a time.&lt;/li&gt;
&lt;li&gt;A disc cannot be placed on top of other discs that are smaller than it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We want to use the smallest number of moves possible. If we have 1 disc, we only need to move it once. If we have 2 discs, we need to move it 3 times.&lt;/p&gt;

&lt;p&gt;The number of moves is powers of 2 minus 1. If we have 4 discs, we calculate the minimum number of moves as 2^4 = 16 - 1 = 15.&lt;/p&gt;

&lt;p&gt;To solve the above example we want to store the smallest disc in a buffer peg (1 move). See below for a gif on solving Tower of Hanoi with 3 pegs and 3 discs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2Fgify-1.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2Fgify-1.gif" alt="A Gentle Introduction to Divide and Conquer Algorithms"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Notice how we need to have a buffer to store the discs.&lt;/p&gt;

&lt;p&gt;We can generalise this problem. If we have n discs: move n-1 from A to B recursively, move largest from A to C, move n-1 from B to C recursively.&lt;/p&gt;

&lt;p&gt;If there is an even number of pieces the first move is always into the middle. If there are an odd number of pieces the first move is always to the other end.&lt;/p&gt;

&lt;p&gt;Let's begin to code the algorithm for ToH, in pseudocode.&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function MoveTower(disk, source, dest, spare):
    if disk == 0, then:
        move disk from source to dest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We start with a base case, &lt;code&gt;disk == 0&lt;/code&gt;. &lt;code&gt;source&lt;/code&gt; is the peg you're starting at. &lt;code&gt;dest&lt;/code&gt; is the final destination peg. &lt;code&gt;spare&lt;/code&gt; is the spare peg.&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FUNCTION MoveTower(disk, source, dest, spare):
IF disk == 0, THEN:
    move disk from source to dest
ELSE:
    MoveTower(disk - 1, source, spare, dest) // Step 1
    move disk from source to dest // Step 2
    MoveTower(disk - 1, spare, dest, source) // Step 3
END IF
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice that with step 1 we switch &lt;code&gt;dest&lt;/code&gt; and &lt;code&gt;source&lt;/code&gt;. We do not do this for step 3.&lt;/p&gt;

&lt;p&gt;With recursion, we can be sure of 2 things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It always has a base case (if it doesn't, how does the algorithm know to end?)&lt;/li&gt;
&lt;li&gt;The function calls itself.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The algorithm gets a little confusing with steps 1 and 3. They both call the same function. This is where multi-threading comes in. You can run steps 1 and 3 on different threads - at the same time.&lt;/p&gt;

&lt;p&gt;Since 2 is more than 1, we move it down one more level again. So far you've seen what the divide and conquer technique is. You should understand how it works and what code looks like. Next, let's learn how to formally define an algorithm to a problem using divide and conquer. This part is the most important in my opinion. Once you know this, it'll be exponentially easier to create divide and conquer algorithms.&lt;/p&gt;




&lt;h3&gt;
  
  
  Fibonacci Numbers 🐰
&lt;/h3&gt;

&lt;p&gt;The Fibonacci numbers can be found in nature. The way &lt;a href="http://www.oxfordmathcenter.com/drupal7/node/487" rel="noopener noreferrer"&gt;rabbits produce&lt;/a&gt;is in the style of the Fibonacci numbers. You have 2 rabbits that make 3, 3 rabbits make 5, 5 rabbits make 9 and so on.&lt;/p&gt;

&lt;p&gt;The numbers start at 1 and the next number is the current number + the previous number. Here it’s 1 + 0 = 1. Then 1 + 1 = 2. 2 + 1 = 3 and so on.&lt;/p&gt;

&lt;p&gt;We can describe this relation using a recursion. A recurrence is an equation which defines a function in terms of its smaller inputs. Recurrence and recursion sound similar and are similar.&lt;/p&gt;

&lt;p&gt;With Fibonacci numbers if n = 0 or 1, it results in 1. Else, recursively add f(n-1) + f(n -2) until you reach the base case. Let's start off by creating a non-recursive Fibonacci number calculator.&lt;/p&gt;

&lt;p&gt;We know that if n = 0 or 1, return 1.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;f&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Fibonacci numbers are the last two numbers added together.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;f&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;fibo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="n"&gt;fibroPrev&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;temp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fibo&lt;/span&gt;
        &lt;span class="n"&gt;fibo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fibo&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;fiboPrev&lt;/span&gt;
        &lt;span class="n"&gt;fiboPrev&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;temp&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;fibo&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we've seen this, let's turn it into recursion using a recurrence.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2Fimage-36.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2Fimage-36.png" alt="Formula"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When creating a recurrence, we always start with the base case. The base case here is if n == 0 or 1, return n.&lt;/p&gt;

&lt;p&gt;If we don't return n, but instead return 1 this leads to a bug. For example, F(0) would result in 1. When really, it should result in 0.&lt;/p&gt;

&lt;p&gt;Next, we have the formula. If n isn't 0 or 1, what do we do? We calculate F(n - 1) + F(n - 2). In the end, we want to merge all the numbers together to get our final result. We do this using addition.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2Fimage-37.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2Fimage-37.png" alt="formula"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the formal definition of the Fibonacci numbers. Normally, recurrences are used to talk about the running time of a divide and conquer algorithm. My algorithms professor and I think it's actually a good tool to create divide and conquer algorithms.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;F&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;
  &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;F&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nc"&gt;F&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With knowledge of divide and conquer, the above code is cleaner and easier to read.&lt;/p&gt;

&lt;p&gt;We often calculate the result of a recurrence using an execution tree. Computer overlords 🤖 don't need to do this, but it's useful for humans to see how your divide and conquer algorithm works. For F(4) this looks like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2FBlank-Diagram-30-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F03%2FBlank-Diagram-30-.png" alt="A Gentle Introduction to Divide and Conquer Algorithms"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;n is 4, and n is larger than 0 or 1. So we do f(n-1) + f(n-2). We ignore the addition for now. This results in 2 new nodes, 3 and 2. 3 is larger than 0 or 1 so we do the same. Same for 2. We do this until we get a bunch of nodes which are either 0 or 1. We then add all the nodes together. 1 + 1 + 0 + 0 + 1 = 3, which is the right answer.&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion 📕
&lt;/h2&gt;

&lt;p&gt;Once you've identified how to break a problem down into many smaller pieces, you can use concurrent programming to execute these pieces at the same time (on different &lt;a href="https://www.wikiwand.com/en/Thread_(computing)" rel="noopener noreferrer"&gt;threads&lt;/a&gt;) thereby speeding up the whole algorithm.&lt;/p&gt;

&lt;p&gt;Divide and conquer algorithms are one of the fastest and perhaps easiest ways to increase the speed of an algorithm and are incredibly useful in everyday programming. Here are the most important topics we covered in this article:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is divide and conquer?&lt;/li&gt;
&lt;li&gt;Recursion&lt;/li&gt;
&lt;li&gt;MergeSort&lt;/li&gt;
&lt;li&gt;Towers of Hanoi&lt;/li&gt;
&lt;li&gt;Coding a divide and conquer algorithm&lt;/li&gt;
&lt;li&gt;Recurrences&lt;/li&gt;
&lt;li&gt;Fibonacci numbers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The next step is to explore multithreading. Choose your programming language of choice and Google, as an example, "Python multithreading". Figure out how it works and see if you can attack any problems in your own code from this new angle.&lt;/p&gt;

&lt;p&gt;You can also learn about how to solve recurrences (finding out the asymptotic running time of a recurrence), which is the next article I'm going to write. If you don't want to miss it, or you liked this article do consider subscribing to my email list 😁✨&lt;/p&gt;

&lt;h1&gt;
  
  
  Dynamic Programming
&lt;/h1&gt;

&lt;p&gt;Dynamic programming (DP) is breaking down an optimisation problem into smaller sub-problems, and storing the solution to each sub-problems so that each sub-problem is only solved once.&lt;/p&gt;

&lt;p&gt;It is both a &lt;a href="https://en.wikipedia.org/wiki/Mathematical_optimization" rel="noopener noreferrer"&gt;mathematical optimisation&lt;/a&gt; method and a computer programming method.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Optimisation problems&lt;/em&gt; seek the maximum or minimum solution. Dynamic programming is often used for optimisation problems. The general rule is that if you encounter a problem where the initial algorithm is solved in 2&lt;sup&gt;n&lt;/sup&gt; time, it might be better solved using DP.&lt;br&gt;
&lt;a href="https://b.ck.page" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FCopy-of-technologiclly-clairvoyant.png"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Why Is Dynamic Programming Called Dynamic Programming?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Richard_E._Bellman" rel="noopener noreferrer"&gt;Richard Bellman&lt;/a&gt; invented DP in the 1950s. &lt;a href="https://en.wikipedia.org/wiki/Dynamic_programming#History" rel="noopener noreferrer"&gt;Bellman named it Dynamic Programming&lt;/a&gt; because at the time, RAND (his employer) disliked mathematical research and didn't want to fund it. He named it Dynamic Programming to hide the fact he was really doing mathematical research.&lt;/p&gt;

&lt;p&gt;Bellman explains the reasoning behind the term dynamic programming in his autobiography, Eye of the Hurricane: An Autobiography (1984, page 159). He explains:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I spent the Fall quarter (of 1950) at RAND. My first task was to find a name for multistage decision processes. An interesting question is, Where did the name, dynamic programming, come from? The 1950s were not good years for mathematical research. We had a very interesting gentleman in Washington named Wilson. He was Secretary of Defense, and he actually had a pathological fear and hatred of the word research. I’m not using the term lightly; I’m using it precisely. His face would suffuse, he would turn red, and he would get violent if people used the term research in his presence. You can imagine how he felt, then, about the term mathematical. The RAND Corporation was employed by the Air Force, and the Air Force had Wilson as its boss, essentially. Hence, I felt I had to do something to shield Wilson and the Air Force from the fact that I was really doing mathematics inside the RAND Corporation. What title, what name, could I choose? In the first place I was interested in planning, in decision making, in thinking. But planning, is not a good word for various reasons. I decided therefore to use the word “programming”. I wanted to get across the idea that this was dynamic, this was multistage, this was time-varying. I thought, let's kill two birds with one stone. Let's take a word that has an absolutely precise meaning, namely dynamic, in the classical physical sense. It also has a very interesting property as an adjective, and that is it's impossible to use the word dynamic in a pejorative sense. Try thinking of some combination that will possibly give it a pejorative meaning. It's impossible. Thus, I thought dynamic programming was a good name. It was something not even a Congressman could object to. So I used it as an umbrella for my activities."&lt;/p&gt;
&lt;/blockquote&gt;






&lt;h2&gt;
  
  
  What are Sub-Problems?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fundraw_process_e90d.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fundraw_process_e90d.svg" alt="cover photo image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sub-problems are smaller versions of the original problem. Let's see an example. With the equation below:&lt;/p&gt;

&lt;p&gt;1 + 2 + 3 + 4&lt;/p&gt;

&lt;p&gt;We can break this down to:&lt;/p&gt;

&lt;p&gt;1 + 2&lt;/p&gt;

&lt;p&gt;3 + 4&lt;/p&gt;

&lt;p&gt;Once we solve these two smaller problems, we can add the solutions to these problems to find the solution to the overall problem.&lt;/p&gt;

&lt;p&gt;Notice how this sub-problem breaks down the original problem into components that build up the solution. While this is a small example, it illustrates the beauty of DP well. If we expand the problem to adding 100's of numbers it becomes clearer as to why we need DP. Take this example:&lt;/p&gt;

&lt;p&gt;6 + 5 + 3 + 3 + 2 + 4 + 6 + 5&lt;/p&gt;

&lt;p&gt;We have 6 + 5 twice. We work out what 6 + 5 is the first time. When we see it the second time we think to ourselves:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Ah, 6 + 5. I've seen this before. It's 11!"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In DP we store the solution to the problem in memory so we do not need to recalculate it. By finding the solutions for every single sub-problem, we can tackle the original problem itself.&lt;/p&gt;

&lt;p&gt;The act of storing a solution is called &lt;em&gt;memoisation&lt;/em&gt;.&lt;/p&gt;






&lt;h2&gt;
  
  
  What is Memoisation in Dynamic Programming?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fundraw_task_31wc.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fundraw_task_31wc.svg" alt="cover photo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First, let's see why storing answers to solutions make sense. We're going to look at a famous divide and conquer problem, &lt;em&gt;&lt;a href="https://www.mathsisfun.com/numbers/fibonacci-sequence.html" rel="noopener noreferrer"&gt;Fibonacci sequence&lt;/a&gt;&lt;/em&gt;. &lt;a href="https://dev.to/brandonskerritt/a-gentle-introduction-to-divide-and-conquer-algorithms-1ga"&gt;Divide and conquer&lt;/a&gt; is dynamic programming, but without storing the solution.&lt;/p&gt;

&lt;p&gt;There are 3 main parts to &lt;a href="https://dev.to/brandonskerritt/a-gentle-introduction-to-divide-and-conquer-algorithms-1ga"&gt;divide and conquer&lt;/a&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Divide&lt;/strong&gt; the problem into smaller sub-problems of the same type.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Conquer&lt;/strong&gt; - solve the sub-problems recursively.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Combine&lt;/strong&gt; - Combine all the sub-problems to create a solution to the original problem.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Dynamic programming has one extra step added to step 2. This is memoisation.&lt;/p&gt;

&lt;p&gt;The Fibonacci sequence is a sequence of numbers. It's the last number + the current number. We start at 1.&lt;/p&gt;

&lt;p&gt;1 + 0 = 1&lt;/p&gt;

&lt;p&gt;1 + 1 = 2&lt;/p&gt;

&lt;p&gt;2 + 1 = 3&lt;/p&gt;

&lt;p&gt;3 + 2 = 5&lt;/p&gt;

&lt;p&gt;5 + 3 = 8&lt;/p&gt;

&lt;p&gt;In Python, this is common programmed as:&lt;/p&gt;




&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;F&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;
  &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;F&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nc"&gt;F&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;p&gt;If you're not familiar with recursion I have a &lt;a href="https://dev.to/brandonskerritt/a-gentle-introduction-to-divide-and-conquer-algorithms-1ga"&gt;blog post written for you that you should read first.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's calculate F(4). In an execution tree, this looks like:&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-8.png" alt="What Is Dynamic Programming With Python Examples"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;We calculate F(2) twice. This may be a small example, but on bigger inputs (such as F(10)) the repetition builds up. The purpose of dynamic programming is to not calculate the same thing twice.&lt;/p&gt;

&lt;p&gt;Instead of calculating F(2) twice, we store the solution somewhere and only calculate it once.&lt;/p&gt;

&lt;p&gt;We'll store the solution in an array. F(2) = 1. Our array will then look like memo[2] = 1. Below is some Python code to calculate the Fibbonacci sequence using DP.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;fibonacciVal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;memo&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;memo&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;memo&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;memo&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;memo&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;memo&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The examples set out here are in Python. I’ll do my best to keep the code agnostic. Meaning that if you want to program this in Java, it shouldn’t be too hard to convert it over.&lt;/p&gt;




&lt;h2&gt;
  
  
  How to Identify Dynamic Programming Problems
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fundraw_file_searching_duff.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fundraw_file_searching_duff.svg" alt="cover photo image"&gt;&lt;/a&gt;&lt;br&gt;
In theory, every problem can be solved dynamically. The question is then:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"When should I solve this problem with dynamic programming?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We should use dynamic programming for problems that are on the border between &lt;em&gt;tractable&lt;/em&gt; problems and &lt;em&gt;intracable&lt;/em&gt; problems.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://www.britannica.com/technology/tractable-problem" rel="noopener noreferrer"&gt;Tractable problems&lt;/a&gt;&lt;/em&gt; are those that can be solved in polynomial time. That's just a fancy way of saying we can solve it in a fast manner. Binary search and sorting,are all fast. &lt;em&gt;&lt;a href="https://www.umsl.edu/~siegelj/information_theory/classassignments/Lombardo/04_intractableproblems.html" rel="noopener noreferrer"&gt;Intractable problems&lt;/a&gt;&lt;/em&gt; are those that run in exponential time. They're slow. Generally speaking, intractable problems are those that can only be solved by bruteforcing through every single combination (&lt;a href="https://www.youtube.com/watch?v=YX40hbAHx3s" rel="noopener noreferrer"&gt;NP hard&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;When we see terms such as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"shortest/longest, minimized/maximized, least/most, fewest/greatest, biggest/smallest"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We know it's an optimisation problem.&lt;/p&gt;

&lt;p&gt;Another cool thing with DP algorithms is that their proof of correctness is usually self-evident. Other algorithmic strategies are often much harder to prove correct, and therefore more error-prone.&lt;/p&gt;

&lt;p&gt;For instance, greedy algorithms may seem conceptually simpler, and usually, run faster, but they’re much harder to prove correct because they require making a lot of implicit assumptions about the structure of the input.  &lt;/p&gt;

&lt;p&gt;When we see these kinds of terms, the problem may ask for a specific number ( "find the minimum number of edit operations") or it may ask for a result ( "find the longest common subsequence"). The latter type of problem is harder to recognize as a dynamic programming problem. If something sounds like optimisation, it could be solved by DP.  &lt;/p&gt;

&lt;p&gt;Now, imagine we've found a problem that's an optimisation problem, but we're not sure if it can be solved with DP. First, identify what we're optimising for. Once we realize what we're optimising for, we have to decide how easy it is to perform that optimisation. Sometimes, the &lt;a href="https://brilliant.org/wiki/greedy-algorithm/" rel="noopener noreferrer"&gt;greedy approach&lt;/a&gt; is sufficient for an optimal solution.   &lt;/p&gt;

&lt;p&gt;Dynamic programming takes the brute force approach. It Identifies repeated work, and eliminates the repetition.&lt;/p&gt;

&lt;p&gt;Before we even start to formulate the problem as a dynamic programming problem, we think about what the brute force solution might look like. Could there possibly be repeated substeps in the brute force solution? If so, we try to formulate the problem as a dynamic programming problem.&lt;/p&gt;

&lt;p&gt;Mastering dynamic programming is all about understanding the problem. List all the inputs that can affect the answers. Once we've identified all the inputs and outputs, try to identify whether the problem can be broken into subproblems. If we can identify subproblems, we can probably use DP.   &lt;/p&gt;

&lt;p&gt;List all inputs that affect the answer, and worry about reducing the size of that set later.  Once we have identified the inputs and outputs, we try to identify whether the problem can be broken into smaller subproblems. If we can identify smaller subproblems, then we can probably apply dynamic programming to solve the problem. Then, figure out what the recurrence is and solve it. When we're trying to figure out the recurrence, remember that whatever recurrence we write has to help us find the answer. Sometimes the answer will be the result of the recurrence, and sometimes we will have to obtain the result by looking  at a few results from the recurrence  &lt;/p&gt;

&lt;p&gt;Just because a problem can be solved with dynamic programming does not mean there isn't a more efficient solution out there. Solving a problem with dynamic programming feels like magic, but remember that dynamic programming is merely a clever brute force.  Sometimes it pays off well,  and sometimes it helps only a little.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fdynamic-Programming-Process.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fdynamic-Programming-Process.png" alt="flowchart"&gt;&lt;/a&gt;&lt;/p&gt;






&lt;h2&gt;
  
  
  How to Solve Problems using Dynamic Programming
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fundraw_problem_solving_ft81.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fundraw_problem_solving_ft81.svg" alt="img"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we have an understanding of what dynamic programming is and how it generally works, let's look at how we'll create a dynamic programming solution to a problem. We're going to explore the process of dynamic programming using the &lt;em&gt;&lt;a href="https://courses.cs.washington.edu/courses/cse521/13wi/slides/06dp-sched.pdf" rel="noopener noreferrer"&gt;Weighted Interval Scheduling Problem&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Pretend you're the owner of a dry cleaner. You have &lt;em&gt;n&lt;/em&gt; customers come in and give you clothes to clean. You can only clean one customers pile of clothes (PoC) at a time. Each pile of clothes, &lt;em&gt;i&lt;/em&gt;, must be cleaned at some pre-determined start time s_i and some predetermined finish time f_i.&lt;/p&gt;

&lt;p&gt;Each pile of clothes has an assiocated value, v_i, based on how important it is to your business. For example, some customers may pay more to have their clothes cleaned faster. Or some may be repeating customers and you want them to be happy.&lt;/p&gt;

&lt;p&gt;As the owner of this dry cleaners you must determine the optimal schedule of clothes that maximises the total value of this day. This problem is a re-wording of the &lt;em&gt;Weighted Interval scheduling problem&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;You will now see 4 steps to solving a DP problem. Sometimes, you can skip a step. Sometimes, your problem is already well defined and you don't need to worry about the first few steps.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 1. Write the Problem out
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fundraw_typewriter_i8xd.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fundraw_typewriter_i8xd.svg" alt="img"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Grab a piece of paper. Write out the problem. Specifically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is the problem?&lt;/li&gt;
&lt;li&gt;What are the subproblems?&lt;/li&gt;
&lt;li&gt;What would the solution roughly look like?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the dry cleaner problem, let's put down into words the subproblems. What we want to determine is the maximum value schedule for each pile of clothes such that the clothes are sorted by start time.&lt;/p&gt;

&lt;p&gt;Why sorted by start time? Good question! We want to keep track of processes which are currently running. If we sort by finish time, it doesn't make much sense in our heads. We could have 2 with similar finish times, but entirely different start times. Time moves in a linear fashion. If we have piles of clothes that start at 1 pm, we know that. If we have a pile of clothes that finishes at 3 pm, it's kind of seeing it backwards. Doesn't make so much sense.&lt;/p&gt;

&lt;p&gt;We can find the maximum value schedule for piles n-1 through to n. And then for n - 2 through to n. And so on. By finding the solution to every single sub-problem, we can tackle the original problem itself. The maximum value schedule for piles 1 through &lt;em&gt;n&lt;/em&gt;. Since the sub-problems are smaller versions of the original problem, sub-problems can be used to solve the original problem.&lt;/p&gt;

&lt;p&gt;With the interval scheduling problem, the only way we can solve it is by brute-forcing all subsets of the problem until we find an optimal one. What we're saying is that instead of brute-forcing one by one, we divide it up. We brute force from n-1 through to n. Then we do the same for n-2 through to n. Eventually, we have loads of smaller problems, which we can solve dynamically. We want to build the solutions to our sub-problems such that each sub-problem builds on the previous problems.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. Mathematical Recurrences
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fundraw_mathematics_4otb.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fundraw_mathematics_4otb.svg" alt="cover photo"&gt;&lt;/a&gt;&lt;br&gt;
I know, mathematics sucks. If you'll bare with me here you'll find that this isn't that hard. &lt;a href="https://en.wikipedia.org/wiki/Recurrence_relation" rel="noopener noreferrer"&gt;Mathematical recurrences&lt;/a&gt; are used to:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Define the running time of a divide and conquer (dynamic programming) technique&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But, between you and me, they can also be used to define a problem. If it's difficult to turn your subproblems into maths, then it may be the wrong subproblem.&lt;/p&gt;

&lt;p&gt;There are 2 steps to creating a mathematicla recurrence:&lt;/p&gt;
&lt;h3&gt;
  
  
  1: Define the Base Case
&lt;/h3&gt;

&lt;p&gt;Base cases are the smallest possible denomination of a problem.&lt;/p&gt;

&lt;p&gt;When creating a recurrence, ask yourself these questions:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"What decision do I make at step 0?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It doesn't have to be 0. The base case is the smallest possible denomination of a problem. We saw this with the Fibonacci sequence. The base was was:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If n == 0 or n == 1, return 1&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's important to know where the base case lies, so we can create the recurrence. In our problem, we have one decision to make:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Put that pile of clothes on to be washed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Don’t wash that pile of clothes today&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If n is 0, that is, if we have 0 PoC then we do nothing. Our base case is then:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;if n == 0, return 0&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  2: What Decision Do I Make at Step n?
&lt;/h3&gt;

&lt;p&gt;Now we know what the base case is, if we're at step n what do we do? For each pile of clothes that is compatible with the schedule so far (compatible means that the start time is after the finish time of the pile of clothes currently being washed), the algorithm chooses two options.&lt;/p&gt;

&lt;p&gt;Now we know what happens at the base case, and what happens else. We now need to find out what information the algorithm needs to go backwards (or forwards).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"If my algorithm is at step i, what information would it need to decide what to do in step i+1?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To decide between the two options, the algorithm needs to know the next compatible PoC (pile of clothes). The next compatible PoC for a given pile, p, is the PoC, n, such that s_n (the start time for PoC n) happens after f_p (the finish time for PoC p). The difference between s_n and f_p should be minimised.&lt;/p&gt;

&lt;p&gt;In English, imagine we have one washing machine. We put in a pile of clothes at 13:00. Our next pile of clothes starts at 13:01. We can't just open the washing machine and put them in. Our next compatible pile of clothes is the one that starts after the finish time of the one currently being washed.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"If my algorithm is at step i, what information did it need to decide what to do in step i-1?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The algorithm needs to know about future decisions. The ones made for PoC &lt;em&gt;i&lt;/em&gt; through &lt;em&gt;n&lt;/em&gt; in order to decide to run or not to run PoC &lt;em&gt;i-1&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Now that we’ve answered these questions, perhaps we’ve started to form a  recurring mathematical decision in our mind. If not, that’s also okay,  it becomes easier to write recurrences as we get exposed to more problems.&lt;/p&gt;

&lt;p&gt;Here’s our recurrence:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FScreenshot_2019-06-23-What-Is-Dynamic-Programming-With-Python-Examples.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2FScreenshot_2019-06-23-What-Is-Dynamic-Programming-With-Python-Examples.png" alt="If you're reading this on Dev using a screenreader, it's much better for you to visit my blog https://skerritt.blog/dynamic-programming/ . There's a large amount of maths in this document that are images. On my blog, I'm using MathJax which is accessibility friendly."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's explore in detail what makes this mathematical recurrence. OPT(i) represents the maximum value schedule for PoC &lt;em&gt;i&lt;/em&gt; through to &lt;em&gt;n&lt;/em&gt; such that PoC are sorted by start times. OPT(i) is our subproblem from earlier.&lt;/p&gt;

&lt;p&gt;We start with the base case. All recurrences need somewhere to stop. If we call OPT(0) we'll be returned with 0.&lt;/p&gt;

&lt;p&gt;To determine the value of OPT(i), we consider two options. We want to take the maximum of these options to meet our goal. Our goal is the &lt;em&gt;maximum value schedule&lt;/em&gt; for all piles of clothes. Once we choose the option that gives the maximum result at step &lt;em&gt;i,&lt;/em&gt; we memoize its value as OPT(i).&lt;/p&gt;

&lt;p&gt;The two options — to run or not to run PoC i — are represented mathematically as follows:&lt;/p&gt;

&lt;p&gt;v_i + OPT(next[n])&lt;/p&gt;

&lt;p&gt;This represents the decision to run PoC i. It adds the value gained from PoC i to OPT(next[n]), where next[n] represents the next compatible pile of clothing following PoC i. When we add these two values together, we get the maximum value schedule from i through to n such that they are sorted by start time if i is ran.&lt;/p&gt;

&lt;p&gt;Sorted by start time here because next[n] is the one immediately after v_i, so by default, they are sorted by start time.&lt;/p&gt;

&lt;p&gt;OPT(i + 1)&lt;/p&gt;

&lt;p&gt;If we decide not to run &lt;em&gt;i&lt;/em&gt;, our value is then OPT(i + 1). The value is not gained. OPT(i + 1) gives the maximum value schedule for i+1 through to n, such that they are sorted by start times.&lt;/p&gt;
&lt;h2&gt;
  
  
  3. Determine the Dimensions of the Memoization Array and the Direction in Which It Should Be Filled
&lt;/h2&gt;

&lt;p&gt;The solution to our DP problem is OPT(1). We can write out the solution as the maximum value schedule for PoC 1 through n such that PoC are sorted by start time. This goes hand in hand with "maximum value schedule for PoC i through to n". Our solution can be written as OPT(1).&lt;/p&gt;

&lt;p&gt;From step 2:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-13.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-13.png" alt="img"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Going back to our Fibonacci numbers earlier, our DP solution relied on the fact that the Fibonacci numbers for 0 through to n - 1 were already memoised. That is, to find F(5) we already memoised F(0), F(1), F(2), F(3), F(4). We want to do the same thing here.&lt;/p&gt;

&lt;p&gt;The problem we have is figuring out how to fill out a memoisation table. In the scheduling problem, we know that OPT(1) relies on the solutions to OPT(2) and OPT(next[1]). PoC 2 and next[1] have start times after PoC 1 due to sorting. We need to fill our memoisation table from OPT(n) to OPT(1).&lt;/p&gt;

&lt;p&gt;We can clearly see our array is one dimensional, from 1 to n. But, if we couldn't clearly see that we can work it out another way. The dimensions of the array are equal to the number and size of the variables on which OPT(x) relies. In our algorithm, we have OPT(i) - one variable, i. This means our array will be 1-dimensional and its size will be n, as there are n piles of clothes.&lt;/p&gt;

&lt;p&gt;If we know that &lt;em&gt;n&lt;/em&gt; = 5, then our memoization array might look like this:&lt;/p&gt;

&lt;p&gt;memo = [0, OPT(1), OPT(2), OPT(3), OPT(4), OPT(5)]&lt;/p&gt;

&lt;p&gt;0 is also the base case. memo[0] = 0, per our recurrence from earlier.&lt;/p&gt;
&lt;h2&gt;
  
  
  4. Coding Our Solution
&lt;/h2&gt;

&lt;p&gt;Personally, when I am coding a Dynamic Programming solution, I like to read the recurrence and try to recreate it. Our first step is to initialise the array to size (n + 1). In Python, we don't need to do this. But you may need to do it if you're using a different language.&lt;/p&gt;

&lt;p&gt;Our second step is to set the base case.&lt;/p&gt;

&lt;p&gt;To find the profit with the inclusion of job[i]. we need to find the latest job that doesn’t conflict with job[i].  The idea is to use Binary Search to find the latest non-conflicting job. I've copied the code from &lt;a href="https://www.geeksforgeeks.org/weighted-job-scheduling-log-n-time/" rel="noopener noreferrer"&gt;here&lt;/a&gt;but edited slightly.&lt;/p&gt;

&lt;p&gt;First, let's define what a "job" is. As we saw, a job consists of 3 things:&lt;/p&gt;




&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Class to represent a job 
&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Job&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;finish&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;profit&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; 
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt; 
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;finish&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;finish&lt;/span&gt; 
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;profit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;profit&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;p&gt;Start time, finish time, and the total profit (benefit) of running that job.&lt;/p&gt;

&lt;p&gt;The next step we want to program is the schedule.&lt;/p&gt;




&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# The main function that returns the maximum possible 
# profit from given array of jobs
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;schedule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; 
    &lt;span class="c1"&gt;# Sort jobs according to start time 
&lt;/span&gt;    &lt;span class="n"&gt;job&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 

    &lt;span class="c1"&gt;# Create an array to store solutions of subproblems. table[i] 
&lt;/span&gt;    &lt;span class="c1"&gt;# stores the profit for jobs till arr[i] (including arr[i]) 
&lt;/span&gt;    &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
    &lt;span class="n"&gt;table&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; 

    &lt;span class="n"&gt;table&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;profit&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;p&gt;Earlier, we learnt that the table is 1 dimensional. We sort the jobs by start time, create this empty table and set table[0] to be the profit of job[0]. Since we've sorted by start times, the first compatiable job is always job[0].&lt;/p&gt;

&lt;p&gt;Our next step is to fill in the entries using the recurrence we learnt earlier. To find the next compatiable job, we're using Binary Search. In the full code posted later, it'll include this. For now, let's worry about understanding the algorithm.&lt;/p&gt;

&lt;p&gt;If the next compatiable job returns -1, that means that all jobs before index, i, conflict with it (so cannot be used).  Inclprof means we're including that item in the maximum value set. We then store it in table[i], so we can use this calculation again later.&lt;/p&gt;




&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;    &lt;span class="c1"&gt;# Fill entries in table[] using recursive property 
&lt;/span&gt;    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; 

        &lt;span class="c1"&gt;# Find profit including the current job 
&lt;/span&gt;        &lt;span class="n"&gt;inclProf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;profit&lt;/span&gt; 
        &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;binarySearch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
        &lt;span class="nf"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; 
            &lt;span class="n"&gt;inclProf&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;table&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt; 

        &lt;span class="c1"&gt;# Store maximum of including and excluding 
&lt;/span&gt;        &lt;span class="n"&gt;table&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;inclProf&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;table&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;p&gt;Our final step is then to return the profit of all items up to n-1.&lt;/p&gt;




&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;table&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;p&gt;The full code can be seen below:&lt;/p&gt;




&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Python program for weighted job scheduling using Dynamic 
# Programming and Binary Search 
&lt;/span&gt;
&lt;span class="c1"&gt;# Class to represent a job 
&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Job&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;finish&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;profit&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; 
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt; 
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;finish&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;finish&lt;/span&gt; 
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;profit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;profit&lt;/span&gt; 

&lt;span class="c1"&gt;# A Binary Search based function to find the latest job 
# (before current job) that doesn't conflict with current 
# job. "index" is index of the current job. This function 
# returns -1 if all jobs before index conflict with it. 
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;binarySearch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;start_index&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; 
    &lt;span class="c1"&gt;# https://en.wikipedia.org/wiki/Binary_search_algorithm
&lt;/span&gt;
    &lt;span class="c1"&gt;# Initialize 'lo' and 'hi' for Binary Search 
&lt;/span&gt;    &lt;span class="n"&gt;lo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="n"&gt;hi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;start_index&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

    &lt;span class="c1"&gt;# Perform binary Search iteratively 
&lt;/span&gt;    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;lo&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;hi&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
        &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lo&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;hi&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;mid&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;finish&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;start_index&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;finish&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;start_index&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
                &lt;span class="n"&gt;lo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
            &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; 
        &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
            &lt;span class="n"&gt;hi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mid&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="c1"&gt;# The main function that returns the maximum possible 
# profit from given array of jobs 
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;schedule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; 
    &lt;span class="c1"&gt;# Sort jobs according to start time 
&lt;/span&gt;    &lt;span class="n"&gt;job&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 

    &lt;span class="c1"&gt;# Create an array to store solutions of subproblems. table[i] 
&lt;/span&gt;    &lt;span class="c1"&gt;# stores the profit for jobs till arr[i] (including arr[i]) 
&lt;/span&gt;    &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
    &lt;span class="n"&gt;table&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; 

    &lt;span class="n"&gt;table&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;profit&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 

    &lt;span class="c1"&gt;# Fill entries in table[] using recursive property 
&lt;/span&gt;    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; 

        &lt;span class="c1"&gt;# Find profit including the current job 
&lt;/span&gt;        &lt;span class="n"&gt;inclProf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;profit&lt;/span&gt; 
        &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;binarySearch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
        &lt;span class="nf"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; 
            &lt;span class="n"&gt;inclProf&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;table&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt; 

        &lt;span class="c1"&gt;# Store maximum of including and excluding 
&lt;/span&gt;        &lt;span class="n"&gt;table&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;inclProf&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;table&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; 

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;table&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; 

&lt;span class="c1"&gt;# Driver code to test above function 
&lt;/span&gt;&lt;span class="n"&gt;job&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Job&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nc"&gt;Job&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; 
    &lt;span class="nc"&gt;Job&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;19&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nc"&gt;Job&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; 
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Optimal profit is&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; 
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;schedule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;p&gt;Congrats! 🥳 We've just written our first dynamic program!  Now that we’ve wet our feet,  lets walk through a different type of dynamic programming problem.&lt;/p&gt;






&lt;h1&gt;
  
  
  Knapsack Problem
&lt;/h1&gt;

&lt;p&gt;Imagine you are a criminal. Dastardly smart. You break into Bill Gate’s mansion. Wow, okay!?!? How many rooms is this? His washing machine room is larger than my entire house??? Ok, time to stop getting distracted. You brought a small bag with you. A knapsack - if you will.&lt;/p&gt;

&lt;p&gt;You can only fit so much into it. Let’s give this an arbitrary number. The bag will support weight 15, but no more. What we want to do is maximise how much money we'll make, b.&lt;/p&gt;

&lt;p&gt;The greedy approach is to pick the item with the highest value which can fit into the bag. Let's try that. We're going to steal Bill Gate's TV. £4000? Nice. But his TV weighs 15. So... We leave with £4000.&lt;/p&gt;

&lt;p&gt;Bill Gate's has a lot of watches. Let's say he has 2 watches. Each watch weighs 5 and each one is worth £2250. When we steal both, we get £4500 with a weight of 10.&lt;/p&gt;

&lt;p&gt;In the greedy approach, we wouldn't choose these watches first. But to us as humans, it makes sense to go for smaller items which have higher values. The Greedy approach cannot optimally solve the {0,1} Knapsack problem. The {0, 1} means we either take the item whole {1} or we don't {0}. Dynamic programming can however optimally solve the {0, 1} knapsack problem.&lt;/p&gt;

&lt;p&gt;The simple solution to this problem is to consider all the subsets of all items. For every single combination of Bill Gate's stuff, we calculate the total weight and value of this combination.&lt;/p&gt;

&lt;p&gt;We consider only those with weight less than W_max. We then pick the combination which has the highest value. This is a disaster! How long would this take? Bill Gate's would come back home far before you're even 1/3rd of the way there! In Big O, this algorithm takes O(n^2) time.&lt;/p&gt;

&lt;p&gt;You can see we already have a rough idea of the solution and what the problem is, without having to write it down in maths!&lt;/p&gt;






&lt;h2&gt;
  
  
  Maths
&lt;/h2&gt;

&lt;p&gt;Imagine we had a listing of every single thing in Bill Gate's house. Maybe we stole it from some insurance papers. Now, think about the future. What is the optimal solution to this problem?&lt;/p&gt;

&lt;p&gt;We have a subset, L, which is the optimal solution. L is a subset of S, the set containing all of Bill Gate's stuff.&lt;/p&gt;

&lt;p&gt;Let's pick a random item, N. L either contains N or it doesn't. If it doesn't use N, the optimal solution for the problem is the same as {1, 2, ..., N-1}. This is assuming that Bill Gate's stuff is sorted by value / weight.&lt;/p&gt;

&lt;p&gt;Suppose that the optimum of the original problem is not optimum of the sub-problem. if we have sub-optimum of the smaller problem then we have a contradiction - we should have an optimum of the whole problem.&lt;/p&gt;

&lt;p&gt;If L contains N, then the optimal solution for the problem is the same as {1, 2, 3, ..., N-1}. We know the item is in, so L already contains N. To complete the computation we focus on the remaining items. We find the optimal solution to the remaining items.&lt;/p&gt;

&lt;p&gt;But, we now have a new maximum allowed weight of W_max - W_n. If item N is contained in the solution, the total weight is now the max weight take away item N (which is already in the knapsack).&lt;/p&gt;

&lt;p&gt;These are the 2 cases. Either item N is in the optimal solution or it isn't.&lt;/p&gt;

&lt;p&gt;If the weight of item N is greater than W_max, then it cannot be included so case 1 is the only possibility.&lt;/p&gt;

&lt;p&gt;To more precisely define this recursive solution, let S_k = {1, 2, ..., k} and S_0 = ∅&lt;/p&gt;

&lt;p&gt;Let B[k, w] be the &lt;em&gt;maximum total benefit&lt;/em&gt; obtained using a subset of S_k. Having total weight at most w.&lt;/p&gt;

&lt;p&gt;Then we define B[0, w] = 0 for each w \le W_max, and:&lt;/p&gt;

&lt;p&gt;Our desired solution is then B[n, W_max].&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-14.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-14.png" alt="img"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Tabulation of Knapsack Problem
&lt;/h3&gt;

&lt;p&gt;Okay, pull out some pen and paper. No, really. Things are about to get confusing real fast. This memoisation table is 2-dimensional. We have these items:&lt;/p&gt;




&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(1, 1), (3, 4), (4, 5), (5, 7)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;p&gt;Where the tuples are &lt;code&gt;(weight, value)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We have 2 variables, so our array is 2-dimensional. The first dimension is from 0 to 7. Our second dimension is the values.&lt;/p&gt;

&lt;p&gt;And we want a weight of 7 with maximum benefit.&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-15.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-15.png" alt="img"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;The weight is 7. We start counting at 0 (not a DP thing, just a programming thing). We put each tuple on the left-hand side. Ok. Now to fill out the table!&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-16.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-16.png" alt="skerritt.blog"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;The columns are weight. At weight 0, we have a total weight of 0. At weight 1, we have a total weight of 1. Obvious, I know. But this is an important distinction to make which will be useful later on.&lt;/p&gt;

&lt;p&gt;When our weight is 0, we can't carry anything no matter what. The total weight of everything at 0 is 0.&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-17.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-17.png" alt="skerritt.blog"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;If our total weight is 1, the best item we can take is (1, 1). As we go down through this array, we can take more items. At the row for (4, 3) we can either take (1, 1) or (4, 3). But for now, we can only take (1, 1). Our maximum benefit for this row then is 1.&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-18.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-18.png" alt="skerritt.blog"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;If our total weight is 2, the best we can do is 1. We only have 1 of each item. We cannot duplicate items. So no matter where we are in row 1, the absolute best we can do is (1, 1).&lt;/p&gt;

&lt;p&gt;Let's start using (4, 3) now. If the total weight is 1, but the weight of (4, 3) is 3 we cannot take the item yet until we have a weight of at least 3.&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-19.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-19.png"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Now we have a weight of 3. Let's compare some things. We want to take the max of:&lt;/p&gt;

&lt;p&gt;MAX(4 + T[0][0], 1)&lt;/p&gt;

&lt;p&gt;If we're at 2, 3 we can either take the value from the last row or use the item on that row. We go up one row and count back 3 (since the weight of this item is 3).&lt;/p&gt;

&lt;p&gt;Actually, the formula is whatever weight is remaining when we minus the weight of the item on that row. The weight of (4, 3) is 3 and we're at weight 3. 3 - 3 = 0. Therefore, we're at T[0][0]. T[previous row's number][current total weight - item weight].&lt;/p&gt;

&lt;p&gt;MAX(4 + T[0][0], 1)&lt;/p&gt;

&lt;p&gt;The 1 is because of the previous item. The max here is 4.&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-20.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-20.png"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;max(4 + t[0][1], 1)&lt;/p&gt;

&lt;p&gt;Total weight is 4, item weight is 3. 4 - 3 = 1. Previous row is 0. t[0][1].&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-21.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-21.png"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;I won't bore you with the rest of this row, as nothing exciting happens. We have 2 items. And we've used both of them to make 5. Since there are no new items, the maximum value is 5.&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-22.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-22.png"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Onto our next row:&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-23.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-23.png"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Here's a little secret. Our tuples are ordered by weight! That means that we can fill in the previous rows of data up to the next weight point. We know that 4 is already the maximum, so we can just fill it in. This is where memoisation comes into play! We already have the data, why bother re-calculating it?&lt;/p&gt;

&lt;p&gt;We go up one row and head 4 steps back. That gives us:&lt;/p&gt;

&lt;p&gt;max(4 + T[2][0], 5).&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-24.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-24.png"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Now we calculate it for total weight 5.&lt;/p&gt;

&lt;p&gt;max(5 + T[2][1], 5) = 6&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-25.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-25.png"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;We just do the same thing again:&lt;/p&gt;

&lt;p&gt;max(5 + T[2][2], 5) = 6&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-26.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-26.png"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Now we have total weight 7. We choose the max of:&lt;/p&gt;

&lt;p&gt;max(5 + T[2][3], 5) = max(5 + 4, 5) = 9&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-27.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-27.png"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;If we had total weight 7 and we had the 3 items (1, 1), (4, 3), (5, 4) the best we can do is 9.&lt;/p&gt;

&lt;p&gt;Since our new item starts at weight 5, we can just copy from the previous row until we get to weight 5.&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-28.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-28.png"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;We then do another max.&lt;/p&gt;

&lt;p&gt;Total weight - new item's weight. This is 5 - 5 = 0. We want previous row at position 0.&lt;/p&gt;

&lt;p&gt;max(7 + T[3][0], 6)&lt;/p&gt;

&lt;p&gt;The 6 comes from the best on the previous row for that total weight.&lt;/p&gt;

&lt;p&gt;max(7 + 0, 6) = 7&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-29.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-29.png"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;max(7 + T[3][1], 6) = 8&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-30.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-30.png"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;max(7+T[3][2], 9) = 9&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-31.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-31.png"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;9 is the maximum value we can get by picking items from the set of items such that the total weight is \le 7.&lt;/p&gt;
&lt;h3&gt;
  
  
  Finding the Optimal Set for {0, 1} Knapsack Problem Using Dynamic Programming
&lt;/h3&gt;

&lt;p&gt;Now, what items do we actually pick for the optimal set? We start from this item:&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-32.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-32.png"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;We want to know where the 9 comes from. It's coming from the top because the number directly above 9 on the 4th row is 9. Since it's coming from the top, the item (7, 5) is not used in the optimal set.&lt;/p&gt;

&lt;p&gt;Where does this 9 come from?&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-33.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-33.png"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;This 9 is not coming from the row above it. &lt;strong&gt;Item (5, 4) must be in the optimal set.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We now go up one row, and go back 4 steps. 4 steps because the item, (5, 4), has weight 4.&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-34.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-34.png"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;4 does not come from the row above. The item (4, 3) must be in the optimal set.&lt;/p&gt;

&lt;p&gt;The weight of item (4, 3) is 3. We go up and we go back 3 steps and reach:&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-35.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F06%2Fimage-35.png"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;As soon as we reach a point where the weight is 0, we're done. Our two selected items are (5, 4) and (4, 3). The total weight is 7 and our total benefit is 9. We just add the two tuples together to find this out.&lt;/p&gt;

&lt;p&gt;Let's begin coding this.&lt;/p&gt;






&lt;h3&gt;
  
  
  Coding It
&lt;/h3&gt;

&lt;p&gt;Now we kn0w how it works, and we've derived the recurrence for it - it shouldn't be too hard to code it. If our two-dimensional array is i (row) and j (column) then we have:&lt;/p&gt;




&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;wt&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;p&gt;If our weight j is less than the weight of item i (i does not contribute to j) then:&lt;/p&gt;




&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;wt&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
    &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="n"&gt;weight&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;
    &lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nf"&gt;wt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="n"&gt;previous&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;subtracting&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;weight&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="n"&gt;weight&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;without&lt;/span&gt; &lt;span class="n"&gt;including&lt;/span&gt; &lt;span class="n"&gt;ths&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;p&gt;This is what the core heart of the program does. I've copied some code from &lt;a href="https://www.geeksforgeeks.org/0-1-knapsack-problem-dp-10/" rel="noopener noreferrer"&gt;here&lt;/a&gt;to help explain this. I'm not going to explain this code much, as there isn't much more to it than what I've already explained. If you're confused by it, leave a comment (can be left anonymously) below or email me 😁&lt;/p&gt;




&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Returns the maximum value that can be put in a knapsack of 
# capacity W 
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;knapSack&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;W&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;wt&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; 

    &lt;span class="c1"&gt;# Base Case 
&lt;/span&gt;    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;W&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;

    &lt;span class="c1"&gt;# If weight of the nth item is more than Knapsack of capacity 
&lt;/span&gt;    &lt;span class="c1"&gt;# W, then this item cannot be included in the optimal solution 
&lt;/span&gt;    &lt;span class="nf"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;wt&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;W&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; 
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;knapSack&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;W&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;wt&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 

    &lt;span class="c1"&gt;# return the maximum of two cases: 
&lt;/span&gt;    &lt;span class="c1"&gt;# (1) nth item included 
&lt;/span&gt;    &lt;span class="c1"&gt;# (2) not included 
&lt;/span&gt;    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;knapSack&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;W&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;wt&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;wt&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; 
                   &lt;span class="nf"&gt;knapSack&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;W&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;wt&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; 


&lt;span class="c1"&gt;# To test above function 
&lt;/span&gt;&lt;span class="n"&gt;val&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;120&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; 
&lt;span class="n"&gt;wt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; 
&lt;span class="n"&gt;W&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;
&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;knapSack&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;W&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;wt&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="c1"&gt;# output 220
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h2&gt;
  
  
  Time Complexity of a Dynamic Programming Problem
&lt;/h2&gt;

&lt;p&gt;In DP, &lt;a href="https://skerritt.blog/you-need-to-understand-big-o-notation-now/" rel="noopener noreferrer"&gt;time complexity&lt;/a&gt; is calculated as:&lt;/p&gt;

&lt;p&gt;Number of unique states * time taken per state&lt;/p&gt;

&lt;p&gt;For our original problem, the Weighted Interval Scheduling Problem, we had n piles of clothes. Each pile of clothes is solved in constant time. The time complexity is:&lt;/p&gt;

&lt;p&gt;O(n) + O(1) = O(n)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://skerritt.blog/you-need-to-understand-big-o-notation-now/" rel="noopener noreferrer"&gt;I've written a post about Big O notation&lt;/a&gt;if you want to learn more about time complexities.&lt;/p&gt;

&lt;p&gt;With our Knapsack problem, we had n number of items. The table grows depending on the total capacity of the knapsack, our time complexity is:&lt;/p&gt;

&lt;p&gt;O(nw)&lt;/p&gt;

&lt;p&gt;Where n is the number of items, and w is the capactity of the knapsack.&lt;/p&gt;

&lt;p&gt;I'm going to let you in on a little secret. It's possible to work out the time complexity of an algorithm from its recurrence. You can use something called the Master Theorem to work it out. This is the theorem in a nutshell:&lt;/p&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F05%2Fimage-16.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F05%2Fimage-16.png" alt="What Is Dynamic Programming With Python Examples"&gt;&lt;/a&gt;Taken from &lt;a href="https://medium.com/@randerson112358/master-theorem-909f52d4364" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Now, I'll be honest. The master therom deserves a blog post of its own. For now, I've found this video to be excellent:&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/OynWkEj0S-s"&gt;
&lt;/iframe&gt;
&lt;/p&gt;




&lt;h3&gt;
  
  
  Dynamic Programming vs Divide &amp;amp; Conquer vs Greedy
&lt;/h3&gt;

&lt;p&gt;Dynamic Programming &amp;amp; &lt;a href="https://dev.to/brandonskerritt/a-gentle-introduction-to-divide-and-conquer-algorithms-1ga"&gt;Divide and Conquer&lt;/a&gt; are incredibly similar. Dynamic Programming is based on Divide and Conquer, except we memoise the results.&lt;/p&gt;

&lt;p&gt;Greedy, on the other hand, is different. It aims to optimise by making the best choice at that moment. Sometimes, this doesn't optimse for the whole problem. Take this question as an example. We have 3 coins:&lt;/p&gt;

&lt;p&gt;1p, 15p, 25p&lt;/p&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Change-making_problem" rel="noopener noreferrer"&gt;And someones wants us to give change of 30p&lt;/a&gt;. With Greedy, it would select 25, then 5 * 1 for a total of 6 coins. The optimal solution is 2 * 15. Greedy works from largest to smallest. At the point where it was at 25, the best choice would be to pick 25.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F05%2Fimage-15.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F05%2Fimage-15.png" alt="What Is Dynamic Programming With Python Examples"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Tabulation (Bottom-Up) vs Memoisation (Top-Down)
&lt;/h2&gt;

&lt;p&gt;There are 2 types of dynamic programming. Tabulation and Memoisation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Memoisation (Top-Down)
&lt;/h3&gt;

&lt;p&gt;We've computed all the subproblems but have no idea what the optimal evaluation order is. We would then perform a recursive call from the root, and hope we get close to the optimal solution or obtain a proof that we will arrive at the optimal solution. Memoisation ensures you never recompute a subproblem because we cache the results, thus duplicate sub-trees are not recomputed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F05%2Fimage-8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F05%2Fimage-8.png" alt="What Is Dynamic Programming With Python Examples"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From our Fibonacci sequence earlier, we start at the root node. The subtree F(2) isn't calculated twice.&lt;/p&gt;

&lt;p&gt;This starts at the top of the tree and evaluates the subproblems from the leaves/subtrees back up towards the root. &lt;strong&gt;Memoisation is a top-down approach.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Tabulation (Bottom-Up)
&lt;/h3&gt;

&lt;p&gt;We've also seen Dynamic Programming being used as a 'table-filling' algorithm. Usually, this table is multidimensional. This is like memoisation, but with one major difference. We have to pick the exact order in which we will do our computations. The knapsack problem we saw, we filled in the table from left to right - top to bottom. We knew the exact order of which to fill the table.&lt;/p&gt;

&lt;p&gt;Sometimes the 'table' is not like the tables we've seen. It can be a more complicated structure such as trees. Or specific to the problem domain, such as cities within flying distance on a map.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tabulation &amp;amp; Memosation - Advantages and Disadvantages
&lt;/h3&gt;

&lt;p&gt;Generally speaking, memoisation is easier to code than tabulation. Wecan write a 'memoriser' wrapper function that automatically does it for we. With tabulation, we have to come up with an ordering.&lt;/p&gt;

&lt;p&gt;Memoisation has memory concerns. If we're computing something large such as F(10^8), each computation will be delayed as we have to place them into the array. And the array will grow in size very quickly.&lt;/p&gt;

&lt;p&gt;Either approach may not be time-optimal if the order we happen (or try to) visit subproblems is not optimal, specifically if there is more than one way to calculate a subproblem (normally caching would resolve this, but it's theoretically possible that caching might not in some exotic cases). Memoization will usually add on our time-complexity to our space-complexity (e.g. with tabulation we have more liberty to throw away calculations, like using tabulation with Fib lets us use O(1) space, but memoization with Fib uses O(N) stack space).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F05%2Fimage-17.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fskerritt.blog%2Fcontent%2Fimages%2F2019%2F05%2Fimage-17.png" alt="What Is Dynamic Programming With Python Examples"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Most of the problems you'll encounter within Dynamic Programmg already exist in one shape or another. Often, your problem will build on from the answers for previous problems. &lt;a href="https://en.wikipedia.org/wiki/Dynamic_programming#Algorithms_that_use_dynamic_programming" rel="noopener noreferrer"&gt;Here's a list of common problems that use Dynamic Programming.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope that whenever you encounter a problem, you think to yourself "can this problem be solved with DP?" and try it.&lt;br&gt;
&lt;a href="https://page.skerritt.blog/algorithms/" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fbrandonskerritt%2FAlgorithmsBook%2Fmaster%2FCapture.PNG"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>beginners</category>
      <category>python</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
