import React, {useEffect, useState} from 'react'; import BrowserOnly from '@docusaurus/BrowserOnly'; import clsx from 'clsx'; import styles from './styles.module.css'; const AD_REFRESH_RATE = 20 * 1000; const BACKGROUNDS = [ styles.backgroundPurplin, styles.backgroundFirewatch, styles.backgroundLush, styles.backgroundSweetMorning, styles.backgroundViceCity, styles.backgroundRadar, styles.backgroundCosmicFusion, styles.backgroundAzurePop, styles.backgroundTranquil, ]; function FAANGTechLeads({className, position}) { return ( { window.gtag('event', `faangtechleads.${position}.click`); }}>

Craft the perfect resume for FAANG Save time crafting your resume with FAANG Tech Leads'{' '} FAANG-quality resume templates and examples which have helped many Software Engineers get interviews at top Bay Area companies. Grab them now for a whopping 70% off!

); } function AlgoMonster({className, position}) { return ( { window.gtag('event', `algomonster.${position}.click`); }}>

Stop grinding. Study with a plan Developed by Google engineers, AlgoMonster is the fastest way to get a software engineering job. Join today for a 70% discount!

); } function Moonchaser({className, position}) { return ( { window.gtag('event', `moonchaser.${position}.click`); }}>

Get paid more. Receive risk-free salary negotiation advice from Moonchaser. You pay nothing unless your offer is increased.{' '} Book a free consultation today!

); } function EducativeCoding({className, position}) { return ( { window.gtag('event', `educative.coding.${position}.click`); }}>

Get the job at FAANG Grokking the Coding Interview teaches you techniques and question patterns to be good at coding interviews.{' '} Get your 10% discount now!

); } function EducativeSystemDesign({className, position}) { return ( { window.gtag('event', `educative.system_design.${position}.click`); }}>

Get the job at FAANG Grokking the System Design Interview is a highly recommended course to get better at system design interviews.{' '} Join today for a 10% discount!

); } export default React.memo(function SidebarAd({position}) { const [counter, setCounter] = useState(0); useEffect(() => { const timer = setTimeout(() => { setCounter((counter) => counter + 1); }, AD_REFRESH_RATE); return () => clearTimeout(timer); }, [counter]); const backgroundClass = BACKGROUNDS[Math.floor(Math.random() * BACKGROUNDS.length)]; // Because the SSR and client output can differ and hydration doesn't patch attribute differences, // we'll render this on the browser only. return ( {() => { const path = window.location.pathname; // Ugly hack to show conditional sidebar content. if (path.includes('resume')) { return ( ); } if (path.includes('negotiation') || path.includes('compensation')) { return ( ); } if ( path.includes('coding') || path.includes('best-practice-questions') || path.includes('cheatsheet') || path.includes('mock-interviews') || path.includes('algorithms') ) { return Math.random() > 0.5 ? ( ) : ( ); } if (path.includes('system-design')) { return ( ); } return Math.random() > 0.5 ? ( ) : ( ); }} ); });