<?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: Marchell Imanuel</title>
    <description>The latest articles on DEV Community by Marchell Imanuel (@marchellll).</description>
    <link>https://dev.to/marchellll</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%2F742904%2Fb5449feb-bf51-4eed-96cf-2c73f73b438b.gif</url>
      <title>DEV Community: Marchell Imanuel</title>
      <link>https://dev.to/marchellll</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/marchellll"/>
    <language>en</language>
    <item>
      <title>Draft: Common Software Engineer Interview Questions</title>
      <dc:creator>Marchell Imanuel</dc:creator>
      <pubDate>Wed, 05 Apr 2023 09:17:58 +0000</pubDate>
      <link>https://dev.to/marchellll/draft-common-software-engineer-interview-questions-4g2d</link>
      <guid>https://dev.to/marchellll/draft-common-software-engineer-interview-questions-4g2d</guid>
      <description>&lt;h1&gt;
  
  
  Background
&lt;/h1&gt;

&lt;p&gt;This post will be my dump of software engineer interview questions. Whenever I found anything interesting, I will put it here, so this is an "always a draft" post.&lt;/p&gt;

&lt;p&gt;Also, I will try to answer them.&lt;/p&gt;

&lt;h1&gt;
  
  
  Questions
&lt;/h1&gt;

&lt;h2&gt;
  
  
  What happens when you enter a URL into your browser and press enter?
&lt;/h2&gt;

&lt;p&gt;Plenty of little things will happen, like, a key-pressed callback/handler will be called. This handler will get a string value from the text field. The browser will try to parse the value and do something about it.&lt;/p&gt;

&lt;p&gt;But I guess that is not the detail level that question meant. Hehe. So I'll continue at a slightly higher level.&lt;/p&gt;

&lt;p&gt;After the browser determined that the string is indeed a URL, it will try to chunk the URL into some parts: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;protocol&lt;/li&gt;
&lt;li&gt;hostname&lt;/li&gt;
&lt;li&gt;path&lt;/li&gt;
&lt;li&gt;query-params&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then the browser needs to resolve the IP address of the hostname by looking into DNS records. It will start at its local DNS cache, and if it cannot find it, it will consecutively find it in the OS cache, router cache, ISP DNS server, and ends at some public DNS server.&lt;/p&gt;

&lt;p&gt;Then it will try to establish TCP/IP connection using a handshake with the host, by exchanging synchronize(SYN) &amp;amp; acknowledge(ACK) messages. &lt;/p&gt;

&lt;p&gt;After the connection is established, if needed/able, the browser will try to make a TLS handshake by exchanging messages. &lt;/p&gt;

&lt;p&gt;After the connection is established, the browser then starts to send HTTP requests, with path, headers, and/or body. The host (or by now can be called the server), handles the requests and send back the response.&lt;/p&gt;

&lt;p&gt;A response usually got an adequate amount of information for the browser to render something, for example, HTML, JS, or CSS.&lt;/p&gt;

&lt;p&gt;Then the browser renders something based on the response, and maybe do another request to the server if required.&lt;/p&gt;

&lt;p&gt;References:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://medium.com/@kasunpdh/ssl-handshake-explained-4dabb87cdce"&gt;https://medium.com/@kasunpdh/ssl-handshake-explained-4dabb87cdce&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.cloudflare.com/learning/ssl/what-happens-in-a-tls-handshake/"&gt;https://www.cloudflare.com/learning/ssl/what-happens-in-a-tls-handshake/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  How do you handle edge cases and errors?
&lt;/h2&gt;

&lt;h2&gt;
  
  
  How do you make sure your code is maintainable?
&lt;/h2&gt;

&lt;h2&gt;
  
  
  What are some signs that a system is architected well?
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Can you tell me about a mistake you made and how you handled it?
&lt;/h2&gt;

&lt;h2&gt;
  
  
  How do you approach designing systems for high availability and relia
&lt;/h2&gt;

&lt;h2&gt;
  
  
  What is CORS
&lt;/h2&gt;

</description>
      <category>interview</category>
    </item>
    <item>
      <title>ACID</title>
      <dc:creator>Marchell Imanuel</dc:creator>
      <pubDate>Sun, 02 Apr 2023 07:21:27 +0000</pubDate>
      <link>https://dev.to/marchellll/acid-2528</link>
      <guid>https://dev.to/marchellll/acid-2528</guid>
      <description>&lt;p&gt;ACID is an acronym for:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;A&lt;/strong&gt;tomicity&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;C&lt;/strong&gt;onsistency&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I&lt;/strong&gt;solation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;D&lt;/strong&gt;urability &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It is a safety guarantee a database gives us. Most of the time, if it cannot satisfy these safety guarantees, it would rather to abort a transaction than allow it half-finished.&lt;/p&gt;

&lt;h2&gt;
  
  
  Atomicity
&lt;/h2&gt;

&lt;p&gt;In general, &lt;em&gt;Atomic&lt;/em&gt; means a process cannot be broken down to a smaller unit.&lt;/p&gt;

&lt;p&gt;Changes in a transaction will be applied completely, or nothing at all. Partial changes is not exists if transaction is used.&lt;/p&gt;

&lt;h2&gt;
  
  
  Consistency
&lt;/h2&gt;

&lt;p&gt;Data in the database should always in a "good state". The goodness of the data is mostly application specific, but the database can help to some extend: foreign keys, null check, data type enforcement, uniqueness constraint.&lt;/p&gt;

&lt;h2&gt;
  
  
  Isolation
&lt;/h2&gt;

&lt;p&gt;Multiple transaction will not affecting each other, and will look like as if they are executed serially.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     T1                  T2                DB
     |                   |                 |
     BEGIN               BEGIN             |
     |                   |                 |
     | READ(A)           |                 |
     |------------------------------------&amp;gt;|
     |                   |                 |
     |                   |                 |
     |                   |                 |
     |                   | READ(B)         |
     |                   |----------------&amp;gt;|
     |                   |                 |
     | UPDATE(A)         |                 |
     |------------------------------------&amp;gt;|
     |                   |                 |
     |                   | UPDATE(B)       |
     |                   |----------------&amp;gt;|
     |                   |                 |

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Transaction T1 reads the value of a data item, which is 10.&lt;/li&gt;
&lt;li&gt;Before T1 can update the data item, transaction T2 updates the same data item with a new value of 20 and commits the transaction.&lt;/li&gt;
&lt;li&gt;T1 updates the data item with the old value of 10, overwriting the value of 20 set by T2.&lt;/li&gt;
&lt;li&gt;This violates the ACID property of isolation, as there is a risk of interference and inconsistency in the data when multiple transactions (T1 and T2) are accessing the same data item without proper isolation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Durability
&lt;/h2&gt;

&lt;p&gt;The easiest between them. Everything that has been commited stays even between hardware/network failures. &lt;/p&gt;

&lt;p&gt;References:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://play.google.com/store/books/details?id=p1heDgAAQBAJ"&gt;https://play.google.com/store/books/details?id=p1heDgAAQBAJ&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

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