<?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>Forem: Aaroh Mankad</title>
    <description>The latest articles on Forem by Aaroh Mankad (@aarohmankad).</description>
    <link>https://forem.com/aarohmankad</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%2F50717%2Fdc2d3519-6194-4626-94b3-958eccc30aac.jpg</url>
      <title>Forem: Aaroh Mankad</title>
      <link>https://forem.com/aarohmankad</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/aarohmankad"/>
    <language>en</language>
    <item>
      <title>How Do You Conduct A Mock Interview?</title>
      <dc:creator>Aaroh Mankad</dc:creator>
      <pubDate>Fri, 09 Feb 2018 02:38:59 +0000</pubDate>
      <link>https://forem.com/aarohmankad/how-do-you-conduct-a-mock-interview--10c9</link>
      <guid>https://forem.com/aarohmankad/how-do-you-conduct-a-mock-interview--10c9</guid>
      <description>&lt;p&gt;I've recently been conducting several mock interviews for my friends in college, and I want your tips/experience at conducting mocks.&lt;/p&gt;

&lt;p&gt;Typically, my flow works something like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Let them book a time on my Meetingbird Calendar&lt;/li&gt;
&lt;li&gt;Depending on the request, set location as whiteboard room, my phone number, or a coderpad link.&lt;/li&gt;
&lt;li&gt;I try to do research on the specific company and position they're applying for, to try to compile some questions that they could expect.&lt;/li&gt;
&lt;li&gt;During most mocks, I conduct the interview as if it were real, and coach them after we've been going back and forth for some time. This could be things they did really well, things they could have done better, etc.&lt;/li&gt;
&lt;li&gt;If they're up for it, I also critique their resumes and do a quick question/answer about the content.&lt;/li&gt;
&lt;li&gt;Always make a reminder to wish them good luck on the day of their interview!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Is there anything else I should be doing, or do you have tips on conducting a mock interview? I'd love to hear them!&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>career</category>
    </item>
    <item>
      <title>Contributing to Open Source</title>
      <dc:creator>Aaroh Mankad</dc:creator>
      <pubDate>Sun, 21 Jan 2018 19:08:05 +0000</pubDate>
      <link>https://forem.com/aarohmankad/contributing-to-open-source-1i4e</link>
      <guid>https://forem.com/aarohmankad/contributing-to-open-source-1i4e</guid>
      <description>&lt;p&gt;Note: This article was initially published on my Medium account. Follow me &lt;a href="https://medium.com/@aarohmankad/" rel="noopener noreferrer"&gt;@aarohmankad&lt;/a&gt; to be the first the read my posts, and feel free to read some of my other articles!&lt;/p&gt;

&lt;p&gt;I was recently invited to speak at Github Field Day LA on a topic of my choice. As Github was the main sponsor of the event, I thought I would give a talk on my experience in the overarching Open Source Community, and how/why to get started with making contributions to Open Source projects.&lt;/p&gt;

&lt;p&gt;For a video of the talk with slides, scroll to the bottom!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Some (optional) background&lt;/strong&gt;: &lt;a href="https://githubfieldday.com/" rel="noopener noreferrer"&gt;Github Field Day&lt;/a&gt; is a regional unconference for leaders of technical student communities. Github Field Day LA had student leaders from UCLA, USC, Caltech, UCR, Cal Poly Pomona, and many other campuses in the Southern California region.&lt;/p&gt;

&lt;p&gt;The goal of my talk was to convince these leaders to adopt the mindset of contributing to Open Source and then teaching the students at their schools how to do the same.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why should I contribute to Open Source?
&lt;/h2&gt;

&lt;p&gt;So you’ve heard of Open Source projects, but always thought they weren’t approachable. Or maybe you thought that it wouldn’t be beneficial to you at your skill level. However, Open Source can help you advance yourself technically and professionally. Here are some of the main ways that contributing to Open Source can help you develop yourself:&lt;/p&gt;

&lt;h3&gt;
  
  
  Open Source Can Develop Your Skills
&lt;/h3&gt;

&lt;p&gt;Whether you’re learning a new technology or you’ve been using it for ages, there are Open Source projects looking for someone of your skill level!&lt;br&gt;
By contributing to an Open Source project, you are learning how a technology is used in industry. You also get the valuable side effect of getting acclimated to large, robust codebases!&lt;/p&gt;
&lt;h3&gt;
  
  
  Open Source Can Count As Experience
&lt;/h3&gt;

