<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yao</title>
    <description>The latest articles on DEV Community by Yao (@yinnovation).</description>
    <link>https://dev.to/yinnovation</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%2F1044731%2F16331b63-7d39-4914-8c0b-b4f59f7aed98.jpeg</url>
      <title>DEV Community: Yao</title>
      <link>https://dev.to/yinnovation</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yinnovation"/>
    <language>en</language>
    <item>
      <title>Bloom Filter</title>
      <dc:creator>Yao</dc:creator>
      <pubDate>Fri, 29 Sep 2023 10:30:26 +0000</pubDate>
      <link>https://dev.to/yinnovation/bloom-filter-hpa</link>
      <guid>https://dev.to/yinnovation/bloom-filter-hpa</guid>
      <description>&lt;h2&gt;
  
  
  Abstract
&lt;/h2&gt;

&lt;p&gt;This is my 2nd post. In this post, I'd like to record some of the key learnings from a video (see bottom) of Bloom Filter, a popular technique for checking whether a collection contains a specific target by its key. &lt;/p&gt;

&lt;p&gt;From &lt;a href="https://en.wikipedia.org/wiki/Bloom_filter"&gt;wikipedia&lt;/a&gt;: A Bloom filter is a space-efficient probabilistic data structure, conceived by Burton Howard Bloom in 1970, that is used to test whether an element is a member of a set. False positive matches are possible, but false negatives are not – in other words, a query returns either "possibly in set" or "definitely not in set". Elements can be added to the set, but not removed (though this can be addressed with the counting Bloom filter variant); the more items added, the larger the probability of false positives. &lt;/p&gt;

&lt;h2&gt;
  
  
  Key Learnings
&lt;/h2&gt;

&lt;p&gt;Here are some of the key learnings:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bloom Filters are a privacy data structure that can give false positives but not false negatives. In other words, when checking existence, it may say Yes while the truth is No, but it will never say No while the true is Yes.&lt;/li&gt;
&lt;li&gt;Bloom filter simply works by recording a key in an array. The input key is converted using some hash functions along with modularization to fit in the underlying array. Checking the existence of the key is O(1) operation given the accurate index of the key can be calculated using the same way. &lt;/li&gt;
&lt;li&gt;Collision may occur if a key is not inserted before but the hash function produces a value that duplicates with another  already inserted item.&lt;/li&gt;
&lt;li&gt;Bloom filter is space efficient because of multiple reasons.

&lt;ul&gt;
&lt;li&gt;It does not need to store the entire object but only the key.&lt;/li&gt;
&lt;li&gt;The key is mapped to an index of array, in which the space  is fixed and commonly much smaller than the original dataset size.&lt;/li&gt;
&lt;li&gt;Using a byte buffer to optimize space consumption. Basically, we can switch from Boolean[] to Byte[], while each  Byte in the array represents 8 items. Bit manipulation techniques were utilized to reduce space usage by a factor of 8. &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Using multiple hash functions to reduce false positives. Multiple hash functions produces a sequence of bits that need to be set and checked, hence possibly reducing collision rate.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;:P 50% of the above summarization is generated by using GPT-backed tool. Only thing I needed to do is to feed the youtube link. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  When to use Bloom Filter
&lt;/h2&gt;

&lt;p&gt;I've seen Spark leverages Bloom Filter to speed up joins between tables as well as filters on single table, which is a quite common scenario. &lt;/p&gt;

&lt;p&gt;By using bloom filter, one can answer the question that whether a key is possibly existed in a collection. Assuming 1% false positive rate is there. One can eliminate 99% of the candidates in the beginning after creating and possibly transferring very small amount of data (the bloom filter itself). In reality, the false positive rate can be much smaller. &lt;/p&gt;

&lt;p&gt;Credit to Ytb Video link: &lt;a href="https://www.youtube.com/watch?v=UVFnabieyzc&amp;amp;ab_channel=AsliEngineeringbyArpitBhayani"&gt;https://www.youtube.com/watch?v=UVFnabieyzc&amp;amp;ab_channel=AsliEngineeringbyArpitBhayani&lt;/a&gt;&lt;/p&gt;

</description>
      <category>youtube</category>
      <category>bloomfilte</category>
      <category>livecoding</category>
    </item>
    <item>
      <title>What You Should Do as A Senior Software Engineer - Retrospective 2023</title>
      <dc:creator>Yao</dc:creator>
      <pubDate>Fri, 29 Sep 2023 10:29:07 +0000</pubDate>
      <link>https://dev.to/yinnovation/definition-of-senior-software-engineer-retrospective-2023-1dkc</link>
      <guid>https://dev.to/yinnovation/definition-of-senior-software-engineer-retrospective-2023-1dkc</guid>
      <description>&lt;p&gt;In 2022, I was promoted to Senior SDE in one of the FAANG company. Along the journey, I've received many helps from my senior co-workers and leaderships. Very often, I was doing something that a senior engineer should not do. When that happened, their guidance often helped me to get back to the right track. I feel it's time to do a retrospective to periodically remind myself that what kind of expectations do people hold on senior software engineers. &lt;/p&gt;

