<?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 Lanting Natalie Ding on Medium]]></title>
        <description><![CDATA[Stories by Lanting Natalie Ding on Medium]]></description>
        <link>https://medium.com/@lanting-natalie-ding?source=rss-6542d6e4059d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*SLT8FxEekf-_A9mhMMHHhg.jpeg</url>
            <title>Stories by Lanting Natalie Ding on Medium</title>
            <link>https://medium.com/@lanting-natalie-ding?source=rss-6542d6e4059d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 22:25:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lanting-natalie-ding/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[Top React JS Interview Questions Explained in Detail]]></title>
            <link>https://lanting-natalie-ding.medium.com/top-react-js-interview-questions-explained-in-detail-4a1d38ce8ef5?source=rss-6542d6e4059d------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a1d38ce8ef5</guid>
            <category><![CDATA[interview-questions]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[reactive-programming]]></category>
            <dc:creator><![CDATA[Lanting Natalie Ding]]></dc:creator>
            <pubDate>Thu, 26 Aug 2021 08:47:25 GMT</pubDate>
            <atom:updated>2021-08-26T08:47:25.274Z</atom:updated>
            <content:encoded><![CDATA[<h3>Being an expert in coding doesn’t guarantee a successful tech interview</h3><p>Recently I took the top-selling React course on Udemy by Maximillian [1] and built a personal React website based on the burger builder project. Having tried out Django CMS, Android development, and C# for Windows desktop, I always feel that I could never truly get the hang of the theories without getting my hands dirty. All the terms and frameworks once seemed so intertwined suddenly became much clearer after I came back from a complete project.</p><p>Based on the summary of <a href="https://www.edureka.co/blog/interview-questions/react-interview-questions/#Advantages-of-React"><em>Edureka</em></a><em> </em>and <a href="https://www.simplilearn.com/tutorials/reactjs-tutorial/reactjs-interview-questions"><em>SimpliLearn</em></a>, I arranged more up-to-date answers to the top React Interview Questions. These are also the basic theories I believe that a good React developer should know. Below are the topics covered: (Click to navigate)</p><p><strong>General Understandings of React<br></strong>1.<strong> </strong><a href="#f30b">What is React?</a><br>2. <a href="#c3f7">Key Features of React</a><br> – <a href="#5e8f">Components</a><br> – <a href="#157d">JSX</a><br> – <a href="#b7e4">Virtual DOM</a><br> – <a href="#f4b2">One-Way Data Binding</a><br>3. <a href="#27d0">Comparisons to Other Front-End Techs</a><br>4. <a href="#6b7d">React Pros and Cons</a><br>5. <a href="#151e">How Do You Choose between Web Development Technologies?</a></p><p><strong>Dive Deeper into the Details<br></strong>1.<strong> </strong><a href="#d577">How Do You Plan a React Project?</a><br>2. <a href="#afee">Explain React Component Lifecycle</a><br> – <a href="#5890">Mounting</a><br> – <a href="#ae80">Updating</a><br> – <a href="#50e5">Unmounting</a><br> – <a href="#3907">Error Handling</a><br>3. <a href="#90ff">What are React Side Effects?</a><br>4. <a href="#8bfe">What is a Single Page Application?</a><br>5. <a href="#f996">What is a Higher-Order Component?</a><br>6. <a href="#9414">What are Synthetic Events in React?</a><br>7. <a href="#7952">Why is there a Need for Using Keys in Lists?</a></p><h3><strong>General Understandings of React</strong></h3><h4><strong>1. What is React?</strong></h4><blockquote>React is a front-end <strong>JavaScript library</strong> developed by Facebook in 2011. It’s mainly used for building UI components.</blockquote><p>Many confuse React as a framework or architecture, It’s actually not. Why? Because a web framework or architecture usually includes the resources or technologies to build full-fledged web apps [2].</p><p>Taking the MVC architecture as an example [3], React is mainly in charge of the “view” layer. Other functions such as sending out HTTP requests require the help of other libraries such as Axios. A full-fledged framework such as Angular has its own built-in tools to achieve this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/331/0*TqI5cvQ6pNyeKy9j.png" /><figcaption>MCV Model by <a href="https://www.tutorialsteacher.com/mvc/mvc-architecture">TutorialsTeacher</a></figcaption></figure><h4>2. Key Features of React</h4><p>The features that make React stands out are its reusable components, convenient JSX rendering, high-performance virtual DOM, and robust one-way data binding.</p><p><strong>Components</strong><br>Components are the <strong>building blocks</strong> of a React app. It’s quite similar to Lego model parts. You could have two T-shirt components with slightly different styles but similar functions.</p><p>React components are usually designed to be <strong>reusable</strong>. For example, when we are creating forms in a webpage, we could have a component for the input fields, it can be reused in the signup form and contact us form with different CSS styles.</p><p>Components can be <strong>stateful</strong> (aka container) and <strong>stateless</strong>. Stateful components can render different JSX according to their state, while stateless components always render the same content. A component&#39;s state changes are usually triggered by user events such as clicking a button or receiving an HTTP request.</p><p>Stateful components use to be only class components. After version 16.8, it can now be functional with useState hooks.</p><p><strong>JSX<br></strong>When rendering React components, we usually write them in “HTML format”. Although the syntax looks like HTML, it’s actually JSX.</p><p>Without using JSX, we have to separate the HTML code into another file, which would make variable passing more difficult. Another approach without using JSX is to write HTML tags in JavaScript format, which is much less readable. Below are the comparisons between JSX rendering and JavaScript rendering:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ab80fed6daa2a2a09f9b9944f2f65f09/href">https://medium.com/media/ab80fed6daa2a2a09f9b9944f2f65f09/href</a></iframe><p>Note that the web browser cannot read JSX directly, it needs to be transformed into a regular JavaScript object using <strong>Babel</strong>.</p><p><strong>Virtual DOM<br></strong>DOM (Document Object Model) is an <strong>interface </strong>that defines how HTML and XML files are<strong> structured</strong> and stored in a browser&#39;s memory [4]. It represents a document with a<strong> logical tree</strong>. At the end of each tree branch, there’s a node containing a DOM object. The most common DOM objects are</p><p>– Elements: Tags used inside HTML document<br>– Text: Content of tags<br>– Attributes: eg. “href”</p><p>Through DOM structure, we can <strong>programmatically access the logical tree</strong>, changing the document’s structure, style or content.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*WaGFs2HnBwwiCvK5.gif" /><figcaption>DOM Structure by <a href="https://www.w3schools.com/xml/dom_intro.asp">W3Schools</a></figcaption></figure><p>A<strong> <em>Virtual DOM</em></strong> is a scheme to <strong>increase </strong>the page loading<strong> performance</strong>. Unlike traditional DOM that always updates the entire file, virtual DOM will <strong>only update the changed elements</strong>.</p><p>To achieve this, virtual DOM will create a lightweight copy of the real DOM in the memory, and compare it to the snapshot of the previous virtual DOM before updating the real DOM. Through the comparison, it will figure out which node has changed and will only update the changed component in the real DOM.</p><p>The change in virtual DOM is managed or <strong>triggered </strong>through the <strong>state </strong>and<strong> props </strong>in React. Once a state or a prop in the argument has changed, the virtual DOM will trigger the comparison and make necessary updates.</p><p><strong>One-Way Data Binding<br></strong>There are two versions of understandings regarding the one-way data flow.<br>The official version is</p><blockquote>The data can only be passed down<strong> from parent to child components </strong>through read-only props <em>[5]</em>.</blockquote><p>This means if the props pass down from a parent to the child component has changed, the child component will rerender. However, if the state of a child component changes, the parent component won’t rerender.</p><p>One-way data flow helps React to keeps everything <strong>modular </strong>and <strong>fast </strong>[5]. It also makes the <strong>troubleshooting process easier</strong>, making sure no new bugs will be introduced by mistake when <strong>scaling </strong>the application.</p><p>However, the default one-way setup doesn&#39;t make <strong>inverse data flow</strong> impossible. By passing a <strong>callback function</strong> as a prop to the child component, the parent component can also react to its child’s states. We could also use libraries such as Redux and Flux for more complex state management.</p><p>The example below shows that by passing the setText() function as a prop to the child component, the parent {text} can change when clicking the button in the child component.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/adafa5ba8f6b2d806e83ed4c6cab8a36/href">https://medium.com/media/adafa5ba8f6b2d806e83ed4c6cab8a36/href</a></iframe><p>Another popular version sees the two parties of data binding as the <strong>view (UI)</strong> and the <strong>components</strong>.</p><blockquote>React only allows<strong> changes in the component to update the UI</strong>, not the other way around, meaning that the data can only flow in one way <em>[6]</em>.</blockquote><p>For frameworks such as Angular, changes in the view can also update the component. That’s why it’s called two way.</p><p>The most typical example is when we are typing on our keyboard, React won’t automatically show what we typed in on the text box ( i.e. UI events cannot directly change what the component renders). It will only do so when we add an event handler to change the component state, and then trigger the component re-render based on the state (i.e. component update UI).</p><h4><strong>3. Comparisons to Other Front-End Techs</strong></h4><p>According to the stateofjs survey conducted in 2020 [7], the top 3 front-end techs used by developers are React, Angular, and Vue. The key differences between these 3 techs are:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*rbkVvcUOMnSuKY7U83HXYQ.png" /><figcaption>React, Angular, Vue Comparison by Lanting Natalie Ding</figcaption></figure><h4>4. Pros and Cons of React</h4><p>Based on features and comparisons to other front-end techs, we can find the main pros and cons of React are as follows:</p><p><strong>Pros</strong></p><p>– <strong>Fast</strong>! Due to the usage of virtual DOM.<br>– <strong>Reusable</strong>. The reusable components increase development modularity. It also makes it easier to debug and maintain.<br>– <strong>Flexible</strong>. React are compatible with a wide variety of libraries, developers can mix and match based on project needs.<br>– <strong>Compatible</strong>. React Native allows developers to reuse most of their codes in both iOS and Android app development projects.<br>– <strong>Robust</strong>. One-way data flow makes the troubleshooting process easier, it makes sure no new bugs will be introduced by mistake when scaling the application.</p><p><strong>Cons<br></strong>Based on my personal experience and online summaries, I didn’t see too many big-deal cons in terms of the technical side. Nevertheless, it does have some small drawbacks:</p><p><strong>– JSX increases complexity</strong>. Although JSX makes it possible to write HTML and JavaScript in one file, it may steeper the learning curve, especially for new developers.<br>– <strong>Extra work on SEO</strong>. Low SEO ranking is a shared problem of all single-page web apps. To make React SEO friendly, developers have to create isomorphic React apps rather than the default setting.<br>– <strong>Poor documentation</strong>. React technologies updating and accelerating so fast that there is no time to make proper documentation.</p><h4>5. How Do You Choose between Web Development Technologies?</h4><p>If I were to answer this question in an interview, I would consider it more from the <strong>business side</strong>, as the difference between all these web development technologies nowadays cannot cost you arms and legs, as long as it is not too obsolete.</p><p>For example, what are the product features? What are the technologies that the company is currently using? Is it suitable for the future development of the product/company? Is it a large scale business? Is the deadline tight? What’s the cost of development tools and human resources?</p><h3>Dive Deeper into the Details</h3><h4>1. How Do You Plan a React Project</h4><p><strong>1. Create a UI mockup<br></strong>Before we start a project, we would already have an idea of what the features should be like, so the most direct way to help us start with the planning is always through visualising the layout.</p><p><strong>2. Break the UI into component trees<br></strong>Once we have drawn the layout, we’ll have a much clearer idea of the basic <strong>building blocks</strong> of the whole project. Since one feature of React components is its reusability, we should try to pick out the <strong>repeatable </strong>blocks. For example, in my poke ordering project below, the ingredients are highly repeatable with only changes in the image resource.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L4r3QypRCDGPPbszsdtuZg.png" /><figcaption><a href="https://lantings-poke.web.app/">Poke Ordering Website</a> Component Breakdown by Lanting Natalie Ding</figcaption></figure><p><strong>3. Determine application state<br></strong>Now we have all the components in place, the next step is to determine which components should manage the state. Stateful components are usually the ones that <strong>interact with the users </strong>or the system, as they aim at triggering rerendering to <strong>update the UI</strong>. Taking the poke ordering web as an example, the item controller should be a typical stateful component.</p><p>Note that the states are not necessarily managed by the component itself, it can also be put into their parent component as React usually use <strong>top-down data flow</strong>. This is because, for complex projects, one state can affect multiple components. Therefore, we also need to look at <strong>component interactions</strong>.<strong> </strong>For the poke ordering website example, I put the states of the item controller into its parent component as it also affects the ingredients display in the order preview.</p><p><strong>4. Arrange folder structure<br></strong>After picking out the stateful components, we can now arrange the folder structure. In the upper-most tree, I would divide them into <strong>stateless components</strong> and <strong>stateful containers</strong>, and then make further divisions based on the functionality. If some components are <strong>shared </strong>and repeated on a large scale (eg. buttons, input fields), we could also create a separate folder for them. For more complex projects, we could also add folders for <strong>higher-order components</strong> and <strong>Redux stores</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*UYsKLsqwTy1kkRP6BzbeJQ.png" /><figcaption><a href="https://lantings-poke.web.app/">Poke Ordering Website</a> Project Structure by Lanting Natalie Ding</figcaption></figure><h4>2. Explain React Component Lifecycle</h4><p>React lifecycle can be divided into 4 stages: <strong>Mounting</strong>,<strong> Updating</strong>,<strong> Unmounting</strong>,<strong> </strong>and <strong>Error Handling </strong>[8]. Each component has several “<strong>Lifecycle Methods</strong>” that we can override to run code at particular times in the process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hteJP3_o0aoAHAWk" /><figcaption>React Component Lifecycle by <a href="https://programmingwithmosh.com/javascript/react-lifecycle-methods/">Mosh Hamedani</a></figcaption></figure><p>(The methods with a 🌟 symbol are more commonly used)</p><h4><strong>Mounting</strong></h4><p>In this stage, React <strong>puts elements into the DOM</strong>. It will execute the following lifecycle methods in sequence:</p><p><strong>I. </strong>🌟<strong><em>constructor():</em></strong></p><p>Set up the initial state and other initial values, bind event handlers methods.</p><p><strong>II.<em> static getDerivedStateFromProps()</em></strong></p><p>Exists for rare use cases where the state depends on changes in props over time, such as animated page transition components.</p><p><strong>III. </strong>🌟<strong><em>render()</em></strong></p><p>This is the <strong>only required method</strong> for class components. It outputs the JSX into the DOM.</p><p>The render() function should be <strong>pure</strong>, meaning that it should not modify the component state, and should return the same result each time it’s invoked. Otherwise, it will cause an infinite loop.</p><p>One special case is calling setState() in event handlers such as onClick. Since the state changes will only be triggered when a certain event happened, it will not cause an infinite loop. Therefore, it is valid.</p><p><strong>IV. </strong>🌟<strong><em>componentDidMount()</em></strong></p><p>This method is invoked immediately after a component is inserted into the DOM tree. It is a good place to <strong>cause side effects </strong>such as <strong>instantiating network requests </strong>(for more details see what are React side effects section)<strong>.</strong></p><p>Although it seems inefficient to make API calls here since the received data needs to be rerendered, it’s actually not. Because network request is <strong>asynchronous</strong>, meaning that it will inevitably need to be re-rendered. Doing it in componentDidMount() allows other parts of the components, such as the spinner, to be loaded first, which improves the user experience.</p><h4><strong>Updating</strong></h4><p>Updating happens when the <strong>states </strong>or <strong>props </strong>in a component is <strong>altered</strong>. When components need to be re-rendered, the following methods are called in order:</p><p><strong>I. <em>getDerivedStateFromProps()</em></strong></p><p><strong>II. <em>shouldComponentUpdate()</em></strong></p><p>This method returns a Boolean value that specifies whether React should continue with the rendering or not. It is mostly used for performance optimization.</p><p><strong>III.<em> render()</em></strong></p><p><strong>IV.</strong> <strong><em>getSnapshotBeforeUpdate()</em></strong></p><p>This is also not a commonly used method. It enables components to capture some information from the DOM before it is potentially changed. One typical use case occurs in UIs like a chat thread that needs to handle scroll positions. Note that the value returned from this method should always be passed as the third argument to the componentDidUpdate method.</p><p><strong>V. </strong>🌟<strong><em>componentDidUpdate()</em></strong></p><p>Similar to componentDidMount(), this is also a good place to do <strong>network requests </strong>when a component is being <strong>rerendered</strong>. The difference is that we need to compare the current props to previous props.</p><p>It’s often used when we need to call an external API when the state has changed. One use case is to click the refresh button to update the data in a chart.</p><h4><strong>Unmounting</strong></h4><p>When unmounting, a component is being <strong>removed from the DOM</strong>. There’s only one lifecycle method in this stage.</p><p><strong>I. </strong>🌟<strong><em>componentWillUnmount()</em></strong><br>This method is called before a component is removed from DOM.<br>It is a good place to <strong>clean up</strong> the <strong>long-running processes</strong> that we set up in componentDidMount(). For example, when we set up an API to call every 15 seconds for real-time data update, we could clean it up here.</p><h4>Error Handling</h4><p>React components will only enter into this stage when an <strong>error occurred </strong>in their <strong>child components</strong> (not in itself). There are two lifecycle methods in this stage.</p><p>The components that define either of these two methods are called<strong> Error Boundaries. </strong>They are designed to capture unhandled JavaScript errors in the trees below and display a <strong>fallback UI, </strong>helping us to recover from unexpected exceptions.</p><p><strong>I. <em>static getDerivedStateFromError()</em></strong></p><p>This method is called during the render() phase. It receives the thrown error as a parameter and returns an updated state. Therefore, we could use this method to<strong> load an error message</strong> when a child component fails.</p><p><strong>II. <em>componentDidCatch()</em></strong></p><p>This method is invoked after an error has been thrown by a descendant component. Since side effects are permitted in this phase, it is usually used for <strong>logging errors</strong>.</p><h4><strong>3. What are React Side Effects</strong></h4><p>A “side effect” is any change to state or behaviour other than returning a value from a function. Common side effects include [8]:</p><ul><li>Logging a value to the console</li><li>Saving a file</li><li>Setting an async timer</li><li>Making an AJAX HTTP request</li><li>Modifying some state that exists outside of a function, or mutating arguments to a function</li><li>Generating random numbers or unique random IDs (such as Math.random() or Date.now()</li></ul><h4><strong>4. What is a Single Page Application?</strong></h4><p>Single-page app (SPA) is quite similar to the concept of virtual DOM. It will only <strong>dynamically rewriting</strong> the nodes that have been affected from the server, while traditional multi-page web apps will always re-render a whole HTML file with every click you make and sends it to your browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aLNkHgfuecxHpm6a.jpg" /><figcaption>SPA VS MPA Lifecycle by <a href="https://www.apriorit.com/white-papers/437-single-page-apps">Apriorit</a></figcaption></figure><p><strong>SPA Pros<br></strong>Since most websites have a lot of repeating content, the major benefit of SPAs is their <strong>high speed</strong> and <strong>responsiveness</strong>, especially when the user has a bad network connection or heavy traffic. It can even <strong>work offline</strong> after being loaded for the first time with the help of caching (without API calls for new data of course). Therefore, it provides a <strong>better user experience</strong>.</p><p>Another benefit of SPAs is their <strong>compatibility with mobile development</strong>. Developers can use relatively the same code to develop a native mobile application.</p><p><strong>SPA Cons<br></strong>Although SPAs are fast, they can <strong>affect SEO optimisation</strong>. Since SEO bots usually only index the main page of SPAs, the reloaded content won’t be taken into consideration. Therefore, their rankings on search engines may drop. Nevertheless, Google is continuously updating its search algorithms to fix this issue. There are also approaches to optimise it with isomorphic React apps[9].</p><p>SPAs also come with more<strong> security vulnerabilities</strong>. Since the default settings for SPA is client-side rendering, it is more prone to attacks such as Cross-Site Scripting (XSS) attacks through injecting malicious Javascript code to the client side.</p><p><strong>When to Use SPAs<br></strong>SPAs are particularly suitable for pages with<strong> rich UI and interactions</strong> as it reloads only a small JSON file rather than a whole page. Therefore, social media websites (eg. Facebook) or pages with fancy animations are often SPAs.</p><p>On the other hand, large companies (eg. online stores such as Amazon, eBay) with a broad range of services and products would benefit more from MPAs, as they usually need SEO optimisations and connection to multiple user databases [10].</p><h4><strong>5. What is a Higher-Order Component?</strong></h4><p>Higher-order components (HOC) take another component as an argument and returns a new component. They are usually used to <strong>reduce repetitiveness</strong> in code. For example, we could wrap all the components that need the closest route’s history with WithRouter HOC, or wrap all pages that need transition animation with an animated transition HOC.</p><p>Sometimes an HOC can also be used as an auxiliary wrapper. React only allows rendering with a single JSX node, such auxiliary HOC can be used if we want to render multiple parallel nodes in a component.</p><h4><strong>6. What are Synthetic Events in React?</strong></h4><p>Events are the actions that users or systems may trigger, such as mouse click or keyboard input. They are not part of core Javascript. Instead, they come from each <strong>browser’s own Javascript API</strong>.</p><p>Synthetic events are provided by React to <strong>normalizes events</strong> so that they have <strong>consistent </strong>properties across different browsers, saving developers from tweaking codes.</p><h4><strong>7. Why is There a Need for Using Keys in Lists?</strong></h4><p>We would often see a warning if we forgot to add a unique key to a list. This warning is basically because of <strong>performance</strong> issues.</p><p>Since React uses virtual DOM, it needs to know which part of the component has been updated. To <strong>identify the changed node</strong> quicker, we need a unique key for each element in the list.</p><h3>Thanks for Reading!</h3><p>Wow, we are finally there! Hope these explanations can help you to have a better understanding of React theories, and, good luck cracking the interviews!😉</p><h3>References</h3><p>[1] <a href="https://www.udemy.com/course/react-the-complete-guide-incl-redux/">React the Complete Guide</a> by Maximilian Schwarzmüller</p><p>[2] <a href="https://www.freecodecamp.org/news/is-react-a-library-or-a-framework/">Is React a Library or a Framework? Here’s Why it Matters</a> by Reed Barger</p><p>[3] <a href="https://www.tutorialsteacher.com/mvc/mvc-architecture">ASP.NET MVC Architecture</a> by TutorialsTeacher</p><p>[4] <a href="https://www.dynamicwebtraining.com.au/blog/dom-element-in-javascript?gclid=Cj0KCQjwpf2IBhDkARIsAGVo0D2i26gejfjiycdEFR7N1_7dGq6_UCQ6LB4vpYS8b-lIJq3s1wH6RskaAg9fEALw_wcB">What is a DOM element in JavaScript? How does it work?</a> by Dynamic Web Training</p><p>[5] <a href="https://reactjs.org/docs/thinking-in-react.html#step-2-build-a-static-version-in-react">Thinking in React</a> by ReactJS.org</p><p>[6] <a href="https://labs.tadigital.com/index.php/2020/03/31/unidirectional-data-flow-in-react/">Unidirectional Data Flow in React</a> by MEENAL GARG</p><p>[7] <a href="https://2020.stateofjs.com/en-US/technologies/front-end-frameworks/">Front-end Frameworks</a> by State of JS</p><p>[8] <a href="https://redux.js.org/tutorials/fundamentals/part-6-async-logic">Redux Fundamentals, Part 6: Async Logic and Data Fetching</a> by Redux.js.org</p><p>[9] <a href="https://yalantis.com/blog/search-engine-optimization-for-react-apps/">How to Make React SEO-Friendly: an Extensive SEO Guide</a> by Bohdan Ivanchenko</p><p>[10] <a href="https://echoinnovateit.com/single-page-app-vs-multi-page-app/">Single Page Application vs Multi Page Applications: Choose The Best For Your Need</a> by Echo Innovate IT</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a1d38ce8ef5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A/B Testing 101 with Examples - A Summary of Udacity’s Course]]></title>
            <link>https://medium.com/data-science/a-b-testing-101-with-examples-a-summary-of-udacitys-course-3f937e8ea31f?source=rss-6542d6e4059d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f937e8ea31f</guid>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[ab-testing]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Lanting Natalie Ding]]></dc:creator>
            <pubDate>Fri, 27 Nov 2020 14:43:18 GMT</pubDate>
            <atom:updated>2021-09-01T05:00:09.456Z</atom:updated>
            <content:encoded><![CDATA[<h4>15 mins to walk you through the 23-hour course</h4><p>Long before I took any statistical class, I’ve heard that A/B testing is almost a must for data analysts. So I Googled it and thought: Hmm…isn’t it just like the control and experiment studies we conducted in high school biology class? Simple as it may sound, it actually has a rigorous statistical process and involves various business concerns.</p><p>The contents covered in this Udacity course [1] include:</p><ul><li><a href="#1e34">What is A/B Testing</a></li><li><a href="#63b0">When and when not to use A/B Testing</a></li><li><a href="#1683">Steps to carry out the test</a></li><li><a href="#7e41">Ethical issues that every data enthusiasts should know</a></li></ul><p>Before we go any further:</p><h3><strong>What is A/B testing?</strong></h3><blockquote>A/B testing is a way to compare <strong>two versions</strong> of a<strong> single variable</strong> , typically by testing <strong>a subject’s response</strong> to variant A against variant B , and determining <strong>which of the two variants is more effective </strong><em>[2]</em>.</blockquote><p>For a better understanding, I will use this example throughout this article to give a more concrete explanation:</p><p><em>Suppose an online learning platform wants you to test whether they should change the web page&#39;s button size to increase the number of users.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*LL3enZe3KHMksOX1BN4YTg.png" /><figcaption><a href="https://commons.wikimedia.org/w/index.php?curid=52602931">“AB Testing Example”</a> by Maxime Lorant licensed under <a href="https://creativecommons.org/licenses/by-sa/4.0?ref=ccsearch&amp;atype=rich">CC BY-SA 4.0</a></figcaption></figure><p>By matching the example with the definition above, we have:</p><p><strong><em>Single variable:</em></strong><em> “Join Now ” button size on a webpage<br></em><strong><em>Variant A:</em></strong><em> 4 x 3 button size<br></em><strong><em>Variant B:</em></strong><em> 16 x 9 button size<br></em><strong><em>Subject’s response: </em></strong><em>click-through probability changes<br></em><strong><em>Goal:</em></strong><em> find out which option has a higher click-through probability</em></p><h3>Jack of all trades?</h3><p>Sounds like if we change the variables and responses to any other attributes, A/B testing can still apply, huh? Indeed, A/B testing has many <strong>Use Cases</strong>, including:</p><p><strong><em>UI changes, recommendations, ranking changes, implicit changes such as loading time, etc.</em></strong></p><p>However, there are also cases it is <strong>Not So Useful</strong>:</p><ul><li><strong><em>Missing items<br></em></strong>For our online course website example: if there are any courses we didn’t offer, but the users are looking for, A/B testing cannot tell.</li><li><strong><em>New experiences<br></em></strong>Introducing new experiences such as VIP services can be troublesome because:</li></ul><p>a) The baseline of comparison is not clear</p><p>b) The time needed for users to adapt to new experiments can be quite costly, as there might be some <strong>psychological influences</strong> on users:</p><p><strong><em>Change Aversion</em></strong>: when faced with a new interface or changed functionality, users often experience anxiety and confusion, resulting in a short-term negative effect.</p><p><strong><em>Novelty Effect</em></strong>: when new techs came out, users will often have increased interests so that the performance will improve initially, but it’s not because of any actual improvement.</p><p>Now that we know when to use it, so:</p><h3>What are the Steps of A/B Testing?</h3><p>There are 5 main steps for A/B Testing:</p><p><strong>1. Make a hypothesis about the change<br></strong>The first step is exactly what we did in the example above. i.e., We assume that changing the size of the ‘Join Now’ button from 4x3 to 16x9 will affect the number of students enrolled in our online course.</p><p><strong>2. </strong><a href="#7250"><strong>Choose the metrics</strong></a><strong><br></strong>E.g. We want more students to move from the course menu page to a specific course page, so we choose the ‘click-through probability’ as our metric.</p><p><strong>3. </strong><a href="#5f59"><strong>Design the experiment setups</strong></a> (including the unit of diversion, population, size, and duration), and carry out the test.</p><p><strong>4. </strong><a href="#8378"><strong>Analyse the results</strong></a><br>Calculate the margin based on the confidence interval, and decide whether it satisfies the practical significance requirements.</p><p><strong>5. </strong><a href="#d94b"><strong>Make a decision</strong></a>.<strong> </strong>Communicate the results and risks with stakeholders.</p><p>If you feel confused about some of the concepts above, don’t worry. Let’s dive into the details!</p><h3>Step 2. Choose the Right Metrics</h3><p>After we set up our goals in step 1, we need to choose the correct metrics to convert the goals to concrete measurements such as click-through probability. It can be <strong>single or multiple </strong>metrics depending on the business needs. If you chose multiple metrics, one way is to combine them with weights to form an <strong>overall evaluation criterion (OEC)</strong>. The steps mentioned in this course are:</p><p><strong>1. Invariant (Sanity) Check<br></strong>Before choosing the measurement metrics that will be affected by the variants, we need to make sure invariants are controlled. For example, do you have the same number of users across the two groups (<strong>population sizing</strong>)? Do they have <strong>comparable distributions </strong>across countries, languages? Ideally, we should also assign the two groups the same<strong> number of trials</strong>.</p><p><strong>2. Determine High-level Business Metrics<br></strong>This usually involves discussing with domain experts to determine the best practice, such as revenues, market shares, etc. In our online learning case, click-through probability makes more business sense.</p><p><strong>3. Expand to More Detailed Metrics<br></strong>First of all, we could list the basic <strong>customer funnel</strong> and expand it with more details to better understand the data we need to collect for the metrics. In this case, we need to capture the number of unique users that moves from “exploring the site” to “create an account.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*a3r1IHhfOKA8uGOcqeJ6ug.png" /><figcaption>Customer Funnel of the Online Course Example</figcaption></figure><p>Then we determine how to <strong>summarise the metrics</strong>. In general, there are 4 ways to summarise the metrics:</p><ul><li><strong><em>Sums and counts,</em></strong> e.g., Total visits to the home page</li><li><strong><em>Distributional metrics,</em></strong> e.g., Average visits to the home page per day.<br>Aggregations such as mean, median, 25th, 75th percentile, etc.</li><li><strong><em>Probabilities and rates,</em></strong> e.g. Click-through rates or probabilities<br>Rates: usually used to determine whether this change is easy to find<br>Probabilities: determine whether users like this change</li><li><strong><em>Ratios</em></strong> eg. Pr(revenue-generating click)/ Pr(total clicks)<br>Any two numbers divided by each other</li></ul><p>To choose between these 4 methods, we usually look at:</p><ul><li><strong><em>Distribution of the metrics<br></em></strong>Plot a histogram of past data:<br>if it is normal shaped distribution: choose mean or median<br>if it is one-sided distribution: choose 25th, 75th… percentile</li><li><strong><em>Sensitivity and robustness</em></strong><br><strong><em>Sensitivity</em></strong>: the metrics respond well to <strong>relevant </strong>changes (e.g., button size)<br><strong><em>Robustness</em></strong>: when <strong>irrelevant </strong>changes (e.g., site loading time) happen, the metrics do not change a lot <br>We usually use<strong><em> A/A Experiments</em></strong> to test them out. For example, when we use the same setup of a button to test users with different loading times, the click-through probability shouldn’t vary too much (robustness). However, if we use different button sizes, the click-through probability should change accordingly (sensitivity). <br>When new experiments are too costly, we could also do a <strong><em>Retrospective Analysis</em></strong> by looking at past data to test out similar scenarios.</li></ul><h3><strong>Step 3. Design the Experiment Setups</strong></h3><p>So far we know what to test on, but before we carry out the test, there are still 4 attributes need to be designed: <strong>Unit of Diversion</strong>,<strong> Population</strong>,<strong> Size</strong>,<strong> and Time</strong>.</p><h4><strong>1. Unit of Diversion (Proxies of Users)</strong></h4><p>Remember in our online course example, we want to collect the number of unique users that moves from “exploring the site” to “create an account”? So what can be considered a “unique user”, or the <strong>unit to run the test</strong>? This is the question that the unit of diversion answers. The commonly used units include:</p><p><strong><em>User ID, Cookies, Events such as page view, Device ID, IP address</em></strong></p><p>To determine the best unit, we need to look at:</p><ul><li><strong>User experience consistency<br></strong>Since we don’t want the same person to see different experiment groups at different times, we need to choose the unit that can reduce this effect and get more accurate data at the same time. For example, if we choose cookies as the unit of diversion when users switch to another browser, they may be assigned to a different group.</li><li><strong>Variability</strong><br>We also need to look at the distributions of our metrics to make sure they don’t vary too much so that the practical significance level is realistic for the metrics we choose.<br>For some complicated metrics, the empirical variability can be very different from the analytical one. It usually happens when we observe weird distributions of our metrics or when the unit of analysis (i.e., the denominator of your analysis metrics) is different from the unit of diversion (e.g., using the user id as a unit of diversion but the page view as the unit of analysis). In such cases, we need to use the empirical variability deducted from the A/A experiment.</li><li><strong>Ethical issues<br></strong>Security and confidentiality issues;<br>Whether informed consent is feasible.</li></ul><h4>2. <strong>Population (Target Users)</strong></h4><p>Sometimes we want to target the changes to specific user groups. This is called a <strong><em>cohort</em></strong>. For example, if we change the English text prompt of a button, we may only want to test the results on English speaking users.</p><p>Note that limiting the population to a cohort may need a longer time to collect sufficient data. So unless we want to increase user stability or reduce the learning effect, using a cohort is unnecessary.</p><h4>3. <strong>Size</strong></h4><p>The questions we need to answer regarding the size include: How many tests do we need to get statistically significant results? How do we reduce the number of tests to save time? These are the 4 parameters that will affect the sample size:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*qv5L7STd4HULsbTyZKM96Q.png" /><figcaption>Parameters that Affects the Sample Size</figcaption></figure><p>And the specific numbers can be calculated using t<a href="https://www.evanmiller.org/ab-testing/sample-size.html">his calculator</a>.</p><h4>4. <strong>Time</strong></h4><p>The last parameter to consider is time, which includes:</p><ul><li><strong>When to run the test<br></strong>Many businesses have seasonal effects. If our tests happen to be on holidays or back to school days, the results may not be accurate. So if possible, it’s better to test the results in a comparable time.</li><li><strong>Duration<br></strong>As there will be novelty effect and change aversion to a new version of a product, we need to give the users some time to get used to the changes to stabilize the result.</li><li><strong>The fraction of traffic<br></strong>We may have the intuition that if the experiment runs on all the target users, the time needed to collect a sufficient amount of data would be much less. But why the common practice is to run the experiment on a <strong>small portion of the traffic</strong> instead?<br>This is because we are unsure if there are risks in the test version or whether it will harm the user experience. For example, if we are testing a new version of a database, we don’t want it to fail pervasively. By doing so, we could also reduce the effect of variabilities, such as holidays or weekends. Not to mention that the learning effect takes time for users to react normally.</li></ul><h3><strong>Step 4. Analyse the Results</strong></h3><p>Suppose that we have already run the experiment and collected a sufficient amount of data. Shall we move on to analysing the results directly? Not quite, we still need to do another sanity check to ensure the experiment is conducted properly.</p><h4><strong>1. Sanity Check</strong></h4><p>We have already know the invariants when choosing our metrics. Now we need to check that they actually didn’t change in the experiment. Let’s look at an example:</p><p><em>Say we’ve collected 65554 samples in the “4 X 3” button size group and 61818 in the “16 X 9” group. We want to know whether the number of samples collected in these two groups are roughly the same with 95% confidence.</em></p><p>We could use the formula below for sanity check:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*8AeKnnD4qsb7lRH4EeyCqw.png" /></figure><p>1) Compute the standard error of binomial with probability 0.5 of success<br>2) Lookup Z score of 95% and calculate the margin of error<br>3) Compute the confidence interval around 0.5<br>4) Check whether the observed probability is within the confidence interval</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*e5OcXpoSclz0OetHoffmcA.png" /></figure><p>The observed probability is not within the 95% confidence interval in the example above, so something about the setup isn’t correct.</p><h4><strong>So what to do if our sanity check went wrong?</strong></h4><blockquote>Do not proceed, go straight to analysing why it fails.</blockquote><p>First, we could look at the data in a<strong> smaller group,</strong> eg. day by day to find out which part went wrong. If it was technical reasons, we should debug with the engineers.</p><p>To prevent the sanity check from failing, we could also add a <strong>pre/post period A/A experiment</strong>. The pre-period test is what we mentioned in “choosing the metrics”, while the post-period test is usually used to measure whether learning effect happened in our experiment.</p><p>If sanity check only failed in the pre-period, check the experiment set up, infrastructures or things along those lines. If it only failed in the experiment itself, then it’s the data capture issue.</p><h4><strong>2. Calculate the statistical significance</strong></h4><p>After the sanity check, we finally reach the most exciting part! We can now put together all the hard works and make a decision! In this step, we need to determine if the change is statistically significant, together with the magnitude and direction of the change. For single and multiple metrics, we usually use different strategies.</p><h4><strong>Single Metric</strong></h4><p><strong>Hypothesis test</strong> and<strong> sign test </strong>are commonly used to calculate the statistical significance for a single metric. Let’s see the examples：</p><p><strong>Hypothesis test: </strong><em>Suppose we have the following data and parameters that already passed the sanity check:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*A5tTgibkVwuA87oc3KXu5g.png" /></figure><p>Unlike what we’ve done in the sanity check, we use the pooled probability (overall probability) as the centre of the confidence interval for a better estimation than 0.5 this time. The standard error should also be pooled:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*Qu7DXr8lsalmp3yxI3-rsw.png" /></figure><p>Following the same steps in the sanity check, we could get the result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*38jSPYmuARqkinPH2mwoDQ.png" /></figure><p>Since the lower boundary of the confidence interval is higher than the minimum practical significance level, it is safe to recommend a launch of the experiment version.</p><p>If the practical significance level (dₘᵢₙ) falls on a different part of the confidence interval, we could reference this graph:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eSarO8l6FSSy_t567WARQw.jpeg" /><figcaption>Confidence Interval VS Practical Significance Level</figcaption></figure><p><strong>Sign Test: </strong><em>Suppose when we segment the data into different days, 9 out of 14 days the control group has a higher click-through probability.</em></p><p>If there’s no difference between the two groups, the hypothetical probability of “success” should be 0.5. We could then use <a href="https://www.graphpad.com/quickcalcs/binomial2/">this calculator</a> to get the two-sided P-value. We could see that the two-tail P-value is 0.424, which is much larger than 0.05 for a 95% confidence interval. So the sign test suggests there’s no statistically significant difference.</p><h4>If the <strong>tests do not agree with each other…</strong></h4><p>We should break the data down into subgroups to see which part has more effect. You may also encounter the Simpson’s paradox in such cases. A very famous example is the <a href="https://towardsdatascience.com/gender-bias-in-admission-statistics-the-simpson-paradox-cd381d994b16">UC Berkeley gender bias</a> [3].</p><blockquote><strong>Simpson’s Paradox</strong> is a statistical phenomenon that a trend appears in the combined data, but disappears or reverses when the data are partitioned into several different groups <em>[4]</em>.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*8bMJSiKhwF1Eeq3x.gif" /><figcaption><a href="https://commons.wikimedia.org/w/index.php?curid=62007681">“Simpsons Paradox Animation”</a> by <a href="https://commons.wikimedia.org/w/index.php?title=User:Pace~svwiki&amp;action=edit&amp;redlink=1">Pace~svwiki</a> licensed under <a href="https://creativecommons.org/licenses/by-sa/4.0?ref=ccsearch&amp;atype=rich">CC BY-SA 4.0</a></figcaption></figure><h4><strong>Multiple Metrics</strong></h4><p>One key difference between single and multiple metrics is that:</p><blockquote>The more metrics you test, the more likely you see statistically significant results by chance - Multiple Comparison Controversy</blockquote><p>This is because the probability of <strong>false-positives at least occur once </strong>would be higher.</p><p><em>Assume we have 3 metrics all with a false-positive probability of 5%, the chance of having at least 1 statistically significant results is 1–0.95³=0.143. When we have 20 metrics, the probability becomes 1–0.95²⁰=0.642.</em></p><p>Luckily, it is <strong>not repeatable</strong>. If we do the test again or segment it into small groups, it should disappear.</p><p>We could also use these techniques to resolve the multiple comparison issue:</p><h4><strong>How to resolve multiple comparison controversy?</strong></h4><p>The general solution is to use <strong>a higher confidence interval</strong>. This can be achieved by:</p><p>a) Assuming independence, and <strong>set only the overall alpha</strong><br>Then we use:αᵒᵛᵉʳᵃˡˡ = 1-(1 - αᶦⁿᵈᶦᵛᶦᵈᵘᵃˡ) ⁿ to calculate individual α.</p><p>b) <strong>Bonferroni Correction</strong><br>This method has no assumptions. It calculates the individual α <br>by αᶦⁿᵈᶦᵛᶦᵈᵘᵃˡ = αᵒᵛᵉʳᵃˡˡ/number of metrics. Note that this is a relatively conservative method, you may miss some valuable observations.</p><p>c) <strong>Familywise Error Rate</strong><br>The FER only controls the probability that any metric shows a false positive.</p><p>d) <strong>Control False Discovery Rate</strong><br>In this case, we allow a high probability of false positive, as long as there isn’t too many. Note that FDR should be used when the number of metrics is very large, usually hundreds.</p><h3><strong>Step 5. It’s All about Decisions</strong></h3><p>Up until now, we’ve already calculated the statistical significance and confidence interval with all the cautions. Are we good to bring up the recommendations?</p><h4><strong>Things to consider when making decisions</strong></h4><ul><li>Is it statistically and practically significant?</li><li>Do you understand the change?</li><li>For multiple metrics, do they move in the same direction?</li><li>What has the change done to the user experience?</li><li>Is it worth it？</li></ul><h4><strong>Problems may occur when launching</strong></h4><blockquote>Always do a ramp-up when lauching a change, that’s what we do for all the launches at Google.</blockquote><p>Real word data is nasty, so do the test. Even if the test is statistically significant initially, the <strong>effect can be flattened when you ramp up the change</strong> (i.e. gradually increase the percentage of users to the new version). This is mainly because:</p><ul><li><strong>Event or seasonal driven impact<br></strong>We could <strong><em>holdback</em></strong> (When the changes are not applied to a small number of users, we should see the reverse effect in this group), <strong><em>cohort analysis,</em></strong> or <strong><em>pre/post period A/A experiment</em></strong><em> </em>to test the issue.</li><li><strong>The results may not be repeatable<br></strong>Sometimes our changes will only be effective to 30% of users or have a positive effect on 30% users but negatively affect 70% users. We could do a ramp-up launch to test out this issue.</li><li><strong>Business effects<br></strong>We may also find companies call off the launching when the engineering, or opportunity cost is relatively high, or when there’s customer support or sales issue.</li></ul><h3><strong>A Final Note: Ethical Issues</strong></h3><h4><strong>Risks</strong></h4><p>The risks the participants are exposed to should not exceed the minimal risk, i.e., the probability and magnitude of harm a participant would encounter in normal daily life. If the risk exceeds minimal risk, informed consent is required.</p><h4><strong>Benefits</strong></h4><p>What benefits might the outcome of the study be?</p><h4>Choice</h4><p>What other choice does the participant have? For example, when testing out new drugs for cancer, the other choice most participants have is death, so that the risk for participants is quite high.</p><h4><strong>Privacy (Data Sensitivity)</strong></h4><p>What expectations of privacy and confidentiality do participants have? Note that the timestamps are considered personally identifiable since they could contain enough information to link the data to a person. This means that any sensitive data, such as health conditions with timestamps, should be considered sensitive.</p><h3>Thanks for Reading!</h3><p>Wow, we are finally there! Thanks for reading the notes and explanations! I’d be glad if this summary answered any of your questions in A/B testing. If you are interested in more details, just go directly to the course <a href="https://www.udacity.com/course/ab-testing--ud257">here</a>.</p><h3><strong>References</strong></h3><p>[1] C. Grimes, C.Buckey and D.Tang, <a href="https://www.udacity.com/course/ab-testing--ud257">A/B Testing</a>, Udacity</p><p>[2] J.Hanington, <a href="https://www.pardot.com/blog/abcs-ab-testing/">The ABCs of A/B Testing</a> (2012), Pardot</p><p>[3] M.Elisa, <a href="https://towardsdatascience.com/gender-bias-in-admission-statistics-the-simpson-paradox-cd381d994b16">Gender Bias in Admission Statistics? The Simpson-Paradox</a> (2019), Towards Data Science</p><p>[4] G. Malinas, J. Bigelow, <a href="https://plato.stanford.edu/entries/paradox-simpson/">Simpson’s Paradox</a> (2016), Stanford Encyclopedia of Philosophy</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f937e8ea31f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/a-b-testing-101-with-examples-a-summary-of-udacitys-course-3f937e8ea31f">A/B Testing 101 with Examples - A Summary of Udacity’s Course</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[4 Key Case Interview Scenarios Summary and Checklist]]></title>
            <link>https://lanting-natalie-ding.medium.com/4-key-case-interview-scenarios-summary-and-checklist-795deb1381f?source=rss-6542d6e4059d------2</link>
            <guid isPermaLink="false">https://medium.com/p/795deb1381f</guid>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[consulting]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[case-study]]></category>
            <dc:creator><![CDATA[Lanting Natalie Ding]]></dc:creator>
            <pubDate>Fri, 13 Nov 2020 14:35:45 GMT</pubDate>
            <atom:updated>2020-11-13T15:34:24.747Z</atom:updated>
            <content:encoded><![CDATA[<p>(For key takeaways, skip directly to the mindmaps)</p><p><strong><em>Case in Point</em></strong> is one of the main resources that many graduates who look forward to building their career as consultants or analysts turn to. Among the recommendations of case interview preparations I’ve seen so far, almost all mentioned this book.</p><p><strong><em>The Ivy System</em></strong> proposed is considered as the core of this book. Although some may argue the framework will fix our mindsets as there are no universal solutions to all business problems, I still find the framework useful as it provides a logical and organised way to start. Analysts can always find some sort of certainties under uncertainties after all :)</p><p>I’ve seen some data analysts and data scientists from consulting companies recommending this book as well, and this is also the career path I’m currently building on. Personally speaking, it indeed helped an IT graduate like me to better know the analysis aspects I could possibly work on and put myself in the businesses’ shoes.</p><h3><strong>Key Takeaways:</strong></h3><p>Before looking at the scenarios, the two <strong>Common Factors </strong>shared are the <strong>Market/Industry</strong> and the <strong>Company </strong>itself:</p><p>(* Note that these factors are marked as “All the major market/company factors” in the mindmaps of each scenario)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GwyuIkmBoxnE81J48mwP6w.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZyQE--auauzGmqDJ4M-w-w.jpeg" /></figure><h3><strong>Scenario 1. Profit and Loss</strong></h3><p>Basic analysis metrics: <strong>E(P=R-C)M</strong></p><p>E: Economy</p><p>P: Profit</p><p>R: Revenues</p><p>C: Costs</p><p>M: Market or the industry</p><p>For the profit and loss scenario, we should always <strong>start by looking at external factors </strong>first to deeper understand what’s happening behind the profit and loss. The factors include:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l1FUYjV3M5LLjTl2vYyg4g.jpeg" /></figure><h3><strong>Scenario 2: Entering a New Market</strong></h3><p>For this scenario, we need to provide the answers to these questions:</p><ul><li>Do we enter?</li><li>Why do we enter?</li><li>How do we enter?</li><li>What are the advantages and disadvantages of each strategy?</li></ul><p>Unlike the profit and loss case, we go from micro to macro this time, i.e. we <strong>analyse the company first, then the market</strong>,<strong> </strong>so that we could understand the market through the company’s eyes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GfEo4XpVdB4Z5tk0xoq8yA.jpeg" /></figure><h3><strong>Scenario 3: Pricing</strong></h3><p>The first and the <strong>key </strong>step for this scenario is to <strong>understand the objectives of pricing, </strong>each of which can induce a very different strategy.</p><p>For example, the objectives of Apple’s first Ipad is for <strong>profit </strong>as there are no other competitors; while Samsung&#39;s Galaxy comes after the popular Apple products, so it was for <strong>market share</strong>; On the other hand, Amazon has built a solid foundation in e-commerce when Kindle first released, so it aimed at making more <strong>ancillary sales</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MXGGjCM_NNAfXGDHq35VYA.jpeg" /></figure><h3>Scenario 4: Growth and Increasing Sales</h3><p>Note that <strong>increasing sales ≠ increasing profit</strong></p><p>Increasing sales is more of increasing the <strong>volume </strong>and/ or <strong>revenues</strong>, we are less interested in costs in this case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rKtYdOzgWNDmDiw8ciO8kA.jpeg" /></figure><p><strong>References</strong>:</p><p><em>Case In Point</em> by Marc Cosentino</p><p>Mindmap building tools: Miro</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=795deb1381f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Simple Summary of Common Probability Distribution for TLDRers]]></title>
            <link>https://lanting-natalie-ding.medium.com/a-simple-summary-of-common-probability-distribution-for-tldrers-bfbe6bdd4201?source=rss-6542d6e4059d------2</link>
            <guid isPermaLink="false">https://medium.com/p/bfbe6bdd4201</guid>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[towards-data-science]]></category>
            <dc:creator><![CDATA[Lanting Natalie Ding]]></dc:creator>
            <pubDate>Sat, 07 Nov 2020 14:52:26 GMT</pubDate>
            <atom:updated>2020-11-07T16:27:29.939Z</atom:updated>
            <content:encoded><![CDATA[<h3>Probability Distributions: One Sentence to Tell You What They Are</h3><h3>Discrete</h3><h4><strong>1. Bernoulli</strong></h4><p>A discrete distribution with two outcomes in only 1 trial.</p><p>Eg. head or tails, success or failure, 0 or 1</p><p>Bernoulli distribution with n total trials is the building block of:</p><p>1.1 <strong>Binomial distribution</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/349/1*__qgC4nCXSP141P1pSk2XA.jpeg" /></figure><p>The probability of x successes within this total number of trials.</p><p><strong>1.2 Geometric distribution</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/345/1*qEmjCoziGFNNBytuY1u4DA.jpeg" /></figure><p>The number of failures required before the first success occurs.</p><p><strong>1.3 Negative binomial distribution</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/367/1*rlj4DzNbZX8dA1AkkbLiAQ.jpeg" /></figure><p>The number of failures r before the xth success occurs.</p><p><strong>2. Poisson</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/359/1*PflBzcPKjn2anhkCB9aXaA.jpeg" /></figure><p>The number of times an event occurs in a given interval.</p><p>Eg. The hourly number of accesses to a particular webserver</p><p>(It approaches the normal distribution as the rate parameter increases)</p><h3>Continuous</h3><ol><li><strong>Normal Distribution</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/1*STfY7xitM3kFqdwekcHLyg.jpeg" /></figure><p>Often used in the natural and social sciences to represent real-valued random variables whose distributions are not known.</p><p>Eg. Height of 18-year-old girls</p><p><strong>2. Chi-Square Distribution</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/342/1*0Rw--HmP5as6mZe5VLd9qQ.jpeg" /></figure><p>Distribution of the sum of squares of normally-distributed values.</p><p>Eg. Often used in hypothesis testing for the goodness of fit of an observed distribution to a theoretical one</p><p><strong>3. Student’s T Distribution</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/323/1*ANz1vcK_AWT570bSmXevKA.jpeg" /></figure><p>Used to estimate the mean of a normally distributed population when the sample size is small.</p><p>Eg. Often for testing the statistical significance of the difference between two sample means or confidence intervals for small sample sizes.</p><p><strong>4. Exponential Distribution</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/415/1*FzVBrbxaOp40NhoOMOfRUQ.png" /></figure><p>Often used to describe events recurring at random points in time.</p><p>Eg. The time between failures of electronic equipment</p><p><strong>5. Gamma Distribution (Erlang Distribution)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/341/1*ENqZspbnMqEEqnLOqlvPBA.jpeg" /></figure><p>Most often used as the distribution of the amount of time until the xth occurrence of an event in a Poisson process.</p><p><strong>6. Beta Distribution</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/1*NPCVbKhsb4_k5JO3ELGa1Q.jpeg" /></figure><p>Commonly used to represent the uncertainty in the probability of occurrence of an event;</p><p>Or as a conjugate distribution for the parameter of a Bernoulli distribution.</p><p>Eg. How likely it is that Biden will receive 50% of the vote</p><p>____________________________________________________________</p><p>For the detailed relations between these distributions, please refer to the blog by <a href="https://medium.com/@srowen/common-probability-distributions-347e6b945ce4">Sean Owen</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*fKTzxvZ-pbya34KHuBsz9w.png" /></figure><p>____________________________________________________________</p><p>References:</p><ol><li>Chapter 3 <a href="https://onlinelibrary.wiley.com/doi/pdf/10.1002/9781119197096.app03">Understanding and Choosing the Right Probability Distributions </a>of <em>Advanced Analytical Models: Over 800 Models and 300 Applications from the Basel II Accord to Wall Street and Beyond</em></li><li><a href="https://personal.utdallas.edu/~scniu/OPRE-6301/documents/Important_Probability_Distributions.pdf">Important Probability Distributions</a></li><li><a href="https://www.adrian.idv.hk/2018-03-19-distribution/">Distribution Plots</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bfbe6bdd4201" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>