&lt;p&gt;You may wonder: why would contributing to an Open Source project count as work experience? You’re not employed by the company hosting the project, and you’re not getting paid for it.&lt;/p&gt;

&lt;p&gt;However, by contributing to a companies open source project, you are required to perform at the bar that the company holds its employees against. This means that there is very little separating you from the engineers that are employed and getting paid for their contributions! This transitions very effectively into the next point.&lt;/p&gt;
&lt;h3&gt;
  
  
  Open Source Can Help You Network
&lt;/h3&gt;

&lt;p&gt;As I explained earlier, contributing to an Open Source project can count as valuable work experience. As you contribute more and become a prolific member of the open source community, you will start to meet new people online!&lt;/p&gt;

&lt;p&gt;Now when you meet potential connections at a meetup/conference/company, you can anchor your experience to a project that they have used or worked on. Contributing to Open Source can also help you in your job search! If you’ve already contributed to an Open Source project in a certain company, you immediately become a very competitive candidate. (Again, there is now very little separating you from the engineers already working at that company!)&lt;/p&gt;
&lt;h3&gt;
  
  
  Open Source Can Make Your Job Easier
&lt;/h3&gt;

&lt;p&gt;Lastly, your motivation for contributing to an Open Source project may be because you want to make your job easier. If you are using a certain library or framework and notice a bug or need a new feature, take a little time to file an issue and/or work on it!&lt;/p&gt;

&lt;p&gt;If the new feature is implemented or the bug is fixed, congratulations! You’ve just made your job easier. Now the logic for your use case is handled by a library that doesn’t rely completely on your future contributions. (As other contributors can continue your work.) In addition, you may have improved the experience for other users of the library or framework!&lt;/p&gt;
&lt;h2&gt;
  
  
  How Can I Start Contributing?
&lt;/h2&gt;

&lt;p&gt;Hopefully, I’ve convinced you to look into contributing to an Open Source project. But how do you find something to work on?&lt;/p&gt;
&lt;h3&gt;
  
  
  Look At Your Own Projects
&lt;/h3&gt;

&lt;p&gt;This is usually how I find projects to contribute to. If you’re using a library or framework in your code and notice something wrong with it or want to build on top of it, check out the Github repo!&lt;/p&gt;
&lt;h3&gt;
  
  
  Search On Github
&lt;/h3&gt;

&lt;p&gt;Github is not just a place to store your version-controlled code. It is also a powerful search tool to find Open Source projects you’d like to contribute to. I recommend using the &lt;code&gt;first-timers-only&lt;/code&gt; and &lt;code&gt;good-first-issue&lt;/code&gt; tags! (Assuming that corresponds to your skill level.)&lt;/p&gt;
&lt;h3&gt;
  
  
  Reflect On What You’re Learning
&lt;/h3&gt;

&lt;p&gt;If you’re learning a new technology, what better way to immerse yourself than by checking out some of the projects using it on Github? I particularly love looking at the tooling surrounding a project, such as &lt;code&gt;create-react-app&lt;/code&gt; for React.&lt;/p&gt;
&lt;h3&gt;
  
  
  Publish Your Own Project
&lt;/h3&gt;

&lt;p&gt;Contributing to Open Source doesn’t always mean working on existing projects. You can also publish your own project on to Github! This can help you understand how Open Source works better than just contributing, even if it’s a small project. I published a very simple GraphQL/Node boilerplate called the &lt;a href="https://github.com/aarohmankad/artemis-server" rel="noopener noreferrer"&gt;Artemis Server&lt;/a&gt; and learned a lot in the process, though I’m sure that can be its own blog post.&lt;/p&gt;
&lt;h2&gt;
  
  
  Further References
&lt;/h2&gt;

&lt;p&gt;Interested in learning more about the Open Source community? Here are some awesome &lt;br&gt;
links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://opensource.guide" rel="noopener noreferrer"&gt;opensource.guide&lt;/a&gt;: Ten free, in-depth guides ranging from “How to Contribute to Open Source”, “Building Welcoming Communities”, to “The Legal Side of Open Source”. All made by Github and friends!&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://opensourcefriday.com" rel="noopener noreferrer"&gt;opensourcefriday.com&lt;/a&gt;: Take some time away from work and give back to the Open Source Community every Friday!&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://opensourcesurvey.com/2017" rel="noopener noreferrer"&gt;opensourcesurvey.com/2017&lt;/a&gt;: Get a feel for the landscape of Open Source&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://slides.aaroh.codes" rel="noopener noreferrer"&gt;slides.aaroh.codes&lt;/a&gt;: The slides from my talk, if you want to give a similar talk to mine. I’m always happy to help you tweak your talk and tailor it to your audience and your experiences! (Just ping me on Facebook.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Last but not least, here’s a recording of my talk on Youtube! Yes I know it’s portrait, I wasn’t the one filming…&lt;/p&gt;

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

