<?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 Ian Harold on Medium]]></title>
        <description><![CDATA[Stories by Ian Harold on Medium]]></description>
        <link>https://medium.com/@ian_hunter_harold?source=rss-d152d11b060d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fsFxEztYBNRt-FeiOFG2xQ.jpeg</url>
            <title>Stories by Ian Harold on Medium</title>
            <link>https://medium.com/@ian_hunter_harold?source=rss-d152d11b060d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 12:10:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ian_hunter_harold/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[General Motors Technical Interview Questions for Software Developer Role]]></title>
            <link>https://medium.com/@ian_hunter_harold/general-motors-technical-interview-questions-for-software-developer-role-faed2ea31d31?source=rss-d152d11b060d------2</link>
            <guid isPermaLink="false">https://medium.com/p/faed2ea31d31</guid>
            <category><![CDATA[general-motors-financial]]></category>
            <dc:creator><![CDATA[Ian Harold]]></dc:creator>
            <pubDate>Mon, 07 Sep 2026 17:40:13 GMT</pubDate>
            <atom:updated>2026-09-07T17:40:13.832Z</atom:updated>
            <content:encoded><![CDATA[<h3><a href="https://snack.expo.dev/@senthilgmf/product-filter">https://snack.expo.dev/@senthilgmf/product-filter</a></h3><p>product paywall, second bloc, and <a href="https://snack.expo.dev/">https://snack.expo.dev/</a> checklist fix with array copying, first bloc of code</p><p><a href="https://snack.expo.dev/">Snack - React Native in the browser</a></p><pre>import React, { useState } from &#39;react&#39;;<br>import { View, Text, Button, StyleSheet, FlatList } from &#39;react-native&#39;;<br><br>export default function App() {<br>  const [tasks, setTasks] = useState([<br>    { id: &#39;1&#39;, title: &#39;Buy groceries&#39;, completed: false },<br>    { id: &#39;2&#39;, title: &#39;Walk the dog&#39;, completed: false },<br>    { id: &#39;3&#39;, title: &#39;Read a book&#39;, completed: false },<br>  ]);<br><br>  const toggleTask = (id) =&gt; {<br>    setTasks((previousTasks) =&gt;<br>      previousTasks.map((task) =&gt;<br>        task.id === id<br>          ? { ...task, completed: !task.completed }<br>          : task<br>      )<br>    );<br>  };<br><br>  return (<br>    &lt;View style={styles.container}&gt;<br>      &lt;Text style={styles.title}&gt;Bug Hunting: Task List&lt;/Text&gt;<br><br>      &lt;FlatList<br>        data={tasks}<br>        keyExtractor={(item) =&gt; item.id}<br>        renderItem={({ item }) =&gt; (<br>          &lt;View style={styles.task}&gt;<br>            &lt;Text style={styles.taskText}&gt;<br>              {item.completed ? &#39;✅&#39; : &#39;⬜&#39;} {item.title}<br>            &lt;/Text&gt;<br><br>            &lt;Button<br>              title={item.completed ? &quot;Uncheck&quot; : &quot;Check&quot;}<br>              onPress={() =&gt; toggleTask(item.id)}<br>            /&gt;<br>          &lt;/View&gt;<br>        )}<br>      /&gt;<br><br>      &lt;Text style={styles.hint}&gt;<br>        Tap Toggle. Why does the task status not update correctly?<br>      &lt;/Text&gt;<br>    &lt;/View&gt;<br>  );<br>}<br><br>const styles = StyleSheet.create({<br>  container: {<br>    flex: 1,<br>    padding: 24,<br>    paddingTop: 80,<br>    backgroundColor: &#39;#fff&#39;,<br>  },<br>  title: {<br>    fontSize: 24,<br>    fontWeight: &#39;bold&#39;,<br>    marginBottom: 24,<br>    textAlign: &#39;center&#39;,<br>  },<br>  task: {<br>    padding: 16,<br>    marginBottom: 12,<br>    borderWidth: 1,<br>    borderColor: &#39;#ddd&#39;,<br>    borderRadius: 8,<br>  },<br>  taskText: {<br>    fontSize: 18,<br>    marginBottom: 12,<br>  },<br>  hint: {<br>    marginTop: 20,<br>    fontSize: 16,<br>    textAlign: &#39;center&#39;,<br>  },<br>})l;</pre><pre>import React, { useEffect, useMemo, useState } from &quot;react&quot;;<br>import {<br>  View,<br>  Text,<br>  ActivityIndicator,<br>  FlatList,<br>  TouchableOpacity,<br>  Image,<br>  StyleSheet,<br>  SafeAreaView,<br>} from &quot;react-native&quot;;<br>import { NavigationContainer } from &quot;@react-navigation/native&quot;;<br>import { createNativeStackNavigator } from &quot;@react-navigation/native-stack&quot;;<br><br>const Stack = createNativeStackNavigator();<br><br>const CATEGORIES_URL = &quot;https://fakestoreapi.com/products/categories&quot;;<br>const PRODUCTS_URL = &quot;https://fakestoreapi.com/products&quot;;<br><br>function ProductsScreen({ navigation }) {<br>  const [categories, setCategories] = useState([]);<br>  const [products, setProducts] = useState([]);<br>  const [selectedCategory, setSelectedCategory] = useState(&quot;All&quot;);<br>  const [loading, setLoading] = useState(true);<br><br><br>  useEffect(() =&gt; {<br>    const loadData = async () =&gt; {<br>      try {<br>        const [catRes, prodRes] = await Promise.all([<br>          fetch(CATEGORIES_URL),<br>          fetch(PRODUCTS_URL),<br>        ]);<br><br>        const catData = await catRes.json();<br>        const prodData = await prodRes.json();<br><br>        setCategories([&quot;All&quot;, ...catData]);<br>        setProducts(prodData);<br>      } catch (error) {<br>        console.log(&quot;Error fetching data:&quot;, error);<br>      } finally {<br>        setLoading(false);<br>      }<br>    };<br><br>    loadData();<br>  }, []);<br><br>  const filteredProducts = useMemo(() =&gt; {<br>    if (selectedCategory === &quot;All&quot;) return products;<br>    return products.filter((p) =&gt; p.category === selectedCategory);<br>  }, [products, selectedCategory]);<br><br>  if (loading) {<br>    return (<br>      &lt;View style={styles.center}&gt;<br>        &lt;ActivityIndicator size=&quot;large&quot; /&gt;<br>      &lt;/View&gt;<br>    );<br>  }<br><br>  return (<br>    &lt;SafeAreaView style={styles.container}&gt;<br>      &lt;Text style={styles.title}&gt;Products&lt;/Text&gt;<br><br>      &lt;View style={styles.categoryWrapper}&gt;<br>        &lt;FlatList<br>          data={categories}<br>          horizontal<br>          keyExtractor={(item) =&gt; item}<br>          showsHorizontalScrollIndicator={false}<br>          contentContainerStyle={styles.categoryList}<br>          renderItem={({ item }) =&gt; {<br>            const active = item === selectedCategory;<br>            return (<br>              &lt;TouchableOpacity<br>                onPress={() =&gt; setSelectedCategory(item)}<br>                style={[styles.chip, active &amp;&amp; styles.chipActive]}<br>              &gt;<br>                &lt;Text style={[styles.chipText, active &amp;&amp; styles.chipTextActive]}&gt;<br>                  {item}<br>                &lt;/Text&gt;<br>              &lt;/TouchableOpacity&gt;<br>            );<br>          }}<br>        /&gt;<br>      &lt;/View&gt;<br><br>      &lt;FlatList<br>        data={filteredProducts}<br>        keyExtractor={(item) =&gt; String(item.id)}<br>        contentContainerStyle={styles.productList}<br>        renderItem={({ item }) =&gt; (<br>          &lt;TouchableOpacity<br>            style={styles.card}<br>            onPress={() =&gt; navigation.navigate(&quot;ProductDetail&quot;, { product: item })}<br>          &gt;<br>            &lt;Image source={{ uri: item.image }} style={styles.image} /&gt;<br>            &lt;View style={styles.cardBody}&gt;<br>              &lt;Text numberOfLines={2} style={styles.name}&gt;<br>                {item.title}<br>              &lt;/Text&gt;<br>              &lt;Text style={styles.category}&gt;{item.category}&lt;/Text&gt;<br>              &lt;Text style={styles.price}&gt;${item.price}&lt;/Text&gt;<br>              &lt;Text style={styles.rating}&gt;<br>                ⭐ {item.rating?.rate} ({item.rating?.count} reviews)<br>              &lt;/Text&gt;<br>            &lt;/View&gt;<br>          &lt;/TouchableOpacity&gt;<br>        )}<br>      /&gt;<br>    &lt;/SafeAreaView&gt;<br>  );<br>}<br><br>function ProductDetailScreen({ route }) {<br>  const { product } = route.params;<br><br>  return (<br>    &lt;SafeAreaView style={styles.container}&gt;<br>      &lt;View style={styles.detailCard}&gt;<br>        &lt;Image source={{ uri: product.image }} style={styles.detailImage} /&gt;<br>        &lt;Text style={styles.detailTitle}&gt;{product.title}&lt;/Text&gt;<br>        &lt;Text style={styles.category}&gt;{product.category}&lt;/Text&gt;<br>        &lt;Text style={styles.price}&gt;${product.price}&lt;/Text&gt;<br>        &lt;Text style={styles.rating}&gt;<br>          ⭐ {product.rating?.rate} ({product.rating?.count} reviews)<br>        &lt;/Text&gt;<br>        &lt;Text style={styles.description}&gt;{product.description}&lt;/Text&gt;<br>      &lt;/View&gt;<br>    &lt;/SafeAreaView&gt;<br>  );<br>}<br><br>export default function App() {<br>  return (<br>    &lt;NavigationContainer&gt;<br>      &lt;Stack.Navigator&gt;<br>        &lt;Stack.Screen name=&quot;Products&quot; component={ProductsScreen} /&gt;<br>        &lt;Stack.Screen name=&quot;ProductDetail&quot; component={ProductDetailScreen} /&gt;<br>      &lt;/Stack.Navigator&gt;<br>    &lt;/NavigationContainer&gt;<br>  );<br>}<br><br>const styles = StyleSheet.create({<br>  container: {<br>    flex: 1,<br>    backgroundColor: &quot;#fff&quot;,<br>  },<br>  center: {<br>    flex: 1,<br>    justifyContent: &quot;center&quot;,<br>    alignItems: &quot;center&quot;,<br>  },<br>  title: {<br>    fontSize: 24,<br>    fontWeight: &quot;700&quot;,<br>    textAlign: &quot;center&quot;,<br>    paddingVertical: 12,<br>  },<br>  categoryWrapper: {<br>    marginTop: 4,<br>    marginBottom: 8,<br>  },<br>  categoryList: {<br>    paddingHorizontal: 16,<br>    paddingTop: 12,<br>    paddingBottom: 12,<br>  },<br>  chip: {<br>    backgroundColor: &quot;#eee&quot;,<br>    paddingHorizontal: 18,<br>    paddingVertical: 10,<br>    borderRadius: 20,<br>    marginRight: 10,<br>  },<br>  chipActive: {<br>    backgroundColor: &quot;#222&quot;,<br>  },<br>  chipText: {<br>    color: &quot;#555&quot;,<br>    fontWeight: &quot;600&quot;,<br>  },<br>  chipTextActive: {<br>    color: &quot;#fff&quot;,<br>  },<br>  productList: {<br>    paddingHorizontal: 16,<br>    paddingBottom: 20,<br>  },<br>  card: {<br>    flexDirection: &quot;row&quot;,<br>    backgroundColor: &quot;#fff&quot;,<br>    borderRadius: 16,<br>    padding: 12,<br>    marginBottom: 12,<br>    shadowColor: &quot;#000&quot;,<br>    shadowOpacity: 0.08,<br>    shadowRadius: 8,<br>    shadowOffset: { width: 0, height: 2 },<br>    elevation: 3,<br>  },<br>  image: {<br>    width: 90,<br>    height: 90,<br>    resizeMode: &quot;contain&quot;,<br>    marginRight: 12,<br>  },<br>  cardBody: {<br>    flex: 1,<br>    justifyContent: &quot;center&quot;,<br>  },<br>  name: {<br>    fontSize: 16,<br>    fontWeight: &quot;700&quot;,<br>    color: &quot;#222&quot;,<br>  },<br>  category: {<br>    color: &quot;#888&quot;,<br>    marginTop: 4,<br>  },<br>  price: {<br>    fontSize: 18,<br>    fontWeight: &quot;700&quot;,<br>    marginTop: 6,<br>  },<br>  rating: {<br>    color: &quot;#666&quot;,<br>    marginTop: 4,<br>  },<br>  detailCard: {<br>    padding: 16,<br>  },<br>  detailImage: {<br>    width: &quot;100%&quot;,<br>    height: 300,<br>    resizeMode: &quot;contain&quot;,<br>    marginBottom: 20,<br>  },<br>  detailTitle: {<br>    fontSize: 22,<br>    fontWeight: &quot;700&quot;,<br>    marginBottom: 8,<br>  },<br>  description: {<br>    marginTop: 16,<br>    fontSize: 15,<br>    lineHeight: 22,<br>    color: &quot;#444&quot;,<br>  },<br>});</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=faed2ea31d31" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Brinker (chili’s and maggiano's) mid level software developer coding challenge]]></title>
            <link>https://medium.com/@ian_hunter_harold/brinker-chilis-and-maggianos-mid-level-software-developer-coding-challenge-db725632494a?source=rss-d152d11b060d------2</link>
            <guid isPermaLink="false">https://medium.com/p/db725632494a</guid>
            <category><![CDATA[maggianos]]></category>
            <category><![CDATA[chilis-restaurant]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[brinker]]></category>
            <category><![CDATA[coding-challenge]]></category>
            <dc:creator><![CDATA[Ian Harold]]></dc:creator>
            <pubDate>Mon, 04 May 2026 14:01:01 GMT</pubDate>
            <atom:updated>2026-05-04T14:04:23.966Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xj3Yq5P8qfhvn7PzPRGv9w.png" /></figure><p>Here is brinkers coding assessment for a mid level software developer (full stack role I believe). Heads up, my responses and changes did not pass the bare min and I was kicked out of the interview cycle. It’s all good because I am giving you, my reader a chance to reivew my work and build apon my setup so that I hope you get to the final interview round.</p><p>In short, this coding test is a typescript, next.js intro plus a few gotchas sprinkled in. I think the most challenging part albiet basic was the hovering ask when next.js is focused on being touch and mobile focused vs web based.</p><p><a href="https://github.com/ianhunterharold/brinkers_coding_assessment_local">GitHub - ianhunterharold/brinkers_coding_assessment_local: brinkers_coding_assessment_local</a></p><p>They ask you to build a filter tab as the feature with a short list of asks. All of this can be found inside of the tasks folder. The bug that is asked to fix is resolving an issue where the url of an image is real but it doesn’t exist in the assets folder. That one should be more straightforward and beneficial.</p><p>I hope this helps you in your interview journey and stay open source!</p><p>Fork off of the repo if you would like!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db725632494a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unique String Values- Popular White Boarding Problems Explained]]></title>
            <link>https://medium.com/@ian_hunter_harold/unique-string-values-popular-white-boarding-problems-explained-2c57026112be?source=rss-d152d11b060d------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c57026112be</guid>
            <dc:creator><![CDATA[Ian Harold]]></dc:creator>
            <pubDate>Mon, 24 Aug 2020 22:48:30 GMT</pubDate>
            <atom:updated>2020-08-24T22:52:34.485Z</atom:updated>
            <content:encoded><![CDATA[<p>Here’s a quick challenge that I have seen in interviews.</p><p>// return a string of unique values, assume no edge cases, assume you have a valid string always</p><p>Sweet. So I know I can use a Set to pull out unique values in array. So turn the string into an array and then add unique values to the set. Then combine all of the values of that set into an array and return that joined array.</p><p>Below is my result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cayvns-nLoN4iNEcbTNtDQ.png" /></figure><p>Create a new Set. Break up the string into an array by character. Then iterate over that array and add unique values into the Set. Then create a new set turning it into an array and then joining all of the values into one string that you will then return. Done.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c57026112be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Two Words in a Document — Popular White Boarding Problems Explained]]></title>
            <link>https://medium.com/@ian_hunter_harold/two-words-in-a-document-popular-white-boarding-problems-explained-8cf29284cb37?source=rss-d152d11b060d------2</link>
            <guid isPermaLink="false">https://medium.com/p/8cf29284cb37</guid>
            <dc:creator><![CDATA[Ian Harold]]></dc:creator>
            <pubDate>Thu, 20 Aug 2020 18:16:10 GMT</pubDate>
            <atom:updated>2020-08-20T18:38:57.274Z</atom:updated>
            <content:encoded><![CDATA[<h3><a href="https://medium.com/@ian_hunter_harold/matching-parentheses-array-of-strings-popular-white-boarding-problems-explained-6c0bfeb3ccab?source=your_stories_page---------------------------">Two Words in a Document — Popular White Boarding Problems Explained</a></h3><p>Hey ya’ll, it’s whiteboarding season. But let’s be real. When is it ever not? I recently has the opportunity to solve a whiteboarding challenge for an organisation and I wanted to share my thoughts, approach and how I solved this algorithm.</p><p>Here is the challenge — Two words in a document. You are given an input with three lines, first line is the longest string — think of this line as your document. The second line is the first word you are looking for and the third line is the last word you are looking for. The challenge is to count how many words are in between the first and last word that we are looking for. When normally reviewing a whiteboarding challenge, I usually will copy and paste the original answer into this post but I wasn’t able to save that content. An important detail I noticed in the email is that you either have to count the first word or the last word, you do not include the count of both or neither. So the question could be return the count of how many words are in between the first and the last including either the first or the last.</p><p>Alright, let’s talk about some upfront challenges. Before starting this whiteboarding adventure, I didn’t realize a parameter could be multi-lined and I had no idea to break it down. I had a plan of attack when solving the challenge but I didn’t know how to take a multi-line input. NOW I DO! Thank you to David Stoll, he was able to impart how to break down this parameter, and it’s easier than you think.</p><p>Pseudo code</p><p>// break down the input into three variables, the longest string, the first word and the last word</p><p>// case sensitivity matters for this challenge so make sure to use toLowerCase()</p><p>// iterate over the longest string looking at every index for the first word.</p><p>// once you find the first word, save the index in a variable</p><p>// now look for the last word, if you find it, take note of the index and save it</p><p>// subtract the last index to the first index associated with the last and first words respectively</p><p>//return that difference</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W-M7biYoIHNOXDBpgSbHmA.png" /></figure><p>Notice that this is a work in progress solution as I am still working out a multi-line input.</p><p>I break down the input and save the position in different variables.</p><p>I then turn the longest string into an array. I iterate over that array and then look for when the first string matches the element. Then I continue to iterate through a smaller section of the array and look for an element that matches the last. I then return the distance between the last index and the first word index to give you the number of words between the first and last.</p><p>This is a work in progress solution and if you run it in my <a href="https://repl.it/@ianharold/twoWordsDocument#index.js">replt</a>, I am still playing around and console logging my work!</p><p>SO — I just figured out why I wasn’t getting the results I was looking for- I needed to change my multi-line input to where I wasn’t including a space in my first or last word. Notice how I changed my many lined input to have no spaces? This was helping me correctly compare strings whereas previously, I was comparing a string with a space in the front of it to a string with no additional spaces.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XOr5Au7uRHcRGtoDMxOiqQ.png" /></figure><p>I also changed a variable to be more scoped to let instead of const. const prevents you from reassigning that variable which I was wanting to accomplish. Once I changed const distance to let distance I was able to update the variable!</p><p>I recently cleaned up some variables that I didn’t need and placed in a clause that returns “-1” if there is no first or last word. Below is a more concise solution that I know I could refactor even further.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5vQYwct4XC4ftoDVaR00_w.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8cf29284cb37" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Some Fun Challenges to Learn JavaScript Iterables]]></title>
            <link>https://medium.com/@ian_hunter_harold/some-fun-challenges-to-learn-javascript-iterables-2a247e97a4?source=rss-d152d11b060d------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a247e97a4</guid>
            <dc:creator><![CDATA[Ian Harold]]></dc:creator>
            <pubDate>Sat, 15 Aug 2020 22:06:33 GMT</pubDate>
            <atom:updated>2020-08-15T22:06:33.436Z</atom:updated>
            <content:encoded><![CDATA[<p>I was given this data set and asked a series of questions. These questions are great practice to iterate over some data and to become wicked familiar with JavaScript Iterables.</p><p>Here is the data set we will be iterating over.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*amVglcJizLsfkqCvCtHNqQ.png" /></figure><p>Let’s go over two questions today and talk about my approach on how to solve them. I will post more questions as I think this is a great way to be familiar with JavaScript iterables. Can I say that anymore? XD</p><p><a href="https://medium.com/u/8c3b2f2c5ce2">Jacob Bogart</a> hooked it up with the data and questions. Thank you!</p><ol><li>// create an array with a list of all the titles of Beyonce’s hit songs</li></ol><p>Easy enough to start out. Looking at our data structure, I know that we need to iterate over all of the songs and then create and return an array with the titles. For my answer, I know that .map is a good iterator as it returns an array with your desired results. For my answer below. We iterate through beyonce’s hits which is an array value for the key hits and we pull out the song.title.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cL42EOaSKnivazLbIOMdwQ.png" /></figure><p>2. // create an array with a list of all of Beyonce’s fierceness ratings</p><p>Again, this is another map problem, we want an array with all of beyonce’s fierceness ratings. For my first solution, I wanted to include the name of the song with the fierceness rating so that whoever was viewing this output could see the value and the name associated. I also placed every song and rating into another array so the final structure is [ [ ‘rating’,‘song title’ ],[‘rating’,‘song title’]…]. So long as you are returning the rating at the min, you are fine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mv7U4Yu_QgC9DSU0apoTYw.png" /></figure><p>3. // create a list of all of beyonces songs where she is wearing a bodysuit or bodysuit is part of the video theme</p><p>THIS CHALLENGE IS SO MUCH FUN! we are looking to return a list, I made it into an array of all of the songs where she is wearing a bodysuit or that a bodysuit is part of the video theme! I know that we need to reduce down a list of a lot of information into a single array so I’m going to use .reduce. BECOME VERY FAMILIAR with reduce. It’s a powerful built in tool for you to use!</p><p>Let’s go through my first solution line by line. I am first reducing beyonces hits and looking for if the signatureLook key’s string includes the string ‘bodysuit.’ If it does, then I’m adding the song title to the acc (accumulator — think of the accumulator as the final out that you want to return. An important note with reduce and the acc is that you need to establish what data structure the acc is. I establish that it’s an array on line 13. MDN docs are great about walking you through some basic examples where you can see how the set the acc.</p><p>I am also checking to see if the videoTheme value as a string includes bodysuit as well. If it does, I want that song title as well. I am then returning the acc and invoking the function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*njo0a4oYaVM-GndLtyhm4A.png" /></figure><p>Be on the lookout for next week’s additional questions!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a247e97a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Matching Parentheses, Array of Strings — Popular White Boarding Problems Explained]]></title>
            <link>https://medium.com/@ian_hunter_harold/matching-parentheses-array-of-strings-popular-white-boarding-problems-explained-6c0bfeb3ccab?source=rss-d152d11b060d------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c0bfeb3ccab</guid>
            <dc:creator><![CDATA[Ian Harold]]></dc:creator>
            <pubDate>Sat, 08 Aug 2020 22:14:07 GMT</pubDate>
            <atom:updated>2020-08-08T22:14:07.919Z</atom:updated>
            <content:encoded><![CDATA[<h3>Matching Parentheses, Array of Strings — <a href="https://medium.com/@ian_hunter_harold/reverse-vowels-in-strings-popular-white-boarding-problems-explained-6cc958ef143b?source=your_stories_page---------------------------">Popular White Boarding Problems Explained</a></h3><p>Hey Yall, I’ve composed a post about a very similar topic. I want to re-open the challenge as I have now seen how it asked in different interview formats. I recently was asked this question in an interview but instead of just checking a single string, it was an array of strings, each string being a series of brackets and the return value should be an array of ‘YES’ or ‘NO’ values.</p><p>This post is slightly more condensed as I have solved with a working solution the base problem and now I need to modify my solution for iterating through an array of strings containing brackets, returning ‘YES’ or ‘NO’ values.</p><p>Below is my first working solution. We will of course refactor but let’s walk line by line to understand what I am doing.</p><p>In lines one I am assigning a variable and passing in the <em>value </em>which is an array of strings, each string being multiple brackets, in or out of order.</p><p>I create two variables yN which will be an array that holds onto the ‘YES’ ‘NO’ strings. I am using var, that is not accepted these days. This is a scoping issue that I will revisit when I refactor.</p><p>I then iterate through my values and split each string apart as to compare the order.</p><p>We are using a stack so you can only push to add to the end of the stack and pop to remove from the end of the stack. On lines 9 if the string is an open bracket add it to the stack ( I am using an array but treating it like a stack).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uqHxYY9RxX2IvYiHyDctMA.png" /></figure><p>Lines 13–17 state that if I find a closing bracket and the last item in the stack (array) is the matching opening bracket then we can remove the last item.</p><p>If there is no length in match, then we know that that specific string is properly matching and we can add YES to the array of yes and nos. If there is a length then we add no and reset that match array.</p><p>We continue through the entire value array and finally return the yN array of which parentheses match. Refactoring to come soon.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c0bfeb3ccab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Co-Authoring Git Commits]]></title>
            <link>https://medium.com/@ian_hunter_harold/co-authoring-git-commits-3079c6f32d66?source=rss-d152d11b060d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3079c6f32d66</guid>
            <dc:creator><![CDATA[Ian Harold]]></dc:creator>
            <pubDate>Sat, 01 Aug 2020 00:55:21 GMT</pubDate>
            <atom:updated>2020-08-01T00:57:12.523Z</atom:updated>
            <content:encoded><![CDATA[<p>For folks out there who are collaborating on repositories with other developers, getting your name on commits is not only important, its vital for folks in your org to know that your time was spent writing out your solution and not twiddling your thumbs.</p><p>When committing your changes use this template — &lt;carrots are needed&gt; and the email should be the email attached to the github account you want associated with the commit.</p><pre>git commit -m&quot;commit message<br>&gt;&gt;<br>&gt;&gt;<br>Co-authored-by: name &lt;name@example.com&gt;<br>Co-authored-by: another-name &lt;another-name@example.com&gt;&quot;</pre><p>Notice that the quote closes after you include the authors. Also note that you need two lines in-between the authors and the commit message.</p><p>Very straightforward and beneficial for including multiple folks on a commit.</p><p>Refer to official documentation on github to learn more.</p><p><a href="https://docs.github.com/en/github/committing-changes-to-your-project/creating-a-commit-with-multiple-authors">Creating a commit with multiple authors</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3079c6f32d66" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Array Prototype Iterators — Accessing Data inside of an Array]]></title>
            <link>https://medium.com/@ian_hunter_harold/array-prototype-iterators-accessing-data-inside-of-an-array-582af3b82a21?source=rss-d152d11b060d------2</link>
            <guid isPermaLink="false">https://medium.com/p/582af3b82a21</guid>
            <dc:creator><![CDATA[Ian Harold]]></dc:creator>
            <pubDate>Tue, 21 Jul 2020 16:48:09 GMT</pubDate>
            <atom:updated>2020-07-21T16:48:09.007Z</atom:updated>
            <content:encoded><![CDATA[<h3>Array Prototype Iterators — Accessing Data inside of an Array</h3><p>During my career search, I’ve had a myriad of interview questions ranging from hypotheticals to white boarding challenges. A lot of my contemporaries who are currently employed stress to me the relevance and importance of understanding JavaScript array iterators. Many of my developer peers mention how white boarding challenges in interview cycles are problematic in that no one actually cares if you can precisely reverse an array while reversing the internal strings, while jumping on one leg and singing the A,B, C’s. It’s a contrived sandbox to understand a developers base line understanding. What’s more important is accessing data by specific criteria and being able to display that information accordingly.</p><p>So with that in mind, let’s take a look at a nested array structure with lots of information and then some questions that address accessing information appropriately from that array.</p><p>Check out the array below. It’s an array filled with objects with specific data points. We’ll walk through a few iterators retrieving some information from this array.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wf2ig_h7Pc1SHK5PqTiGFw.png" /></figure><p>Question One —</p><p>// 1. Write a function that returns an array of queen names in alphabetical order.</p><p>Looking at our array, there is a name key with a string value of the name. We need to iterate through each object in the array and return an alphabetical list of those names.</p><p>Map is a great starting JavaScript iterator as it returns a new array with the call back function that acts on every element in that called upon array.</p><p>In our example, we want to create an array of names then sort alphabetically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hnAiuLptfx_DRSHGys75lg.png" /></figure><p>Here I create a function and return an array of the queens names that are sorted. In my first solution, I broke up the sort on a separate line but after looking at the docs for sort, and looking at what .map returns, someone had pointed out that I could chain that function onto .map.</p><p>The result is a list of queens names alphabetized.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*mRtR9L8w10vhIPonoK_6aQ.png" /></figure><p>Question Two —</p><p>// 2. Write a fuction that returns the name of Miss Congeniality</p><p>Scrolling back up and looking at the array of objects we notice a key value pair of “missCongeniality”: true/false depending on the queen. Instead of manually looking through the array, we can programmatically find the answer.</p><p>For this solution, I am thinking I can use .find. Find returns the first element that satisfies the provided testing function. .find under the hood uses truthy or falsey to determine if an element is satisfying the test function. In our example, we are looking for missCongeniality” === true.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8kDpRxghKBJsYXI--F8upg.png" /></figure><p>I write a function that finds the person who has the key missCongeniality === true and I return that person’s name.</p><p>Question Three -</p><p>// 3. Write a fuction that takes in an id and returns the string “[Queen’s Name] placed [fifth, eleventh, ect…] in Season [Season number] of RuPaul’s Drag Race.”</p><p>For this question, we know that we need to pass into the function a parameter of id then find that queen in the array and return the string with the provided information that we are looking for. .Find can be used here again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0YTupFpLSMtUrEcy2Jqi8Q.png" /></figure><p>I create a function that takes in the id of a queen and finds that queen using the id match. Then I return the string with the provided information needed.</p><p>Question Four—</p><p>// 4. Write a function that returns an an object where the keys are first names of each queen and the value is their quote. ie:</p><p>// { Alaska: “Alaksa’s Quote”,</p><p>// Roxxy: “Roxxy’s Quote”,</p><p>// Detox: “Detox’s Quote”</p><p>For this solution, we need to create an object and build it out with names and their quotes. I am going to be iterating over every element so map is a good iterator to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*57oN4DLkihI83rtQFxJVfQ.png" /></figure><p>I create an object and iterate over every element using map. I then set the queens name as the key and the quote as the value and return that object.</p><p>Question Five -</p><p>// 5. Write a functions that returns an object of the top three finishers ie:</p><p>// { firstPlace: name,</p><p>// secondPlace: name,</p><p>// thirdPlace: name }</p><p>// Extension: Make sure the object is in that exact order</p><p>We need to sort our elements in the array by rank and then only pluck the top three from the list. Sort is a powerful tool and a junior developers should absolutely understand how to use it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gPDuVVcuTjnSEOzK3rttuw.png" /></figure><p>I create an object then I sort the queens by their place with lowest ranking to highest ranking. I then create the key value pairs in the object with their place and name.</p><p>Some great tools to use and a dev should def understand how to use their iterables!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=582af3b82a21" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reverse String Refactored — Popular white-boarding problems explained]]></title>
            <link>https://medium.com/@ian_hunter_harold/reverse-string-refactored-popular-white-boarding-problems-explained-5ca460bc2b56?source=rss-d152d11b060d------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ca460bc2b56</guid>
            <dc:creator><![CDATA[Ian Harold]]></dc:creator>
            <pubDate>Thu, 16 Jul 2020 16:57:59 GMT</pubDate>
            <atom:updated>2020-07-16T16:57:59.136Z</atom:updated>
            <content:encoded><![CDATA[<h3>Reverse String Refactored — Popular white-boarding problems explained</h3><p>Let’s address a very common and very straight forward white boarding challenge. Reverse the string. My first solution was longer and more code than needed. I want to simplify my previous <a href="https://medium.com/@ian_hunter_harold/reverse-string-popular-white-boarding-problem-explained-5d4e0ed47a1c">post</a>. Let’s refactor.</p><p>The Challenge</p><p>Write a function that reverses a string. The input string is given as an array of characters char[].</p><p>Do not allocate extra space for another array, you must do this by <strong>modifying the input array </strong><a href="https://en.wikipedia.org/wiki/In-place_algorithm"><strong>in-place</strong></a> with O(1) extra memory.</p><p>You may assume all the characters consist of <a href="https://en.wikipedia.org/wiki/ASCII#Printable_characters">printable ascii characters</a>.</p><p><strong>Example 1:</strong></p><pre><strong>Input: </strong>[&quot;h&quot;,&quot;e&quot;,&quot;l&quot;,&quot;l&quot;,&quot;o&quot;]<br><strong>Output: </strong>[&quot;o&quot;,&quot;l&quot;,&quot;l&quot;,&quot;e&quot;,&quot;h&quot;]</pre><p><strong>Example 2:</strong></p><pre><strong>Input: </strong>[&quot;H&quot;,&quot;a&quot;,&quot;n&quot;,&quot;n&quot;,&quot;a&quot;,&quot;h&quot;]<br><strong>Output: </strong>[&quot;h&quot;,&quot;a&quot;,&quot;n&quot;,&quot;n&quot;,&quot;a&quot;,&quot;H&quot;]</pre><p>Great so I know with the practice that I have been doing daily, that JavaScript has a lot of built in methods to make this extremely easy and straight forward.</p><p><strong>Solve it as a human</strong></p><ul><li>go through the array of strings and take the last letter and put it in the front of the array</li><li>continue until the array is completely reversed</li></ul><p><strong>Solve as a developer</strong></p><ul><li>make sure that the array has a length, if not return -1 to indicate that it is empty</li><li>.reverse is a good start — that IS the built in function to solving this challenge.</li><li>after stating .reverse, the person facilitating the conversation will say, don’t use .reverse</li><li>move the elements from the back to the front and continue until you are finished</li></ul><p>Great, let’s start writing our code. As you can see below, if you can use reverse here it is. Very simple and straight to the point.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2qSq1dD57BulVFOGJTFM_A.png" /></figure><p>If you can’t use reverse then we can still keep it very simple.</p><p>Now let’s solve this without .reverse.</p><p>We create a new array. Iterate through the array backwards and push so that the string is added to the end of the new array. This will reverse the string.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Js5FyAtqJX_OLtnCfq8tDQ.png" /></figure><p>I look back on my previous code and sometimes I’m embarrassed to see where I was intellectually. I am then humbled by how far I have come in such a short time to more clearly understand the tools that I can utilize.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ca460bc2b56" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>