&lt;h2&gt;
  
  
  Role and Responsibility
&lt;/h2&gt;

&lt;p&gt;To summarize everything in one sentence, a senior engineer is responsible for making the right technical decisions within a &lt;a href="https://devbizops.medium.com/the-power-of-one-pizza-teams-22a770e4e550#:~:text=A%20one%20pizza%20team%20is,the%20tendency%20towards%20consensus%20thinking"&gt;one pizza team&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;As the baseline, you will be responsible for making system or architecture designs for the most complex projects in the team. The size of the project could vary from a few months to a few years. You are expected to make the initial design and finalize the design with relevant stakeholders including business team, senior leadership, principal engineers etc. &lt;/p&gt;

&lt;p&gt;At the same time, you will not be limited to yourself. Your junior teammates need your help. They will frequently seek your inputs on various topics including system designs, on-call issues, best practices, or even career suggestions. &lt;/p&gt;

&lt;p&gt;Last but not least, for all collaborations with other teams, you are, by default, the to-go person for any technical questions. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In some company, you may also assume part of the SDM role to draft engineering plan for most of the projects that your team carries. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Collaboration, Communication, Writing
&lt;/h2&gt;

&lt;p&gt;A senior engineer is always expected to be accurate and precise. Their words are meant to be useful and easy-to-understand. (Yes, I am still far from there 😄) &lt;/p&gt;

&lt;h4&gt;
  
  
  Accuracy
&lt;/h4&gt;

&lt;p&gt;As a senior engineer who is accountable for every technical thing in the team, your words are taken seriously by others. The first thing you'd like to avoid is repeatedly using non-deterministic words such as "probably", "might", "perhaps" which adds possibility and reduces accuracy in the conversation. I've seen one of the senior leadership that I previously worked with has one line in the day-1 intro: "I will not use probably when I talk. Even if I do, there's 80%+ chance that the truth is what I say". To holds high accuracy, senior engineers only share content from verified sources. If things aren't clear, they will call out that verification is needed. &lt;/p&gt;

&lt;h4&gt;
  
  
  Precision
&lt;/h4&gt;

&lt;p&gt;This is something that many folks do not pay enough attention to. Amazon has a well-known culture of writing. Depending upon the scope, they demand a doc should be fit into either 1 page or 6 pages (&lt;a href="https://medium.com/fact-of-the-day-1/february-23-how-amazonians-share-their-ideas-1-pager-and-6-pager-952295a26dac"&gt;check it out&lt;/a&gt;. In this idea, most of the low-level technical doc can be fit into one page while most of the high-level technical or business docs may need 6 pages. Why limit the number of pages? In short, it helps both the author and readers to focus on the most important things with enough efficiency in the reading and writing. Here's a real example of mine. I used to write a 3-page doc to explain one complex technical issue. In the doc, I explained how the overall system works, what's the problem in detail and how I feel the things should be changed. My skip-manager took it over and spent few days to re-write it into one page. While being amazed by how precise the new doc is, I noticed about a few key changes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remove irrelevant things into the context. People often try to put a lot of things into the context section, which they feel other folks should also pay attention to. However, there are many things that either may not be relevant or the readers may already know. For instance, it's not needed to explain how Apache Spark parses a sql query while you are trying to propose an idea of perf optimization to Spark team.
&lt;/li&gt;
&lt;li&gt;Let the data talk. People often uses large amount of words to explain or describe an issue. It's not straight forward rather not convincing. Instead, a good doc uses data to present truths. With data, it becomes easy to guide the readers to get onto the same direction.&lt;/li&gt;
&lt;li&gt;Have clear structure and goal. One critical thing I've learned is that writing a doc is just like telling a story or having a conversation with someone. You need to be crystal clear on what the expected outcome is. Are you trying to propose a business idea? or giving a solution to a technical issue? or even doing a KT session? By setting up a goal, it helps you to remain focused and avoid going deviated or even back-and-forth. After that, you should create a clear structure for the conversation so that the audiences can follow your lead to reach the conclusion that you want to draw.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Execution
&lt;/h2&gt;

&lt;p&gt;Senior engineers hold full responsibility on delivering. They ensure that everyone in the team remains on-track to deliver high-quality products before the deadline. It often means three things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Frequently review the current progress against the timeline.&lt;/li&gt;
&lt;li&gt;Help others get unblocked if they are blocked due to technical issue or from external dependencies. &lt;/li&gt;
&lt;li&gt;Periodically report to key stakeholders about the progress and the upcoming things. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the above, I've shared my view on some of the key expectations from senior engineers. These expectations are not just one-time things but rather should be constantly followed. &lt;/p&gt;

&lt;p&gt;As this is my first post in DEV, I wish that this post sets a new start for myself. When we get promoted to senior engineer, we've not reached a terminal but rather a new gate for take-off. &lt;/p&gt;

&lt;p&gt;"Stay Humble and Stay foolish."&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