</description>
      <category>opensource</category>
      <category>learning</category>
      <category>git</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Data Structures and Algorithms: 0 to 60</title>
      <dc:creator>Aaroh Mankad</dc:creator>
      <pubDate>Tue, 16 Jan 2018 22:25:25 +0000</pubDate>
      <link>https://forem.com/aarohmankad/data-structures-and-algorithms-0-to-60-294h</link>
      <guid>https://forem.com/aarohmankad/data-structures-and-algorithms-0-to-60-294h</guid>
      <description>&lt;p&gt;Whether for homework or interviews, Data Structures and Algorithms will be &lt;strong&gt;foundational&lt;/strong&gt; to your early career. This article is to help you go from nothing to practical knowledge in this crucial area of Computer Science.&lt;/p&gt;

&lt;h3&gt;
  
  
  Linked Lists
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;A Linked List&lt;/strong&gt; is, as the name suggests, a list of items. Each item points to the next node in the list. Think of a linked list as a scavenger hunt.&lt;/p&gt;

&lt;p&gt;You start with a clue (the head of the list), and each clue leads you to the next clue (the next pointer), until you’re at the end (the tail of the list). Can you think of a list implementation?&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%2Fcdn-images-1.medium.com%2Fmax%2F730%2F1%2AgVHT0d3SFpvYjiwNj9FcJg.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%2Fcdn-images-1.medium.com%2Fmax%2F730%2F1%2AgVHT0d3SFpvYjiwNj9FcJg.png"&gt;&lt;/a&gt;Every Node is the start of its own Linked List!&lt;/p&gt;

&lt;p&gt;Some common reasons to use Linked Lists include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Inserting elements in the middle of your data&lt;/strong&gt; : You can insert anywhere in your list as long as you know the Node before the insertion index. O(n) in a Vector, O(1) in a Linked List.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quicker at expanding space for your data:&lt;/strong&gt; Because Linked Lists focus on this idea of using pointers, you don’t have to allocate contiguous blocks of memory for your data. This saves you O(n) time compared to a naive implementation of a Vector.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One major drawback of Linked Lists is that &lt;strong&gt;you don’t have random access of an element&lt;/strong&gt; in the list by its index. For example: If you wanted to retrieve the 5th element in a list, you would have to iterate through the list until you ran into it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stacks/Queues
&lt;/h3&gt;

&lt;p&gt;A Stack and a Queue are pretty much the same data structure, the only difference being how they order their information. We can implement both with our Node struct from earlier!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A Stack&lt;/strong&gt; operates last in, first out (LIFO). Think of a stack of cafeteria trays. The last tray you put on the stack will be the first one you pick up off the stack. A stack exposes three main functions: one to see the top, one to push to the top, and one to pop off the top.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A Queue&lt;/strong&gt; operates first in, first out. Think of a queue of people waiting in line. If you were first in line, you would be helped first. Similarly, if you’re last in line, you will be helped last. A queue exposes the same functions as a stack, with the implementation of push being slightly different. (We want to push to the &lt;em&gt;end&lt;/em&gt; of a queue.)&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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A2rSzCebGeD2Hk0bdCvEvMw.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%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A2rSzCebGeD2Hk0bdCvEvMw.png"&gt;&lt;/a&gt;Basic Stack and Queue implementations based off our Node from earlier&lt;/p&gt;

&lt;p&gt;Stacks and Queues are great for &lt;strong&gt;maintaining order based on insertion time:&lt;/strong&gt; Use a Stack if you want to keep track of the most recent item. Use a Queue if you want to keep track of the oldest item.&lt;/p&gt;

&lt;p&gt;Don’t use either if you care about anything other than the most recent or oldest items.&lt;/p&gt;

&lt;h3&gt;
  
  
  Trees
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;A Tree&lt;/strong&gt; is a data structure that is very suited to parent-child relationships in data. It can be implemented by a simple Node class as we defined above, with the exception of having multiple children pointers instead of one next pointer.&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%2Fcdn-images-1.medium.com%2Fmax%2F730%2F1%2A0-7UYg7UUY79Zl6NGp300Q.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%2Fcdn-images-1.medium.com%2Fmax%2F730%2F1%2A0-7UYg7UUY79Zl6NGp300Q.png"&gt;&lt;/a&gt;A simple implementation of a tree. Note how every node is the “start” of it’s own subtree!&lt;/p&gt;

