mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2025-07-03 23:05:27 +08:00
website: change formatting
This commit is contained in:
@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"bracketSpacing": false,
|
"bracketSameLine": true,
|
||||||
"jsxBracketSameLine": true,
|
|
||||||
"printWidth": 80,
|
"printWidth": 80,
|
||||||
"proseWrap": "never",
|
"proseWrap": "never",
|
||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
|
@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
|
|
||||||
import QuestionGroups from './QuestionGroups.json';
|
import QuestionGroups from './QuestionGroups.json';
|
||||||
|
|
||||||
function DifficultyLabel({difficulty}) {
|
function DifficultyLabel({ difficulty }) {
|
||||||
return (
|
return (
|
||||||
<span
|
<span
|
||||||
style={{
|
style={{
|
||||||
|
@ -130,14 +130,14 @@ Depending on where the pricing data comes from, one possible variation of the ta
|
|||||||
```javascript
|
```javascript
|
||||||
// config.js
|
// config.js
|
||||||
export const priceByRanges = [
|
export const priceByRanges = [
|
||||||
{min: 1, max: 5, price: '5'},
|
{ min: 1, max: 5, price: '5' },
|
||||||
{min: 6, max: 10, price: '4'},
|
{ min: 6, max: 10, price: '4' },
|
||||||
{min: 11, max: 20, price: '3'},
|
{ min: 11, max: 20, price: '3' },
|
||||||
{min: 21, max: Number.MAX_SAFE_INTEGER, price: '2.5'},
|
{ min: 21, max: Number.MAX_SAFE_INTEGER, price: '2.5' },
|
||||||
];
|
];
|
||||||
|
|
||||||
// app.js
|
// app.js
|
||||||
import {priceByRanges} from './config.js';
|
import { priceByRanges } from './config.js';
|
||||||
|
|
||||||
function getPrice(amount) {
|
function getPrice(amount) {
|
||||||
// error handling for amount outside the range
|
// error handling for amount outside the range
|
||||||
@ -155,10 +155,10 @@ If the array `priceByRanges` is always sorted in terms of the price ranges, we c
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const priceByRanges = [
|
const priceByRanges = [
|
||||||
{min: 1, max: 5, price: '5'},
|
{ min: 1, max: 5, price: '5' },
|
||||||
{min: 6, max: 10, price: '4'},
|
{ min: 6, max: 10, price: '4' },
|
||||||
{min: 11, max: 20, price: '3'},
|
{ min: 11, max: 20, price: '3' },
|
||||||
{min: 21, max: Number.MAX_SAFE_INTEGER, price: '2.5'},
|
{ min: 21, max: Number.MAX_SAFE_INTEGER, price: '2.5' },
|
||||||
];
|
];
|
||||||
|
|
||||||
function getPrice(amount) {
|
function getPrice(amount) {
|
||||||
|
@ -40,7 +40,7 @@ module.exports = {
|
|||||||
label: 'Algorithms',
|
label: 'Algorithms',
|
||||||
href: '/algorithms/study-cheatsheet',
|
href: '/algorithms/study-cheatsheet',
|
||||||
},
|
},
|
||||||
{label: 'Blog', to: 'blog', position: 'left'},
|
{ label: 'Blog', to: 'blog', position: 'left' },
|
||||||
{
|
{
|
||||||
label: 'Grind 75',
|
label: 'Grind 75',
|
||||||
href: 'https://www.techinterviewhandbook.org/grind75',
|
href: 'https://www.techinterviewhandbook.org/grind75',
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import React, {useEffect, useState} from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import BrowserOnly from '@docusaurus/BrowserOnly';
|
import BrowserOnly from '@docusaurus/BrowserOnly';
|
||||||
|
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
@ -7,7 +7,7 @@ import styles from './styles.module.css';
|
|||||||
|
|
||||||
const AD_REFRESH_RATE = 20 * 1000;
|
const AD_REFRESH_RATE = 20 * 1000;
|
||||||
|
|
||||||
function FAANGTechLeads({position}) {
|
function FAANGTechLeads({ position }) {
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
className={clsx(styles.container, styles.backgroundFTL)}
|
className={clsx(styles.container, styles.backgroundFTL)}
|
||||||
@ -29,7 +29,7 @@ function FAANGTechLeads({position}) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function AlgoMonster({position}) {
|
function AlgoMonster({ position }) {
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
className={clsx(styles.container, styles.backgroundAlgoMonster)}
|
className={clsx(styles.container, styles.backgroundAlgoMonster)}
|
||||||
@ -50,7 +50,7 @@ function AlgoMonster({position}) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function Moonchaser({position}) {
|
function Moonchaser({ position }) {
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
className={clsx(styles.container, styles.backgroundMoonchaser)}
|
className={clsx(styles.container, styles.backgroundMoonchaser)}
|
||||||
@ -73,7 +73,7 @@ function Moonchaser({position}) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function DesignGurusCoding({position}) {
|
function DesignGurusCoding({ position }) {
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
className={clsx(styles.container, styles.backgroundGrokkingCoding)}
|
className={clsx(styles.container, styles.backgroundGrokkingCoding)}
|
||||||
@ -93,7 +93,7 @@ function DesignGurusCoding({position}) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function DesignGurusSystemDesign({position}) {
|
function DesignGurusSystemDesign({ position }) {
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
className={clsx(styles.container, styles.backgroundGrokkingSystemDesign)}
|
className={clsx(styles.container, styles.backgroundGrokkingSystemDesign)}
|
||||||
@ -113,7 +113,7 @@ function DesignGurusSystemDesign({position}) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function ByteByteGoSystemDesign({position}) {
|
function ByteByteGoSystemDesign({ position }) {
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
className={clsx(styles.container, styles.backgroundByteByteGo)}
|
className={clsx(styles.container, styles.backgroundByteByteGo)}
|
||||||
@ -136,7 +136,7 @@ function ByteByteGoSystemDesign({position}) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function Interviewingio({position}) {
|
function Interviewingio({ position }) {
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
className={clsx(styles.container, styles.backgroundInterviewingio)}
|
className={clsx(styles.container, styles.backgroundInterviewingio)}
|
||||||
@ -159,7 +159,7 @@ function Interviewingio({position}) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default React.memo(function SidebarAd({position}) {
|
export default React.memo(function SidebarAd({ position }) {
|
||||||
const [counter, setCounter] = useState(0);
|
const [counter, setCounter] = useState(0);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const timer = setTimeout(() => {
|
const timer = setTimeout(() => {
|
||||||
|
@ -157,10 +157,10 @@ export default [
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer noopener">
|
rel="noreferrer noopener">
|
||||||
Grind 75 Tool
|
Grind 75 Tool
|
||||||
</a>,
|
</a>
|
||||||
which provides customisable coding interview study plans. This not only
|
, which provides customisable coding interview study plans. This not
|
||||||
helped to sharpen my problem-solving skills, but also assured me that
|
only helped to sharpen my problem-solving skills, but also assured me
|
||||||
I covered sufficient breadth and depth.
|
that I covered sufficient breadth and depth.
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
Even now, after interviewing for a couple of years, I still go back to
|
Even now, after interviewing for a couple of years, I still go back to
|
||||||
|
@ -79,7 +79,7 @@ const FEATURES = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
function Tweet({url, handle, name, content, avatar, date}) {
|
function Tweet({ url, handle, name, content, avatar, date }) {
|
||||||
return (
|
return (
|
||||||
<div className={clsx('card', styles.tweet)}>
|
<div className={clsx('card', styles.tweet)}>
|
||||||
<div className="card__header">
|
<div className="card__header">
|
||||||
@ -104,7 +104,7 @@ function Tweet({url, handle, name, content, avatar, date}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Home() {
|
function Home() {
|
||||||
const {siteConfig = {}} = useDocusaurusContext();
|
const { siteConfig = {} } = useDocusaurusContext();
|
||||||
return (
|
return (
|
||||||
<Layout
|
<Layout
|
||||||
title="Technical Interview Guide for Busy Engineers"
|
title="Technical Interview Guide for Busy Engineers"
|
||||||
@ -125,7 +125,7 @@ function Home() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function HeroSection() {
|
function HeroSection() {
|
||||||
const {siteConfig = {}} = useDocusaurusContext();
|
const { siteConfig = {} } = useDocusaurusContext();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<header className={clsx('hero', styles.heroBanner)}>
|
<header className={clsx('hero', styles.heroBanner)}>
|
||||||
@ -150,7 +150,7 @@ function HeroSection() {
|
|||||||
Start reading now →
|
Start reading now →
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<p className="margin-top--md" style={{fontSize: 16, fontWeight: 600}}>
|
<p className="margin-top--md" style={{ fontSize: 16, fontWeight: 600 }}>
|
||||||
Or check out our{' '}
|
Or check out our{' '}
|
||||||
<a href="https://www.frontendinterviewhandbook.com">
|
<a href="https://www.frontendinterviewhandbook.com">
|
||||||
Front End Interview Handbook
|
Front End Interview Handbook
|
||||||
@ -263,7 +263,7 @@ function MoonchaserSection() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function HowToUseStep({index, title, ctaLink, contents}) {
|
function HowToUseStep({ index, title, ctaLink, contents }) {
|
||||||
return (
|
return (
|
||||||
<div className={clsx('card', styles.howToUseStep)}>
|
<div className={clsx('card', styles.howToUseStep)}>
|
||||||
<div className="card__header">
|
<div className="card__header">
|
||||||
@ -395,7 +395,7 @@ function FeaturesSection() {
|
|||||||
We have everything you need - all straight to the point
|
We have everything you need - all straight to the point
|
||||||
</h3>
|
</h3>
|
||||||
<div className={clsx('row', styles.featuresRow)}>
|
<div className={clsx('row', styles.featuresRow)}>
|
||||||
{FEATURES.map(({title, description, link}, idx) => (
|
{FEATURES.map(({ title, description, link }, idx) => (
|
||||||
<div
|
<div
|
||||||
key={idx}
|
key={idx}
|
||||||
className={clsx(
|
className={clsx(
|
||||||
@ -428,13 +428,13 @@ function DesignGurusSection() {
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={clsx('padding-vert--lg')}
|
className={clsx('padding-vert--lg')}
|
||||||
style={{backgroundColor: '#6fc8cc'}}>
|
style={{ backgroundColor: '#6fc8cc' }}>
|
||||||
<div className="container">
|
<div className="container">
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col col--8 col--offset-2">
|
<div className="col col--8 col--offset-2">
|
||||||
<div className="margin-vert--lg text--center">
|
<div className="margin-vert--lg text--center">
|
||||||
<div>
|
<div>
|
||||||
<h2 style={{color: '#083436'}}>
|
<h2 style={{ color: '#083436' }}>
|
||||||
<strong>
|
<strong>
|
||||||
Tired of grinding mindlessly? Grokking the Coding Interview
|
Tired of grinding mindlessly? Grokking the Coding Interview
|
||||||
is the recommended way to quickly learn coding question
|
is the recommended way to quickly learn coding question
|
||||||
@ -466,7 +466,7 @@ function FAANGTechLeadsSection() {
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={clsx('padding-vert--lg')}
|
className={clsx('padding-vert--lg')}
|
||||||
style={{backgroundColor: 'rgb(244, 63, 94)'}}>
|
style={{ backgroundColor: 'rgb(244, 63, 94)' }}>
|
||||||
<div className="container">
|
<div className="container">
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col col--8 col--offset-2">
|
<div className="col col--8 col--offset-2">
|
||||||
@ -503,7 +503,7 @@ function AlgoMonsterSection() {
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={clsx('padding-vert--lg')}
|
className={clsx('padding-vert--lg')}
|
||||||
style={{backgroundImage: 'linear-gradient(270deg, #3e1792, #6a45b9)'}}>
|
style={{ backgroundImage: 'linear-gradient(270deg, #3e1792, #6a45b9)' }}>
|
||||||
<div className="container">
|
<div className="container">
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col col--8 col--offset-2">
|
<div className="col col--8 col--offset-2">
|
||||||
@ -712,7 +712,7 @@ function TweetsSection() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function SuccessStory({name, quote, thumbnail, title}) {
|
function SuccessStory({ name, quote, thumbnail, title }) {
|
||||||
return (
|
return (
|
||||||
<div className="card margin-vert--lg">
|
<div className="card margin-vert--lg">
|
||||||
<div className="card__body">
|
<div className="card__body">
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {ThemeClassNames} from '@docusaurus/theme-common';
|
import { ThemeClassNames } from '@docusaurus/theme-common';
|
||||||
import {useDoc} from '@docusaurus/theme-common/internal';
|
import { useDoc } from '@docusaurus/theme-common/internal';
|
||||||
import Heading from '@theme/Heading';
|
import Heading from '@theme/Heading';
|
||||||
import MDXContent from '@theme/MDXContent';
|
import MDXContent from '@theme/MDXContent';
|
||||||
/**
|
/**
|
||||||
@ -15,7 +15,7 @@ import MDXContent from '@theme/MDXContent';
|
|||||||
- the markdown content does not already contain a top-level h1 heading
|
- the markdown content does not already contain a top-level h1 heading
|
||||||
*/
|
*/
|
||||||
function useSyntheticTitle() {
|
function useSyntheticTitle() {
|
||||||
const {metadata, frontMatter, contentTitle} = useDoc();
|
const { metadata, frontMatter, contentTitle } = useDoc();
|
||||||
const shouldRender =
|
const shouldRender =
|
||||||
!frontMatter.hide_title && typeof contentTitle === 'undefined';
|
!frontMatter.hide_title && typeof contentTitle === 'undefined';
|
||||||
if (!shouldRender) {
|
if (!shouldRender) {
|
||||||
@ -23,7 +23,7 @@ function useSyntheticTitle() {
|
|||||||
}
|
}
|
||||||
return metadata.title;
|
return metadata.title;
|
||||||
}
|
}
|
||||||
export default function DocItemContent({children}) {
|
export default function DocItemContent({ children }) {
|
||||||
const syntheticTitle = useSyntheticTitle();
|
const syntheticTitle = useSyntheticTitle();
|
||||||
return (
|
return (
|
||||||
<div className={clsx(ThemeClassNames.docs.docMarkdown, 'markdown')}>
|
<div className={clsx(ThemeClassNames.docs.docMarkdown, 'markdown')}>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import {useWindowSize} from '@docusaurus/theme-common';
|
import { useWindowSize } from '@docusaurus/theme-common';
|
||||||
import {useDoc} from '@docusaurus/theme-common/internal';
|
import { useDoc } from '@docusaurus/theme-common/internal';
|
||||||
import DocItemPaginator from '@theme/DocItem/Paginator';
|
import DocItemPaginator from '@theme/DocItem/Paginator';
|
||||||
import DocVersionBanner from '@theme/DocVersionBanner';
|
import DocVersionBanner from '@theme/DocVersionBanner';
|
||||||
import DocVersionBadge from '@theme/DocVersionBadge';
|
import DocVersionBadge from '@theme/DocVersionBadge';
|
||||||
@ -17,7 +17,7 @@ import SidebarAd from '../../../components/SidebarAd';
|
|||||||
* Decide if the toc should be rendered, on mobile or desktop viewports
|
* Decide if the toc should be rendered, on mobile or desktop viewports
|
||||||
*/
|
*/
|
||||||
function useDocTOC() {
|
function useDocTOC() {
|
||||||
const {frontMatter, toc} = useDoc();
|
const { frontMatter, toc } = useDoc();
|
||||||
const windowSize = useWindowSize();
|
const windowSize = useWindowSize();
|
||||||
const hidden = frontMatter.hide_table_of_contents;
|
const hidden = frontMatter.hide_table_of_contents;
|
||||||
const canRender = !hidden && toc.length > 0;
|
const canRender = !hidden && toc.length > 0;
|
||||||
@ -32,7 +32,7 @@ function useDocTOC() {
|
|||||||
desktop,
|
desktop,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
export default function DocItemLayout({children}) {
|
export default function DocItemLayout({ children }) {
|
||||||
const docTOC = useDocTOC();
|
const docTOC = useDocTOC();
|
||||||
return (
|
return (
|
||||||
<div className="row">
|
<div className="row">
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import type {Props} from '@theme/DocSidebar/Mobile';
|
import type { Props } from '@theme/DocSidebar/Mobile';
|
||||||
declare function DocSidebarMobile(props: Props): JSX.Element;
|
declare function DocSidebarMobile(props: Props): JSX.Element;
|
||||||
declare const _default: React.MemoExoticComponent<typeof DocSidebarMobile>;
|
declare const _default: React.MemoExoticComponent<typeof DocSidebarMobile>;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
@ -4,11 +4,11 @@ import {
|
|||||||
NavbarSecondaryMenuFiller,
|
NavbarSecondaryMenuFiller,
|
||||||
ThemeClassNames,
|
ThemeClassNames,
|
||||||
} from '@docusaurus/theme-common';
|
} from '@docusaurus/theme-common';
|
||||||
import {useNavbarMobileSidebar} from '@docusaurus/theme-common/internal';
|
import { useNavbarMobileSidebar } from '@docusaurus/theme-common/internal';
|
||||||
import DocSidebarItems from '@theme/DocSidebarItems';
|
import DocSidebarItems from '@theme/DocSidebarItems';
|
||||||
import SidebarAd from '../../../components/SidebarAd';
|
import SidebarAd from '../../../components/SidebarAd';
|
||||||
// eslint-disable-next-line react/function-component-definition
|
// eslint-disable-next-line react/function-component-definition
|
||||||
const DocSidebarMobileSecondaryMenu = ({sidebar, path}) => {
|
const DocSidebarMobileSecondaryMenu = ({ sidebar, path }) => {
|
||||||
const mobileSidebar = useNavbarMobileSidebar();
|
const mobileSidebar = useNavbarMobileSidebar();
|
||||||
return (
|
return (
|
||||||
<ul className={clsx(ThemeClassNames.docs.docSidebarMenu, 'menu__list')}>
|
<ul className={clsx(ThemeClassNames.docs.docSidebarMenu, 'menu__list')}>
|
||||||
|
@ -8,7 +8,7 @@ import SidebarAd from '../../components/SidebarAd';
|
|||||||
const LINK_CLASS_NAME = 'table-of-contents__link toc-highlight';
|
const LINK_CLASS_NAME = 'table-of-contents__link toc-highlight';
|
||||||
const LINK_ACTIVE_CLASS_NAME = 'table-of-contents__link--active';
|
const LINK_ACTIVE_CLASS_NAME = 'table-of-contents__link--active';
|
||||||
|
|
||||||
function TOC({className, ...props}) {
|
function TOC({ className, ...props }) {
|
||||||
return (
|
return (
|
||||||
<div className={clsx(styles.tableOfContents, 'thin-scrollbar', className)}>
|
<div className={clsx(styles.tableOfContents, 'thin-scrollbar', className)}>
|
||||||
<div className="margin--md">
|
<div className="margin--md">
|
||||||
|
Reference in New Issue
Block a user