<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shari Rosenberg on Medium]]></title>
        <description><![CDATA[Stories by Shari Rosenberg on Medium]]></description>
        <link>https://medium.com/@shari_rosenberg?source=rss-c7be955476e8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9wOVtbHHUoNmNeBUgHuyPw.jpeg</url>
            <title>Stories by Shari Rosenberg on Medium</title>
            <link>https://medium.com/@shari_rosenberg?source=rss-c7be955476e8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 09:35:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shari_rosenberg/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Closures…]]></title>
            <link>https://medium.com/@shari_rosenberg/closures-e9047af08939?source=rss-c7be955476e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9047af08939</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Shari Rosenberg]]></dc:creator>
            <pubDate>Sun, 08 Sep 2019 16:16:50 GMT</pubDate>
            <atom:updated>2019-09-08T16:16:50.586Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*O8pvGOqm-7zPox5l" /><figcaption>Photo by <a href="https://unsplash.com/@cristina_gottardi?utm_source=medium&amp;utm_medium=referral">Cristina Gottardi</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Last week, I wrote a bit about scope. Taking scope to the next level, brings us to the concept of closures.</p><p>Javascript MDN documentation describes a closure as: A <em>closure</em> is the combination of a function and the lexical environment within which that function was declared.</p><p>Lets dig into that a bit deeper. Generally, whenever a function is invoked, a new scope is created for that call. The local variable declared inside the function belong to that scope — they can only be accessed from that function. However, a <strong>closure</strong> is a function which has access to the variable from another function’s scope. This is accomplished by <strong><em>creating a function inside a function.</em></strong> Of course, the outer function does not have access to the inner scope.</p><p>In other words, a closure gives you access to an outer function’s scope from an inner function. In JavaScript, closures are created every time a function is created, at function creation time. To use a closure, define a function inside another function and expose it. To expose a function, return it or pass it to another function.</p><p>A simple example:</p><pre>const message = &#39;The sky is blue.&#39;;<br>function sayMessage(){<br>  alert(message); // Here we have access to message,<br>  // even though it&#39;s declared outside this function!<br>}</pre><p>We’d say that <strong>message</strong> is “closed over” by <strong>sayMessage().</strong></p><p>Another example:</p><p>function makeName(name) { <br> var greeting = “Hello, “ + name + “!”; <br> var sayName = function() {<br> var welcome = greeting + “ Welcome!”;<br> console.log(greeting); <br> };<br> return sayName; <br>}</p><p>var sayMyName = makeName(“Ruby”);<br>sayMyName(); // Hello, Ruby. Welcome!</p><p>resources: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures</a>, <a href="https://medium.com/javascript-scene/master-the-javascript-interview-what-is-a-closure-b2f0d2152b36">https://medium.com/javascript-scene/master-the-javascript-interview-what-is-a-closure-b2f0d2152b36</a>, <a href="https://www.codingame.com/playgrounds/6516/closures-in-javascript-for-beginners">https://www.codingame.com/playgrounds/6516/closures-in-javascript-for-beginners</a>,<a href="https://www.interviewcake.com/concept/java/js-closure">https://www.interviewcake.com/concept/java/js-closure</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9047af08939" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scope it out!!!]]></title>
            <link>https://medium.com/@shari_rosenberg/scope-it-out-21a58341df53?source=rss-c7be955476e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/21a58341df53</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Shari Rosenberg]]></dc:creator>
            <pubDate>Sat, 31 Aug 2019 20:32:35 GMT</pubDate>
            <atom:updated>2019-08-31T20:32:35.537Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yBPT8fjKVvgS1Xpf" /><figcaption>Photo by <a href="https://unsplash.com/@daniel_christie97?utm_source=medium&amp;utm_medium=referral">Daniel Christie</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>One of the most confusing concepts in coding, especially in my Javascript experience, is scope. A scope in JavaScript defines what variables you have access to; where declared variables and methods are available within our code. There are two kinds of scope — global scope and local scope. Scoping rules vary from language to language. JavaScript has two scopes — <em>global </em>and <em>local</em>.</p><p><strong>Global Scope</strong></p><p>Any variable declared outside of a function belongs to the global scope, and is therefore accessible from anywhere in your code. If a variable is declared outside all functions or curly braces ({}), it is said to be defined in the global scope. Variables inside the Global scope can be accessed and changed in any other scope.</p><pre>var name = &#39;Joe&#39;;<br><br>console.log(name); // logs &#39;Joe&#39;<br><br>function logName() {<br>    console.log(name); // &#39;name&#39; is accessible here and everywhere else in the code<br>}<br><br>logName(); // logs &#39;Joe&#39;</pre><p>Once you’ve declared a global variable, you can use that variable anywhere in your code, even in functions. Although you can declare variables in the global scope, it is much better, not to. This is because there is a chance of naming two or more variables the same. If you declared your variables with const or let, you would receive an error whenever a duplicate name happens. If you declare your variables with var, your second variable overwrites the first one after it is declared. This also undesirable as you make your code hard to debug. Therefore, you should always declare local and not global variables.</p><p><strong>Local Scope</strong></p><p>Variables that are usable only in a specific part of your code are considered to be in a local scope. These variables are also called local variables. In JavaScript, there are two kinds of local scope: <strong>function scope</strong> and <strong>block scope.</strong></p><ol><li><strong><em>Function Scope</em></strong></li></ol><p>When we declare a new function and then write our code in the body of the function, we are no longer in the global scope. The function creates a new execution context with its own scope. Inside the function body, we can reference variables and functions declared within in the function’s scope. However, from outside the function, we can’t reference anything declared inside of it. Variables having the same name can be used in different functions. This is because those variables are bound to their respective functions, each having different scopes, and are not accessible in other functions.</p><pre>var test = &quot;I&#39;m global&quot;;<br><br>function testScope() {<br>  var test = &quot;I&#39;m local&quot;;<br><br>  console.log (test);     <br>}<br><br>testScope();           // output: I&#39;m local<br><br>console.log(test);     // output: I&#39;m global</pre><p><strong><em>2. Block Scope</em></strong></p><p>When you declare a variable with const or let within a curly brace ({}), you can access this variable only within that curly brace. Variables declared with var are <strong>not</strong> block-scoped. The block scope is a subset of a function scope since functions need to be declared with curly braces (unless you&#39;re using <a href="https://zellwk.com/blog/es6/#arrow-functions">arrow functions</a> with an implicit return)</p><pre>if (true) {<br>    // this &#39;if&#39; conditional block doesn&#39;t create a scope<br><br>    // name is in the global scope because of the &#39;var&#39; keyword<br>    var name = &#39;Joe&#39;;<br>    // likes is in the local scope because of the &#39;let&#39; keyword<br>    let likes = &#39;Coding&#39;;<br>    // skills is in the local scope because of the &#39;const&#39; keyword<br>    const skills = &#39;JavaScript and Ruby&#39;;<br>}<br><br>console.log(name); // logs &#39;Joe&#39;<br>console.log(likes); // Uncaught ReferenceError: likes is not defined<br>console.log(skills); // Uncaught ReferenceError: skills is not defined</pre><h3>This gives us some background on basic scoping. Stay tuned for future blogs that add more complexity to scoping such as hoisting and closures!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21a58341df53" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The clues to the Map…(ok not that kind of map)]]></title>
            <link>https://medium.com/@shari_rosenberg/the-clues-to-the-map-ok-not-that-kind-of-map-34fd55e96ef7?source=rss-c7be955476e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/34fd55e96ef7</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Shari Rosenberg]]></dc:creator>
            <pubDate>Wed, 21 Aug 2019 16:56:37 GMT</pubDate>
            <atom:updated>2019-08-21T16:56:37.679Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Lf-dCz7-R0sxXsMk" /><figcaption>Photo by <a href="https://unsplash.com/@paulamayphotography?utm_source=medium&amp;utm_medium=referral">Paula May</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Javascript ES6 introduced the data structure of the Map object. A map is a collection of elements where each element is stored as a Key, value pair.<em> </em>When we iterate over the map object it returns the key,value pair in the same order as inserted. <em>Note</em>- This is a totally different topic from the <strong><em>map() method</em></strong>. The <strong>map()</strong> method <strong>creates a new array</strong> with the results of calling a provided function on every element in the calling array.</p><p>An <em>Object</em> is similar to a <em>Map</em> in that both let you set keys to values, retrieve those values, delete keys, and detect whether something is stored at a key. However, there are some key differences described here:</p><ol><li>The keys of an Object are String and Symbol, whereas they can be any value for a Map, including functions, objects, and any primitive.</li><li>The keys in Map are ordered while keys added to object are not. Thus, when iterating over it, a Map object returns keys in order of insertion.</li><li>You can get the size of a Map easily with the <em>size </em>property, while the number of properties in an Object must be determined manually.</li><li>A Map is an iterable and can thus be directly iterated, whereas iterating over an Object requires obtaining its keys in some fashion and iterating over them.</li></ol><h4>Creating a new map:</h4><p>You create a new map by calling <strong>new Map()</strong>. This can be an array or any iterable object whose elements are key/value pairs. The provided key/value pairs are added to the new map using the <strong>set()</strong> function.</p><pre>var m = new Map()<br>m.set(&#39;a&#39;, 1)<br>m.set(&#39;b&#39;, 2)<br>// {&quot;a&quot; =&gt; 1, &quot;b&quot; =&gt; 2}</pre><h4><strong>Other key methods and properties for using the data in maps:</strong></h4><p><strong>m.size</strong> : Returns the number of key/value pairs in the Map object. N<strong>ote</strong>: m.length will return 0, must use .size.</p><p><strong>Map.set()</strong> — It adds the key and value to the Map Object.</p><p><strong>Map.has() </strong>— It return a boolean value depending on whether the specified <em>key</em> is present or not</p><p><strong>Map.get()</strong> — It returns the <em>value</em> of the corresponding <em>key</em></p><p><strong>Map.delete()</strong> — It delete’s both the<em> key </em>as well as a<em> value</em> from the map.</p><p><strong>Map.clear()</strong> — Removes all the elements from the Map object</p><h3><strong>Iterating over a map:</strong></h3><p><strong>map.forEach(fn)- </strong>usage:<br>var myMap = new Map();<br>myMap.set(0, &#39;zero&#39;);<br>myMap.set(1, &#39;one&#39;);</p><pre>myMap.forEach(function(value, key) {<br>  console.log(key + &#39; = &#39; + value);<br>});<br>// Will show 2 logs; first with &quot;0 = zero&quot; and second with &quot;1 = one&quot;</pre><p><strong>map.for..of - </strong>usage:</p><pre>var myMap = new Map();<br>myMap.set(0, &#39;zero&#39;);<br>myMap.set(1, &#39;one&#39;);<br>for (var [key, value] of myMap) {<br>  console.log(key + &#39; = &#39; + value);<br>}<br>// 0 = zero<br>// 1 = one<br><br>for (var key of myMap.keys()) {<br>  console.log(key);<br>}<br>// 0<br>// 1<br><br>for (var value of myMap.values()) {<br>  console.log(value);<br>}<br>// zero<br>// one<br><br>for (var [key, value] of myMap.entries()) {<br>  console.log(key + &#39; = &#39; + value);<br>}<br>// 0 = zero<br>// 1 = one</pre><p>resources: <a href="https://www.geeksforgeeks.org/map-in-javascript/">https://www.geeksforgeeks.org/map-in-javascript/</a>, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map</a>, <a href="https://flaviocopes.com/javascript-data-structures-map/#what-is-a-map">https://flaviocopes.com/javascript-data-structures-map/#what-is-a-map</a>, <a href="https://hackernoon.com/what-you-should-know-about-es6-maps-dc66af6b9a1e">https://hackernoon.com/what-you-should-know-about-es6-maps-dc66af6b9a1e</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34fd55e96ef7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Binary Tree- how do you grow?]]></title>
            <link>https://medium.com/@shari_rosenberg/binary-tree-how-do-you-grow-821362ca1851?source=rss-c7be955476e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/821362ca1851</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Shari Rosenberg]]></dc:creator>
            <pubDate>Sun, 18 Aug 2019 23:27:17 GMT</pubDate>
            <atom:updated>2019-08-18T23:27:17.293Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Bp_2R7kOjeZP8A9H" /><figcaption>Photo by <a href="https://unsplash.com/@johannsiemens?utm_source=medium&amp;utm_medium=referral">Johann Siemens</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>One of the most intimidating notions along my coding journey are the computer science terms and understanding how they relate to the code I write. One of the things that comes up most often are binary trees. So I thought I would do a little research to find out what they are and how to use them.</p><p>By definition: In computer science, a binary tree is a tree data structure in which each node has at most two children, which are referred to as the left child and the right child. Unlike Arrays, Linked Lists, Stack and queues, which are linear data structures, trees are hierarchical data structures. The elements that are directly under an element are called its children. The element directly above something is called its parent. When most people talk about binary trees, they’re more often than not thinking about binary <em>search </em>trees, so I’ll will be covering that.</p><p>-A binary search tree is considered <strong>balanced</strong> if every level of the tree is fully filled with the exception of the last level. On the last level, the tree is filled left to right.</p><p>-A <strong>Perfect </strong>binary search tree<strong> </strong>is one in which it is both full and complete (all child nodes are on the same level and each node has a left and a right child node).</p><p><strong>Binary Search Tree</strong> is a node-based binary tree data structure which has the following properties:</p><ul><li>The left subtree of a node contains only nodes with keys lesser than the node’s key.</li><li>The right subtree of a node contains only nodes with keys greater than the node’s key.</li><li>The left and right subtree each must also be a binary search tree.</li></ul><p>Why a binary search tree? They allow fast lookup, addition and removal of items, and can be used to implement either dynamic sets of items, or lookup tables that allow finding an item by its key (e.g., finding the phone number of a person by name). Binary search trees keep their keys in sorted order, so that lookup and other operations can use the principle of binary search: when looking for a key in a tree (or a place to insert a new key), they traverse the tree from root to leaf, making comparisons to keys stored in the nodes of the tree and deciding, on the basis of the comparison, to continue searching in the left or right subtrees. On average, this means that each comparison allows the operations to skip about half of the tree, so that each lookup, insertion or deletion takes time proportional to the logarithm of the number of items stored in the tree.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/339/1*5VywDCb7RYnKRo9CuthsKg.png" /><figcaption>Example if a binary search tree</figcaption></figure><h4>So why do we want to use a binary search tree: inserting, deleting and searching!!!</h4><p>This is just some basics around binary search trees. In a future blog, I will go into setting one up and using it!</p><p>references: <a href="https://en.wikipedia.org/wiki/Binary_tree">https://en.wikipedia.org/wiki/Binary_tree</a>, <a href="https://www.geeksforgeeks.org/binary-tree-set-1-introduction/">https://www.geeksforgeeks.org/binary-tree-set-1-introduction/</a>, <a href="https://www.geeksforgeeks.org/binary-search-tree-data-structure/">https://www.geeksforgeeks.org/binary-search-tree-data-structure/</a>, <a href="https://github.com/trekhleb/javascript-algorithms/tree/master/src/data-structures/tree/binary-search-tree">https://github.com/trekhleb/javascript-algorithms/tree/master/src/data-structures/tree/binary-search-tree</a>, <a href="https://initjs.org/implement-a-binary-search-tree-in-javascript-952a44ee7c26">https://initjs.org/implement-a-binary-search-tree-in-javascript-952a44ee7c26</a>, <a href="https://www.freecodecamp.org/news/data-structures-101-binary-search-tree-398267b6bff0/">https://www.freecodecamp.org/news/data-structures-101-binary-search-tree-398267b6bff0/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=821362ca1851" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tips on researching tech companies for interviewees…]]></title>
            <link>https://medium.com/@shari_rosenberg/tips-on-researching-tech-companies-for-interviewees-51d0ce745ccd?source=rss-c7be955476e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/51d0ce745ccd</guid>
            <category><![CDATA[interview]]></category>
            <dc:creator><![CDATA[Shari Rosenberg]]></dc:creator>
            <pubDate>Sun, 11 Aug 2019 12:32:28 GMT</pubDate>
            <atom:updated>2019-08-11T12:32:28.601Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4e785oWMjrnPB-x8" /><figcaption>Photo by <a href="https://unsplash.com/@helloquence?utm_source=medium&amp;utm_medium=referral">Helloquence</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As a newly-minted software engineer interviewing for my first tech job, I felt it was important to gather as much information on companies and roles as I could. In speaking to my fellow boot-camp grads, not all of them were aware of the ways to dig into the information, so I thought I would highlight some of my methods.</p><p>Company Website- Key source of what the company shows to the world. Look at press releases, mission statements, management information, overview statements. Note any key wording they use to describe their key values- try to bring those into how you describe what you are looking for.</p><p>LinkedIn <a href="https://www.linkedin.com/">https://www.linkedin.com</a>- this one should be the gold standard for where everyone starts to dig in. You can get overview of the company information, employees, open roles, articles, etc. Look for any connections that you have with the company- maybe a former classmate or colleague works or worked there- reach out for information and contacts. Use that network! If you have the name of your interviewer- make sure to research them as well- find any commonalities to make a connection with them- shared interests, educational intersections, work experience- anything to make you memorable to your interviewer will make you stand out in the crowd!</p><p>AngelList <a href="https://angel.co/">https://angel.co/</a>- Great for start up research- you can find out information on funding, investors, key employees, job postings, etc. Set up a profile while you are there to bring attention from the companies to you!</p><p>Crunchbase <a href="https://www.crunchbase.com/">https://www.crunchbase.com/</a> — similar to AngelList, but even larger with more information categories. Better for the larger start ups and more established tech companies. Provides more information in an more user friendly interface. No job listings. You need to pay a premium for some categories of information, but the free info is fine for a job interview.</p><p>Built With <a href="https://pro.builtwith.com/">https://pro.builtwith.com/</a> — Allows you to look up a company and see the tech stack they are working with, see if your skills are a match!</p><p>Siftery <a href="https://siftery.com/">https://siftery.com/</a> — similar to BuiltWith, focused on the SaaS side</p><p>Glassdoor <a href="https://www.glassdoor.com/index.htm">https://www.glassdoor.com/index.htm</a> -another great resource for interviews- they even will have other’s interview experiences. Look up reviews from employees- check for red flags and issues of concern.</p><p>Google- again, obvious, but look up recent articles and company news- any recent acquisitions or new product launches- great talking points or question issues to discuss in your interview. Google the industry- any key changes going on, find competitors to research, any regulatory issues that might impact the business?</p><p>Twitter- check the twitter feed from the company to see what they are highlighting, but also search the company- see what others might be saying about them</p><p>Facebook/Instagram- I don’t find these as helpful as the other sites, as the information here, is usually shared elsewhere, but if you want to leave no stone unturned, check them out too!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51d0ce745ccd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Big O goes on- sorting algorithms]]></title>
            <link>https://medium.com/@shari_rosenberg/big-o-goes-on-sorting-algorithms-758a2ff7acec?source=rss-c7be955476e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/758a2ff7acec</guid>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Shari Rosenberg]]></dc:creator>
            <pubDate>Sun, 04 Aug 2019 17:23:43 GMT</pubDate>
            <atom:updated>2019-08-04T17:23:43.270Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5Ud58yjtsDwMyWwz" /><figcaption>Photo by <a href="https://unsplash.com/@imaxpanama?utm_source=medium&amp;utm_medium=referral">Max Panamá</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As I continue to build my JavaScript algorithm skills, I can across some questions around sorting and what would be best regarding Big O. Sorting is simply arranging given data in ascending or descending order. There are a few key types of sorting, which are differentiated by the time taken to sort the given data, and the memory space required to do so.</p><ol><li>Bubble Sort</li><li>Insertion Sort</li><li>Selection Sort</li><li>Quick Sort</li><li>Merge Sort</li><li>Heap Sort</li></ol><p><strong>Each sorting algorithm has tradeoffs. </strong>So you have to know <em>what’s important</em> in the problem you’re working on. How large is your input? How many distinct values are in your input? How much space is acceptable? Once you know what’s important, you can pick the sorting algorithm that does it best. Let’s go through them to review how to decide.</p><p><strong>Bubble Sort</strong> is a simple algorithm which is used to sort a given set of n elements provided in form of an array with n number of elements. Bubble Sort compares each of the elements one by one and sorts them based on their values. If the given array has to be sorted in ascending order, then bubble sort will start by comparing the first element of the array with the second element, if the first element is greater than the second element, it will <strong>swap</strong> both the elements, and then move on to compare the second and the third element, and so on. If we have total n elements, then we need to repeat this process for n-1 times. <strong>Bubble Sort Complexity — Worst case timeO(n²), Best case timeO(n), Average case timeO(n²) and Space is O(1)</strong></p><p><strong>Insertion sort </strong>works by inserting elements from an unsorted array into a sorted subsection of the array, one item at a time. It works the way we sort playing cards in our hands. It starts from the index 1(not 0), and each index starting from index 1 is like a new card, that you have to place at the right position in the sorted subarray on the left. <strong>Insertion Sort Complexity — Worst case timeO(n²), Best case timeO(n), Average case timeO(n²) and Space is O(1)</strong></p><p><strong>Selection sort</strong> is in theory, the most simplest sorting algorithm. It works by <em>selecting</em> the smallest element from an unsorted array and moving it to the front. This algorithm will first find the smallest element in the array and swap it with the element in the first position, then it will find the second smallest element and swap it with the element in the second position, and it will keep on doing this until the entire array is sorted. <strong>Selection sort takes O(n²) time and O(1)space.</strong></p><p><strong>Quick Sort </strong>is done while <strong>dividing</strong> the array into subarrays. Quicksort works by recursively dividing the input into two smaller arrays around a pivot item: one half has items smaller than the pivot, the other has larger items. The pivot element can be any element from the array, it can be the first element, the last element or any random element. This algorithm divides the list into three main parts:</p><ol><li>Elements less than the pivot element</li><li>Pivot element(Central element)</li><li>Elements greater than the pivot element</li></ol><p>Complexity for Quick Sort — Worst case time: O(n²), Best case time: O(n*log n), Average case time O(n*log n) and Space O(n*log n)</p><p><strong>Merge Sort </strong>follows the rule of <strong>Divide and Conquer</strong> to sort a given set of numbers/elements, recursively, hence consuming less time. Merge sort works by splitting the input in half, recursively sorting each half, and then merging the sorted halves back together.</p><p>Complexity- overall, merge sort takes O(n*log n) time and O(n) for space</p><p><strong>Heap Sort </strong>is similar to selection sort — we’re repeatedly choosing the largest item and moving it to the end of our array. But we use a heap to get the largest item more quickly. Heap Sort is one of the best sorting methods being in-place and with no quadratic worst-case running time. Heap sort involves building a <strong>Heap </strong>data structure from the given array and then utilizing the Heap to sort the array.</p><p>Heap sort algorithm is divided into two basic parts:</p><ul><li>Creating a Heap of the unsorted list/array.</li><li>Then a sorted array is created by repeatedly removing the largest/smallest element from the heap, and inserting it into the array. The heap is reconstructed after each removal.</li></ul><p>Time Complexity: <strong>O(n*log n) and </strong>Space Complexity : <strong>O(1)</strong></p><p>Hopefully this gives you an overall view to give you an idea how you might want to sort your data- I recommend checking out these references for more information…</p><p>References: <a href="https://www.studytonight.com/data-structures/introduction-to-sorting">https://www.studytonight.com/data-structures/introduction-to-sorting</a>, <a href="https://www.interviewcake.com/sorting-algorithm-cheat-sheet">https://www.interviewcake.com/sorting-algorithm-cheat-sheet</a>, <a href="https://medium.com/@MarcHoag/three-days-ago-i-had-no-idea-what-things-like-big-o-or-sorting-algorithms-were-now-ill-teach-you-124432c00a96">https://medium.com/@MarcHoag/three-days-ago-i-had-no-idea-what-things-like-big-o-or-sorting-algorithms-were-now-ill-teach-you-124432c00a96</a>, <a href="https://medium.com/javascript-scene/time-complexity-big-o-notation-1a4310c3ee4b">https://medium.com/javascript-scene/time-complexity-big-o-notation-1a4310c3ee4b</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=758a2ff7acec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My first conference as a developer!]]></title>
            <link>https://medium.com/@shari_rosenberg/my-first-conference-as-a-developer-1a598ae63669?source=rss-c7be955476e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a598ae63669</guid>
            <category><![CDATA[conference]]></category>
            <category><![CDATA[code-newbie]]></category>
            <dc:creator><![CDATA[Shari Rosenberg]]></dc:creator>
            <pubDate>Thu, 25 Jul 2019 16:43:56 GMT</pubDate>
            <atom:updated>2019-07-25T16:43:56.757Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*utkdExYITQTOwnAI3tkV1w.jpeg" /></figure><p>As a newly minted software developer and bootcamp grad, a big part of my road to employment is learning and networking. In the tech world, a key intersection of these goals is at conferences. While attending conferences on your own can be intimidating, I decided to attend Codeland, which is put together by CodeNewbie- right in my wheelhouse. This conference is geared to participants relatively new to coding- those learning or in their first roles, so I figured I would fit right in. I was right- it was an inclusive and welcoming environment, and I am so glad I attended!</p><p><a href="https://codelandconf.com/#program">Codeland Conference</a></p><p>I thought I would share some insights through this blog post on my experience, for those who are thinking of attending a conference and are unsure of what to expect. Hopefully this gives you a boost to leap in and attend one soon!</p><p>I learned about this conference by following CodeNewbie on Twitter- they, and many others in the tech Twitter space, were talking about it and it sounded great. Since it was being held here in NYC, I felt it would be a great opportunity for me, as there were no travel costs to consider. So, I bought my ticket (different options of costs, based on when you bought, and if you wanted to attend a workshop). I bought a ticket that included a workshop, as I felt it would be a great learning experience. A few weeks before the conference, a note was sent out to choose your workshop- I recommend choosing right away, as many of them filled up fast. I chose a great workshop called “Building with Accessibility in Mind” which was taught by Luisa Morales, who is a computer science master’s student at Pace University in NYC and an Engineering Fellow at The Mayor’s Office for Economic Opportunity (NYCO). As Accessibility in coding is a keen interest of mine, it was my first choice.</p><p>On conference day, I went downtown to NYU Skirball for a long, but inspiring day- we kicked off with breakfast and networking while perusing tables with fun swag, set up by sponsors of the event- including a great coffee bar set up by my bootcamp alma mater- Flatiron School.</p><p>We then headed in for the opening speakers including a kickoff Bollywood dance to get our blood flowing. The link above has more about the speakers, but just to say, they were inspiring, and thought provoking. After the opening speakers, we split into two tracks- A and B- as my workshop of choice was track B, I headed next door and up to my workshop. The workshop was great and we had opportunities to pair program and learn different ways to include accessibility in our future projects. We also were given some great resources to follow up with, and I can’t wait to dive deeper into the topic.</p><p>After a lunch break with an opportunity to network with new friends, we had a great afternoon of topical speakers, and I again was inspired by wonderful talks on a range of subjects. Then we had a quick snack break, a chance to visit sponsor tables, and then our closing keynote speakers. The day ended with an afterparty put on by GitHub, a generous sponsor of the event.</p><p>Some key highlights for me-</p><ol><li>An opportunity to network and meet fellow new coders who are in the same place that I am in- knowing you are not alone makes a huge difference</li><li>Inspired by some great speakers who are using code to address natural disasters, build communication tools to resolve human divides, and help cope with disease.</li><li>Remembering to laugh at myself- we all trip ourselves up at times and are human- humor is a great way to cope!</li></ol><p>I hope this inspires you to attend a conference soon- I highly recommend Codeland or any other that fits your needs and budget.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a598ae63669" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My take on the Big O]]></title>
            <link>https://medium.com/@shari_rosenberg/my-take-on-the-big-o-31fd573e95fb?source=rss-c7be955476e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/31fd573e95fb</guid>
            <category><![CDATA[big-o-notation]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Shari Rosenberg]]></dc:creator>
            <pubDate>Sun, 21 Jul 2019 19:11:31 GMT</pubDate>
            <atom:updated>2019-07-21T19:11:31.445Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QJilH6fOVw7ClwUu" /><figcaption>Photo by <a href="https://unsplash.com/@cadop?utm_source=medium&amp;utm_medium=referral">Mathew Schwartz</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Okay, we all may have giggled the first time we heard the term, or our eyes glazed over at the thought of some complex terminology. In a way, it scared me a bit- it seemed like a something only a PhD data scientist might need to deal with. But in reality, all programmers need to know what it is, and how it affects what we write.</p><p>What is Big O- in simple terms, it is the way we describe the efficiency of an algorithm. If you think about it- the more complex your algorithm is, the more time it will take to run, and as we all know- time is money. Additionally, we look at memory-the amount of space your program run takes, is also a resource drain.</p><p>By definition, Big O specifically describes the worst-case scenario when running an algorithm, and can be used to describe the execution time required or the space used by an algorithm. <strong><em>Big O Notation</em></strong> uses mathematical functions to describe algorithm’s runtime performance. The function is written within parentheses after a capital letter O.</p><p>Some of the types of times you will typically see:</p><ul><li>O(1) — Constant time complexity : This is the fastest O and the “Best case scenario”— O(1) describes an algorithm that will always execute in the same time (or space) regardless of the size of the input data set. An example is console logging the first item in an array of items. You could also see push() or pop() on your array. It is one step in your code, no matter how many items are in your array.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*-LF284XVB1gyF2Flkjhu3w.png" /></figure><ul><li>O(n) — Linear time complexity : This is where a loop would come into play- this example is O(n) as it runs for every value in our input. The operation increases in a linear fashion according to the inputs, where(n) represents the number of inputs ie; the time it will take to run the algorithm will increase proportionately as the size of input <em>n </em>increases. Following from the example above, console logging each item in the array. It will have to go through n times.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*G9a9d65sXBnC6aWgRXx7ag.png" /></figure><p>Now it gets a big more confusing….</p><ul><li>O(n²) (or quadratic time) — O(n²) is an algorithm where the performance is directly proportional to the square of the size of the input data set. This is common with algorithms that involve nested loops over the data. Deeper nested iterations will result in O(n³), O(n⁴) etc. This is known as quadratic time which means that every time the number of elements increases, we increase the operations quadratically. Every element of the array, would have to be compared to every other element.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*GwEVD5EXC5rZt9LRUgZ0LQ.png" /></figure><p>even more confusing…</p><ul><li>O(log n) — Logarithmic time complexity — this shows the time it takes to run the algorithm is proportional to the logarithm of the input size n. It narrows down the search by repeatedly halving the dataset until you find the target value. Using binary search — which is a form of logarithmic algorithm, finds the median in the array and compares it to the target value. The algorithm will traverse either upwards or downwards depending on the target value being higher than, lower than or equal to the median.</li></ul><p>Attached is a chart comparing the types:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*QBY1wVRPYagmpDe_X3eywQ.png" /><figcaption><a href="https://kuanhsuh.github.io/Javascript-Algorithm.html">https://kuanhsuh.github.io/Javascript-Algorithm.html</a></figcaption></figure><p>I hope this gives a little bit of clarity of what people are talking about when they mention Big O!!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31fd573e95fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linking your projects to GitHub]]></title>
            <link>https://medium.com/@shari_rosenberg/linking-your-projects-to-github-9c8711f6f427?source=rss-c7be955476e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c8711f6f427</guid>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Shari Rosenberg]]></dc:creator>
            <pubDate>Sun, 14 Jul 2019 21:57:28 GMT</pubDate>
            <atom:updated>2019-07-14T21:57:28.001Z</atom:updated>
            <content:encoded><![CDATA[<p>Everyone has that one process that they can never remember- each time you need to do a certain action, you need to look it up. Sometimes, it is the simplest things- for me, it is linking a project, such as a React app, to my GitHub account.</p><p>Additionally, when I try to Google setting up a project on GitHub, it inevitably sends me to information on how to host my project on GitHub, but not link it to my existing repository account. So, below, I am going to walk through the basic GitHub linking process, in case you have come across this yourself.</p><p>This can be done either by first creating the repository and then setting up the project, or if you have a project you are already working on, secondarily setting up the GitHub link.</p><p>Step 1: Create a new repository in GitHub- At the top right hand corner of your GitHub account, click the plus sign (+), and then in the drop down, click the new repository line. it will then take you to this page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*AH4VhK8gPqL3GEgHhWtHKA.png" /></figure><p>Step 2: Enter your project name into the Repository Name box, and a description if you wish- this is optional. Then click Create repository</p><p>Step 3: It will take you to this page- copy the SSH code on the top line using the icon to the right of it. You will use this at a later step</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*Kig5ItWh_iKKFYeAH_ynzA.png" /></figure><p>Step 4: Open your terminal and create your project- this this case, I will use create-react-app test-project. Once that runs, cd into the app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*SkWbHEDGBCktoOCzufoVLw.png" /></figure><p>Step 5: Add project to the GitHub</p><p>type in- git init</p><p>next type in- git add .</p><p>then type- git commit -m “first commit”</p><p>next- git remote add origin &lt;and then paste in the SSH address you copied in Step 3&gt;</p><p>and lastly type in- git push -u origin master</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*pu8wDCzmpBo_L_VzDt9KpQ.png" /></figure><p>Step 6: Lastly, you can open up your code editor and start working on your project!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c8711f6f427" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Coding Interview Prep Tools- algos and more]]></title>
            <link>https://medium.com/@shari_rosenberg/coding-interview-prep-tools-algos-and-more-364434995747?source=rss-c7be955476e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/364434995747</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[algo]]></category>
            <category><![CDATA[interview]]></category>
            <dc:creator><![CDATA[Shari Rosenberg]]></dc:creator>
            <pubDate>Sun, 07 Jul 2019 15:31:46 GMT</pubDate>
            <atom:updated>2019-07-09T16:15:47.958Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*InIORXS2cGzxrwMA" /><figcaption>Photo by <a href="https://unsplash.com/@steve3p_0?utm_source=medium&amp;utm_medium=referral">Steve Halama</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As I begin the job search process as a junior developer, I am a bit overwhelmed by all of the expectations of this journey- networking, blogging, Git commits and more. After graduating a challenging bootcamp, isn’t the ability to code apps enough?</p><p>The interview process for developer roles, even at the most junior levels, is grueling. Understandable that a company wants the best coders for their open roles, but in order to meet their expectations, the aspiring employees must be prepared for the challenges of the process.</p><p>Usually, the process has multiple stages- a behavioral/cultural interview, a coding challenge and an in-person technical interview that might include pair programming or whiteboarding. Depending on the company or role, each of these stages might include multiple interviews with different people.</p><p>Today’s blog is focused on the coding challenges that are algorithm based, and some great tools to practice those skills. These challenges are designed to test your analytical, coding, technical and communication skills. Sometimes these are part of a take home challenge, or might be done in person. Either way, there is usually a time constraint on completion, so even if you can’t complete the challenge, it is strongly suggested to at least pseudo-code out your approach to the problem, even if you can’t complete the code. This allows the reviewer to see those skills, even if it is not complete.</p><p>There are a lot of great tools out there to practice- some are free, and some have small fees- here are some that I am using:</p><ol><li>The ever popular- Cracking the Coding Interview- book by Gayle Laakmann McDowell. This book is the gold standard and has practice questions and solutions as well as sound advice. <a href="https://www.amazon.com/Cracking-Coding-Interview-Programming-Questions/dp/0984782850/ref=sr_1_3?crid=1KSZBR0G277ZL&amp;keywords=cracking+the+coding+interview&amp;qid=1562512886&amp;s=gateway&amp;sprefix=crack%2Caps%2C146&amp;sr=8-3">https://www.amazon.com/Cracking-Coding-Interview-Programming-Questions</a></li><li>A great Udemy course-by Stephen Grider: <a href="https://www.udemy.com/coding-interview-bootcamp-algorithms-and-data-structure/">https://www.udemy.com/coding-interview-bootcamp-algorithms-and-data-structure/</a></li><li>InterviewCake (https://www.interviewcake.com) a website that sends one problem a week, and provides a very thorough walkthrough of the solution</li><li>LeetCode (https://leetcode.com)/ CodeWars (https://codewars.com) these sites have problems seen on interviews and are great for practice</li><li>HackerRank Interview Prep Kit- <a href="https://www.hackerrank.com/interview/interview-preparation-kit">https://www.hackerrank.com/interview/interview-preparation-kit</a></li></ol><p>Good luck!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_5asc4MtUjLYAXkr" /><figcaption>Photo by <a href="https://unsplash.com/@xiaomingyo?utm_source=medium&amp;utm_medium=referral">Yan Ming</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=364434995747" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>