&lt;p&gt;Trees require a different type of thinking than Vectors, Linked Lists, or even Stacks/Queues. They introduce a concept of &lt;strong&gt;traversing a tree.&lt;/strong&gt; Because there is no set way to go from a parent to a child, you can choose between three main traversal methods:&lt;/p&gt;

&lt;h4&gt;
  
  
  Pre-Order Traversal
&lt;/h4&gt;

&lt;p&gt;Use a Pre-Order Traversal if you want to calculate something on the parent before doing the same on the children.&lt;/p&gt;

&lt;p&gt;Given our tree representation from above:&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%2Fcdn-images-1.medium.com%2Fmax%2F590%2F1%2A682N3EB9dBWURYPvHlegBA.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%2Fcdn-images-1.medium.com%2Fmax%2F590%2F1%2A682N3EB9dBWURYPvHlegBA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  In-Order Traversal
&lt;/h4&gt;

&lt;p&gt;Use an In-Order Traversal if you want to calculate something on the left child, then the parent, and finally the right child. This is typically only used for binary trees, trees with only a max of two children per Node.&lt;/p&gt;

&lt;p&gt;Given our tree representation from above:&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%2Fcdn-images-1.medium.com%2Fmax%2F590%2F1%2AjxPrzsO0IpZxRhPB5sf20g.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%2Fcdn-images-1.medium.com%2Fmax%2F590%2F1%2AjxPrzsO0IpZxRhPB5sf20g.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Post-Order Traversal
&lt;/h4&gt;

&lt;p&gt;Use a Post-Order Traversal if you want to calculate something on the children before doing the same on the parent.&lt;/p&gt;

&lt;p&gt;Given our tree representation from above:&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%2Fcdn-images-1.medium.com%2Fmax%2F590%2F1%2AWNe5ibhftL0ltNluyIAaWA.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%2Fcdn-images-1.medium.com%2Fmax%2F590%2F1%2AWNe5ibhftL0ltNluyIAaWA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Maps
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;A Map&lt;/strong&gt; is a way to represent data in terms of a key and a value. A proper implementation offers very quick insertion, lookup, and removal times.&lt;/p&gt;

&lt;p&gt;The base of a good map implementation is it’s hash function. The purpose of this hash is to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Provide a hashed, or encoded, output given any valid input&lt;/li&gt;
&lt;li&gt;Always return the same output given the same input&lt;/li&gt;
&lt;li&gt;Minimize collisions, when two inputs returns the same output&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%2Fcdn-images-1.medium.com%2Fmax%2F856%2F1%2A4y-A-qQZyD6EzcmIaOrT2Q.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%2Fcdn-images-1.medium.com%2Fmax%2F856%2F1%2A4y-A-qQZyD6EzcmIaOrT2Q.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Maps are incredibly powerful because of how quickly you can manipulate them. (O(1) for insertion, deletion, and lookup!) This speed lends itself very well for most interview questions, to the point of making them trivial.&lt;/p&gt;

&lt;p&gt;Get to know Maps very well.&lt;/p&gt;

&lt;h3&gt;
  
  
  Graphs
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;A Graph&lt;/strong&gt; is a flexible data structure that can be used to represent data with complex relationships between Nodes. It is most similar to a Linked List, but every Node can have n number of pointers to other Nodes. A Graph is also not guaranteed to be free of cycles. (A cycle is when you can start and end at the same Node while traversing the graph.)&lt;/p&gt;

&lt;p&gt;A Graph implementation is actually quite simple:&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%2Fcdn-images-1.medium.com%2Fmax%2F730%2F1%2A7q-5bKXDNySNL2JpWvGPug.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%2Fcdn-images-1.medium.com%2Fmax%2F730%2F1%2A7q-5bKXDNySNL2JpWvGPug.png"&gt;&lt;/a&gt;Notice how you can get to a OR c from b, but not necessarily the other way around!&lt;/p&gt;

&lt;p&gt;We can model a lot of situations using graphs, such as: friendships between users, airplane routes, etc. Graphs can make any problem with complex relationships quite simple, and going from one Node to another is as simple as traversing through its neighbors. (Examples are mentioned in the Appendix: Path-finding and Dijkstra’s.)&lt;/p&gt;

&lt;h3&gt;
  
  
  Appendix
&lt;/h3&gt;

&lt;p&gt;These were some of the basic data structures that can be found in course curricula and interview questions. If you want to expand your knowledge further (and go from 60 to 120!), here are some advanced Data Structures and Algorithms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://blog.ostermiller.org/find-loop-singly-linked-list" rel="noopener noreferrer"&gt;Cycles in Linked Lists&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://faculty.cs.niu.edu/~hutchins/csci241/eval.htm" rel="noopener noreferrer"&gt;Using a Stack to evaluate mathematical expressions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.topcoder.com/community/data-science/data-science-tutorials/using-tries/" rel="noopener noreferrer"&gt;Tries: a fancy tree that allows efficient path lookup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://en.wikipedia.org/wiki/Set_(abstract_data_type)" rel="noopener noreferrer"&gt;Sets: when you only want to remember if you’ve seen an element before&lt;/a&gt;(great replacement for map&amp;lt;[anything], bool&amp;gt;)&lt;/li&gt;
&lt;li&gt;Path-finding algorithms (&lt;a href="http://blog.hackerearth.com/kruskal-algorithm-minimum-spanning-tree-example" rel="noopener noreferrer"&gt;Kruskal’s&lt;/a&gt; and &lt;a href="https://www.tutorialspoint.com/data_structures_algorithms/prims_spanning_tree_algorithm.htm" rel="noopener noreferrer"&gt;Prim’s&lt;/a&gt;), for when you want to find a path between two nodes in a graph&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/vaidehijoshi/finding-the-shortest-path-with-a-little-help-from-dijkstra-cmi"&gt;Dijkstra’s Algorithm: find the path of least resistance between two nodes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Further Resources
&lt;/h3&gt;

&lt;p&gt;If you prefer books over blog posts, I highly recommend (in order of readability):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://amzn.to/2D0owJL" rel="noopener noreferrer"&gt;Algorithms to Live By: The Computer Science of Human Decisions&lt;/a&gt;: A great read on how you can apply algorithms in your daily life. Not a very academic read.&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://amzn.to/2FvQ5fB" rel="noopener noreferrer"&gt;Grokking Algorithms&lt;/a&gt;: An incredible book for not only its simple explanations and relation to real world examples, but also PICTURES!&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://amzn.to/2CYIPHh" rel="noopener noreferrer"&gt;Introduction to Algorithms, 3rd Edition&lt;/a&gt;: A great reference book, used for Intermediate Data Structures and Algorithms at UCR.&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://amzn.to/2Ds0NDo" rel="noopener noreferrer"&gt;Algorithms, 4th Edition&lt;/a&gt;: Written by the legendary Robert Sedgewick, super informative. (Sedgewick has been teaching algorithms since the peak of Fortran!)&lt;/li&gt;
&lt;/ul&gt;




</description>
      <category>computerscience</category>
      <category>datastructures</category>
    </item>
    <item>
      <title>Cleaning Up Your Code: Testing</title>
      <dc:creator>Aaroh Mankad</dc:creator>
      <pubDate>Wed, 03 Jan 2018 03:47:26 +0000</pubDate>
      <link>https://forem.com/aarohmankad/cleaning-up-your-code-testing-47h7</link>
      <guid>https://forem.com/aarohmankad/cleaning-up-your-code-testing-47h7</guid>
      <description>

&lt;p&gt;This is an excerpt from my article &lt;a href="https://medium.com/acm-ucr/cleaning-up-your-code-8c2a88cb47fc"&gt;"Cleaning Up Your Code" on Medium&lt;/a&gt;. I'll be publishing each section daily, read ahead on Medium!&lt;/p&gt;

&lt;p&gt;Before I start explaining the specifics of testing in certain languages, I want to start by explaining the concept of &lt;em&gt;Test Driven Development&lt;/em&gt;. You may have heard the term before but thought that your project wasn’t big enough to adopt this method of developing.&lt;/p&gt;

&lt;p&gt;Test Driven Development (TDD) is a method of developing in which you write tests before you write &lt;em&gt;any&lt;/em&gt; code. Why would you want to do this?&lt;/p&gt;

&lt;p&gt;TDD actually enforces writing tests for your code! Many times you’ll write a program, run some examples and call it done. However, you’ve likely missed several bugs in your code by testing only the optimal cases. If you did manage to find some bugs and fix them, it is more work to make sure your fix did not break any previous cases. For this reason, tests serve as a method of documentation for all the cases you’ve checked so far and as a way to force you to think of ways to break your code.&lt;/p&gt;

&lt;p&gt;So what makes a good test? Follow the F.I.R.S.T method!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fast:&lt;/strong&gt; If a test is slow, your approach to the task is probably not optimal. If the test is slow for a sample size of one, imagine how that would scale to a system of a million users!&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Independent:&lt;/strong&gt; A test should not depend on the outcome of another test. In the case that tests were &lt;em&gt;dependent&lt;/em&gt;, then your tests would fall in a domino effect, hiding bugs in a different test until you fix the first bug. (Not ideal for when you’re working in teams asynchronously.)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Repeatable:&lt;/strong&gt; A test should not leave anything to chance. Every time you run a test, assuming no changes to the code have been made, you should expect an identical outcome. If the test cannot be repeated, you will eventually fall into a “It works on my machine!” attitude which is not beneficial to your team or your users.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Self-Validating:&lt;/strong&gt; A test should return a boolean, true or false. This allows us to automate the job of testing our code, checking if all the tests return true or not. If you have to check some printed output to see if it matches the expected output, you could instead do a diff on the expected string and the returned string. (This changes our test from a &lt;code&gt;string&lt;/code&gt; return type to a &lt;code&gt;bool&lt;/code&gt; return type!)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Timely&lt;/strong&gt; : This is the self-fulfilling prophecy in F.I.R.S.T. If you write your tests in a timely manner, your testing will go smoothly. Do not put off writing tests in favor of extending the functionality of your program.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some housekeeping notes, but keep your tests separate from your actual program logic, ideally in a &lt;code&gt;/tests&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;Testing can be very domain-specific in its scope. My experience is primarily in Javascript and C++, which I feel represent two very different sides of programming. (Hopefully your language of choice falls somewhere on that spectrum!)&lt;/p&gt;

&lt;h4&gt;Javascript&lt;/h4&gt;

&lt;p&gt;Before you start thinking that tests have to be this fancy concept of your code that can only take a significant portion of your development time, remember that a test can be as simple as checking the output of a function to the expected output!&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;  &lt;/div&gt;

&lt;p&gt;There are more robust ways to write tests in Javascript, mostly due to the vibrant developer community. Most commonly used is the &lt;em&gt;test runner&lt;/em&gt;. A test runner will automatically run all your tests and present them in a very clean format. It is also much more extensible in the use case that you have databases of objects and want to mock some test data for your tests.&lt;/p&gt;

&lt;p&gt;The test runner that I’m going to recommend is &lt;strong&gt;Jest&lt;/strong&gt;. Jest is used by Facebook to test all their JavaScript code including their React applications. To me, Jest has a lot of reputation from being backed by Facebook and having a team dedicated to its active development.&lt;/p&gt;

&lt;p&gt;To learn how to start using Jest, I highly recommend Fun Fun Function:&lt;/p&gt;

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

&lt;h4&gt;C++&lt;/h4&gt;

&lt;p&gt;As in Javascript, sometimes the easiest way to test your code in C++ is with some assert statements.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;  &lt;/div&gt;

&lt;p&gt;When you want to get into some more complex testing, such as checking for memory leaks, you may want to start using &lt;em&gt;static analyzers&lt;/em&gt;. First, use &lt;a href="http://cppcheck.sourceforge.net/"&gt;cppcheck&lt;/a&gt; to see if you even have a memory leak in the first place. cppcheck can also offer advice for better performance or cleaner code style.&lt;/p&gt;

&lt;p&gt;If you do end up having a memory leak or segmentation fault, one option is to compile your program with the -g flag for debugging support. Then you can run your program with &lt;a href="https://www.gnu.org/software/gdb/"&gt;GDB&lt;/a&gt; (GNU DeBugger). GDB allows you to set breakpoints in your code, step through functions, inspect values at each step, and locate segmentation faults.&lt;/p&gt;

&lt;p&gt;Fun fact: You can also use GDB as a disassembler for executables!&lt;/p&gt;

&lt;p&gt;Thanks for reading! How do you test your code?&lt;/p&gt;


</description>
      <category>coding</category>
      <category>productivity</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Cleaning Up Your Code: Consistent Formatting</title>
      <dc:creator>Aaroh Mankad</dc:creator>
      <pubDate>Sat, 30 Dec 2017 01:25:58 +0000</pubDate>
      <link>https://forem.com/aarohmankad/cleaning-up-your-code-consistent-formatting-2gnn</link>
      <guid>https://forem.com/aarohmankad/cleaning-up-your-code-consistent-formatting-2gnn</guid>
      <description>&lt;p&gt;This is an excerpt from my article &lt;a href="https://medium.com/acm-ucr/cleaning-up-your-code-8c2a88cb47fc"&gt;"Cleaning Up Your Code" on Medium&lt;/a&gt;. I'll be publishing each section daily, read ahead on Medium!&lt;/p&gt;

&lt;p&gt;An age-old debate: tabs or spaces? Braces on the same line or new line?&lt;/p&gt;

&lt;p&gt;I’m not going to suggest any specific formatting, but I do want to expose you to some guidelines on deciding formatting for your project. First and foremost, once you’ve found a method of formatting to use, &lt;strong&gt;stick to it&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;There’s two steps to getting most of the way to a perfect style guide for your project.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pick a popular style guide for your language&lt;/strong&gt;. Picking a style guide that more people have been exposed to will reduce the time a new contributor focuses on syntax and more time on making meaningful contributions to your code. Examples are included below.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make slight variations to it for your specific use cases&lt;/strong&gt;. If a certain point in your chosen style guide doesn’t make sense for your use case, document it. (Ideally in a CONTRIBUTING.md file!)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://github.com/airbnb/javascript"&gt;Airbnb Style Guide for Javascript&lt;/a&gt;&lt;br&gt;
&lt;a href="https://google.github.io/styleguide/cppguide.html"&gt;Google Style Guide for C++&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.python.org/dev/peps/pep-0008/"&gt;PEP8 Style Guide for Python&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're working in Javascript, I highly recommend using &lt;a href="https://prettier.io/"&gt;Prettier&lt;/a&gt; to automatically handle the formatting for you! I use the &lt;a href="https://github.com/jonlabelle/SublimeJsPrettier"&gt;JsPrettier Package for Sublime Text&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thanks for reading! How do you enforce consistent code-style in your projects?&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>productivity</category>
      <category>coding</category>
    </item>
    <item>
      <title>Cleaning Up Your Code: Abstracting Reused Code</title>
      <dc:creator>Aaroh Mankad</dc:creator>
      <pubDate>Thu, 28 Dec 2017 19:39:55 +0000</pubDate>
      <link>https://forem.com/aarohmankad/cleaning-up-your-code-abstracting-reused-code-4mea</link>
      <guid>https://forem.com/aarohmankad/cleaning-up-your-code-abstracting-reused-code-4mea</guid>
      <description>&lt;p&gt;This is an excerpt from my article &lt;a href="https://medium.com/acm-ucr/cleaning-up-your-code-8c2a88cb47fc"&gt;"Cleaning Up Your Code" on Medium&lt;/a&gt;. I'll be publishing each section daily, read ahead on Medium!&lt;/p&gt;

&lt;p&gt;If you’ve found pieces of code in your codebase that are heavily duplicated or rely on the same logic, they are probably great contenders for abstraction.&lt;/p&gt;

&lt;p&gt;Abstracting code into a separate function or class can help reduce code complexity. If your algorithm related to that block of code changes, you only have to change it in one place versus changing it in multiple places across your codebase.&lt;/p&gt;

&lt;p&gt;What does a good abstraction look like? Well let’s take &lt;a href="https://dev.to/aarohmankad/cleaning-up-your-code-good-names-2e0o"&gt;our example from earlier&lt;/a&gt;. The &lt;code&gt;great_names.cpp&lt;/code&gt; file is really easy to read! However, we would have to rewrite that code block if we ever wanted to find a cell based on a different &lt;code&gt;FLAG_CODE&lt;/code&gt; or in a different &lt;code&gt;gameBoard&lt;/code&gt;. So let’s move that code into an isolated function.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Before you decide to start splitting your code apart, here are some things to keep in mind:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Keep your functions small&lt;/strong&gt;: A small function is easy to read, but also very easily reused. Your function should be able to be used for a wide variety of use cases, not just the one case it used to be in.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Limit the functionality&lt;/strong&gt;: If your code does more than one exact thing, it will be difficult to use it across your codebase. Continue splitting your code until your functions have only one purpose each.Then you can implement a function to call these smaller functions in any way you wish!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ensure no side effects&lt;/strong&gt;: A function should be thought of as a walled off piece of code that you control. It should purely accept input and return output. A &lt;em&gt;pure&lt;/em&gt; function is a function that does not affect any code it does not have direct access to. A simple example would be an impure add function that adds two variables outside of its scope. This is very hard to keep track of and should be avoided in most situations.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks for reading! What are your approaches to breaking up reusable blocks of code?&lt;/p&gt;

</description>
      <category>coding</category>
      <category>productivity</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Cleaning Up Your Code: Good Names</title>
      <dc:creator>Aaroh Mankad</dc:creator>
      <pubDate>Thu, 28 Dec 2017 03:13:42 +0000</pubDate>
      <link>https://forem.com/aarohmankad/cleaning-up-your-code-good-names-2e0o</link>
      <guid>https://forem.com/aarohmankad/cleaning-up-your-code-good-names-2e0o</guid>
      <description>&lt;p&gt;This is an excerpt from my article &lt;a href="https://medium.com/acm-ucr/cleaning-up-your-code-8c2a88cb47fc"&gt;"Cleaning Up Your Code" on Medium&lt;/a&gt;. I'll be publishing each section daily, read ahead on Medium!&lt;/p&gt;

&lt;p&gt;Programming is not a math equation. The vast majority of the programs you write will not be simple. They will have to interact with the rest of the program, forming complex relationships along the way, and therefore have to be read by other programmers. Someone with no idea of your contribution should be able to quickly understand what your code does.&lt;/p&gt;

&lt;p&gt;Let’s look at an example, which code snippet is easier to grasp?&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;If you’d like to start using good names throughout your codebase, here are some general rules to follow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Expose meaning through names&lt;/strong&gt;: Similar to the above example, the name of a variable should provide some meaning towards code functionality.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use pronounceable names&lt;/strong&gt;: Software Development involves talking through your code with other developers. It will help a lot if you can actually talk through your code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use searchable names&lt;/strong&gt;: There will be many times you want to track a variable or function through your codebase. In this case, the variable should be unique enough that it can be searched for with few duplicates.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks for reading! How do you make sure your code is understandable to yourself and colleagues?&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>productivity</category>
      <category>coding</category>
    </item>
    <item>
      <title>Bash Functions: A more powerful Alias</title>
      <dc:creator>Aaroh Mankad</dc:creator>
      <pubDate>Sun, 24 Dec 2017 18:59:24 +0000</pubDate>
      <link>https://forem.com/aarohmankad/bash-functions-a-more-powerful-alias-4p3i</link>
      <guid>https://forem.com/aarohmankad/bash-functions-a-more-powerful-alias-4p3i</guid>
      <description>&lt;p&gt;If you use bash a fair amount, you probably have &lt;a href="https://codeburst.io/use-bashrc-alias-to-become-a-more-efficient-programmer-60f0765edbe0"&gt;some aliases set up&lt;/a&gt;. However, have there been times you wish you had some more control over the functionality of your alias?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Let’s examine one example: a bash alias and a bash function for extracting a file.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;With an alias, we can easily abstract out the complicated &lt;code&gt;tar&lt;/code&gt; command to simply &lt;code&gt;extract&lt;/code&gt;.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Now we can type &lt;code&gt;extract file.tar.gz&lt;/code&gt; or &lt;code&gt;extract file.tgz&lt;/code&gt; and the command will extract the file. We can even specify output directories!&lt;/p&gt;

&lt;p&gt;But what if we can’t rely on our downloaded file to have &lt;code&gt;.tar.gz&lt;/code&gt; / &lt;code&gt;.tgz&lt;/code&gt; extensions? Well in that case, a function for &lt;code&gt;extract&lt;/code&gt; makes more sense!&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Now we can call &lt;code&gt;extract&lt;/code&gt; without worrying about our file extension! We can just trust that the function will do exactly what it’s meant to.&lt;/p&gt;

&lt;p&gt;So how can I start using bash functions?&lt;/p&gt;

&lt;p&gt;First, import a file called &lt;code&gt;.bash_functions&lt;/code&gt; in your &lt;code&gt;.bashrc&lt;/code&gt;.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Now you can either &lt;a href="https://gist.github.com/aarohmankad/f17876d7550ff9dd1891727160b0f248"&gt;download my &lt;code&gt;.zsh_fns&lt;/code&gt; file&lt;/a&gt; (bash functions for &lt;code&gt;zsh&lt;/code&gt;) as a starting point, or create your own at &lt;code&gt;~/.bash_functions&lt;/code&gt;!&lt;/p&gt;

&lt;p&gt;Note: You must restart terminal or type &lt;code&gt;source .bashrc&lt;/code&gt; in your terminal to start using the new bash functions&lt;/p&gt;

</description>
      <category>terminal</category>
      <category>beginners</category>
      <category>productivity</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
