Programming exercises with solutions
Solve a problem, press Submit, and every test runs right in your browser. Solved problems are remembered on this device.
- ○Say hello in HTMLHTML and CSSWhat HTML is and how a browser reads itEasy
- ○Repair the overlapping tagsHTML and CSSWhat HTML is and how a browser reads itMedium
- ○Mark up a short articleHTML and CSSWhat HTML is and how a browser reads itHard
- ○Build the frameHTML and CSSThe skeleton of every pageEasy
- ○Put things where they belongHTML and CSSThe skeleton of every pageMedium
- ○Make a page ready for the worldHTML and CSSThe skeleton of every pageHard
- ○Outline a recipeHTML and CSSHeadings, paragraphs and textEasy
- ○An address and a formulaHTML and CSSHeadings, paragraphs and textMedium
- ○Repair a broken outlineHTML and CSSHeadings, paragraphs and textHard
- ○Make your first linksHTML and CSSLinks and how pages connectEasy
- ○A table of contentsHTML and CSSLinks and how pages connectMedium
- ○Audit a page of bad linksHTML and CSSLinks and how pages connectHard
- ○Add a picture properlyHTML and CSSImages and why alt text mattersEasy
- ○A photo with a captionHTML and CSSImages and why alt text mattersMedium
- ○Decide what each image needsHTML and CSSImages and why alt text mattersHard
- ○A shopping listHTML and CSSLists for steps, items and definitionsEasy
- ○Steps that continue from earlierHTML and CSSLists for steps, items and definitionsMedium
- ○A menu with a submenuHTML and CSSLists for steps, items and definitionsHard
- ○A small price tableHTML and CSSTables for data that has rows and columnsEasy
- ○Make a table readable by everyoneHTML and CSSTables for data that has rows and columnsMedium
- ○A timetable with merged cellsHTML and CSSTables for data that has rows and columnsHard
- ○A newsletter formHTML and CSSForms: asking the user for informationEasy
- ○A search form with a filterHTML and CSSForms: asking the user for informationMedium
- ○Find everything wrong with a sign-up formHTML and CSSForms: asking the user for informationHard
- ○Choose the input typesHTML and CSSThe right control for each questionEasy
- ○A question with one answerHTML and CSSThe right control for each questionMedium
- ○A complete order formHTML and CSSThe right control for each questionHard
- ○Make the fields requiredHTML and CSSChecking answers before they are sentEasy
- ○Only accept a valid codeHTML and CSSChecking answers before they are sentMedium
- ○A booking form with real rulesHTML and CSSChecking answers before they are sentHard
- ○Replace divs with landmarksHTML and CSSSemantic HTML: elements that mean somethingEasy
- ○Structure a blog postHTML and CSSSemantic HTML: elements that mean somethingMedium
- ○Rebuild a page of fakesHTML and CSSSemantic HTML: elements that mean somethingHard
- ○Three quick accessibility fixesHTML and CSSAccessibility: pages that work for everyoneEasy
- ○Add a skip linkHTML and CSSAccessibility: pages that work for everyoneMedium
- ○Audit an inaccessible pageHTML and CSSAccessibility: pages that work for everyoneHard
- ○Add a playable audio fileHTML and CSSAudio, video and embedded pagesEasy
- ○A video that everyone can followHTML and CSSAudio, video and embedded pagesMedium
- ○Embed a page safelyHTML and CSSAudio, video and embedded pagesHard
- ○Write a title and a descriptionHTML and CSSThe head: titles, search results and sharingEasy
- ○Make a link look good when sharedHTML and CSSThe head: titles, search results and sharingMedium
- ○Write a complete head from nothingHTML and CSSThe head: titles, search results and sharingHard
- ○Classes and an idHTML and CSSGlobal attributes and custom dataEasy
- ○Store details in data attributesHTML and CSSGlobal attributes and custom dataMedium
- ○Untangle a messy pageHTML and CSSGlobal attributes and custom dataHard
- ○A collapsible answerHTML and CSSBuilt-in interactive elementsEasy
- ○Progress or meter?HTML and CSSBuilt-in interactive elementsMedium
- ○An accordion and a templateHTML and CSSBuilt-in interactive elementsHard
- ○Your first two rulesHTML and CSSWhat CSS is and how it reaches a pageEasy
- ○Move inline styles into a stylesheetHTML and CSSWhat CSS is and how it reaches a pageMedium
- ○Repair a broken stylesheetHTML and CSSWhat CSS is and how it reaches a pageHard
- ○Classes and groupsHTML and CSSSelectors: choosing what to styleEasy
- ○Style by relationshipHTML and CSSSelectors: choosing what to styleMedium
- ○Style a form and links by attributeHTML and CSSSelectors: choosing what to styleHard
- ○Predict and fix the winnerHTML and CSSThe cascade, specificity and inheritanceEasy
- ○Win without !importantHTML and CSSThe cascade, specificity and inheritanceMedium
- ○Let inheritance do the workHTML and CSSThe cascade, specificity and inheritanceHard
- ○One colour, three waysHTML and CSSColours, units and valuesEasy
- ○A scale that follows the readerHTML and CSSColours, units and valuesMedium
- ○Fill the space with calcHTML and CSSColours, units and valuesHard
- ○Padding, border and marginHTML and CSSThe box modelEasy
- ○Make the sizes add upHTML and CSSThe box modelMedium
- ○A centred, readable articleHTML and CSSThe box modelHard
- ○Set the page's fontsHTML and CSSText and fontsEasy
- ○Make an article comfortable to readHTML and CSSText and fontsMedium
- ○Load a web font properlyHTML and CSSText and fontsHard
- ○A soft, rounded cardHTML and CSSBackgrounds, borders and shadowsEasy
- ○A gradient heroHTML and CSSBackgrounds, borders and shadowsMedium
- ○Avatars, pills and layered shadowsHTML and CSSBackgrounds, borders and shadowsHard
- ○Turn a list into a menuHTML and CSSDisplay and normal flowEasy
- ○Hide each thing correctlyHTML and CSSDisplay and normal flowMedium
- ○Wrap text around a photoHTML and CSSDisplay and normal flowHard
- ○A row of buttonsHTML and CSSFlexbox: laying things out in a lineEasy
- ○Centre anythingHTML and CSSFlexbox: laying things out in a lineMedium
- ○A navigation bar and a wrapping card rowHTML and CSSFlexbox: laying things out in a lineHard
- ○Three equal columnsHTML and CSSGrid: laying things out in two dimensionsEasy
- ○A featured item that spansHTML and CSSGrid: laying things out in two dimensionsMedium
- ○A whole page in named areasHTML and CSSGrid: laying things out in two dimensionsHard
- ○Pin a badge to a cornerHTML and CSSPositioning and stackingEasy
- ○A header that stays visibleHTML and CSSPositioning and stackingMedium
- ○A full-screen overlayHTML and CSSPositioning and stackingHard
- ○Hover and focus togetherHTML and CSSPseudo-classes and pseudo-elementsEasy
- ○A striped table with a clean listHTML and CSSPseudo-classes and pseudo-elementsMedium
- ○Decoration and parent selectionHTML and CSSPseudo-classes and pseudo-elementsHard
- ○One colour in one placeHTML and CSSCustom properties (CSS variables)Easy
- ○Override a variable for a sectionHTML and CSSCustom properties (CSS variables)Medium
- ○A theme you can switch with one attributeHTML and CSSCustom properties (CSS variables)Hard
- ○Stop images from overflowingHTML and CSSResponsive design basicsEasy
- ○A mobile-first layoutHTML and CSSResponsive design basicsMedium
- ○Layouts and text that adapt with no queriesHTML and CSSResponsive design basicsHard
- ○A smooth colour changeHTML and CSSTransitions, transforms and animationsEasy
- ○A card that liftsHTML and CSSTransitions, transforms and animationsMedium
- ○A loading spinner that respects your visitorsHTML and CSSTransitions, transforms and animationsHard
- ○A small resetHTML and CSSKeeping CSS maintainableEasy
- ○Rename to BEMHTML and CSSKeeping CSS maintainableMedium
- ○Control priority with layersHTML and CSSKeeping CSS maintainableHard
- ○Greet the userJavaScriptJavaScript and the webEasy
- ○One line of a receiptJavaScriptJavaScript and the webMedium
- ○Days, hours and minutesJavaScriptJavaScript and the webHard
- ○Number or text?JavaScriptValues, variables and typesEasy
- ○Celsius to FahrenheitJavaScriptValues, variables and typesMedium
- ○A careful adderJavaScriptValues, variables and typesHard
- ○Even, odd or zeroJavaScriptDecisions: if, else and switchEasy
- ○Leap yearJavaScriptDecisions: if, else and switchMedium
- ○Cinema ticket priceJavaScriptDecisions: if, else and switchHard
- ○FizzBuzzJavaScriptLoopsEasy
- ○Steps to reach oneJavaScriptLoopsMedium
- ○All the primes up to nJavaScriptLoopsHard
- ○Initials from a nameJavaScriptWorking with text and numbersEasy
- ○Title CaseJavaScriptWorking with text and numbersMedium
- ○A Caesar cipherJavaScriptWorking with text and numbersHard
- ○Reverse the wordsJavaScriptFunctions and the call stackEasy
- ○Greatest common divisorJavaScriptFunctions and the call stackMedium
- ○The Towers of HanoiJavaScriptFunctions and the call stackHard
- ○The largest number and where it isJavaScriptArraysEasy
- ○Rotate a listJavaScriptArraysMedium
- ○Merge two sorted listsJavaScriptArraysHard
- ○A student recordJavaScriptObjectsEasy
- ○Count the wordsJavaScriptObjectsMedium
- ○A shop's stockJavaScriptObjectsHard
- ○Squares of the even numbersJavaScriptArray methods: forEach, map, filter and reduceEasy
- ○Total of an orderJavaScriptArray methods: forEach, map, filter and reduceMedium
- ○Group students by gradeJavaScriptArray methods: forEach, map, filter and reduceHard
- ○First, last and the middleJavaScriptDestructuring, spread and safe accessEasy
- ○Settings with defaultsJavaScriptDestructuring, spread and safe accessMedium
- ○Reading a path through dataJavaScriptDestructuring, spread and safe accessHard
- ○Remove the repeatsJavaScriptMaps and SetsEasy
- ○The first repeated wordJavaScriptMaps and SetsMedium
- ○Group the anagramsJavaScriptMaps and SetsHard
- ○A function that makes functionsJavaScriptScope and closuresEasy
- ○Named counters with closuresJavaScriptScope and closuresMedium
- ○Remember the answersJavaScriptScope and closuresHard
- ○A Rectangle classJavaScriptClasses and prototypesEasy
- ○A bank account classJavaScriptClasses and prototypesMedium
- ○A family of shapesJavaScriptClasses and prototypesHard
- ○Dividing safelyJavaScriptErrors: throw, try and catchEasy
- ○Read JSON safelyJavaScriptErrors: throw, try and catchMedium
- ○Validating recordsJavaScriptErrors: throw, try and catchHard
- ○One job at a timeJavaScriptAsynchronous JavaScript: event loop, promises, async/awaitEasy
- ○Which timer fires first?JavaScriptAsynchronous JavaScript: event loop, promises, async/awaitMedium
- ○Try again when it failsJavaScriptAsynchronous JavaScript: event loop, promises, async/awaitHard
- ○A private scoreJavaScriptModules: splitting a program into filesEasy
- ○A shopping cart moduleJavaScriptModules: splitting a program into filesMedium
- ○A tiny module loaderJavaScriptModules: splitting a program into filesHard
- ○A profile cardHTML and CSSHTML and CSSEasy
- ○Ready for a scriptHTML and CSSHTML and CSSMedium
- ○A toolbar with statesHTML and CSSHTML and CSSHard
- ○Change the page from a scriptJavaScriptThe DOM: changing the page with JavaScriptEasy
- ○A list built from dataJavaScriptThe DOM: changing the page with JavaScriptMedium
- ○A report tableJavaScriptThe DOM: changing the page with JavaScriptHard
- ○A click counterJavaScriptEvents and formsEasy
- ○Check a form before accepting itJavaScriptEvents and formsMedium
- ○A to-do list with delegationJavaScriptEvents and formsHard
- ○Show data from a serverJavaScriptFetching data and saving itEasy
- ○Loading and error statesJavaScriptFetching data and saving itMedium
- ○Notes that are rememberedJavaScriptFetching data and saving itHard
- ○C++: Greet someoneC++Your first C++ programEasy
- ○C++: Two numbersC++Your first C++ programMedium
- ○C++: A profile cardC++Your first C++ programHard
- ○C++: Area of a rectangleC++Variables and types in C++Easy
- ○C++: An exact averageC++Variables and types in C++Medium
- ○C++: Counting coinsC++Variables and types in C++Hard
- ○C++: A whole lineC++Input and output in depthEasy
- ○C++: A price lineC++Input and output in depthMedium
- ○C++: Read to the endC++Input and output in depthHard
- ○C++: Sum of the even numbersC++Decisions and loopsEasy
- ○C++: Grades with switchC++Decisions and loopsMedium
- ○C++: A number pyramidC++Decisions and loopsHard
- ○C++: A function that answers yes or noC++Functions in C++Easy
- ○C++: Overloaded largestC++Functions in C++Medium
- ○C++: Fast powerC++Functions in C++Hard
- ○C++: Change it through a referenceC++ReferencesEasy
- ○C++: Two answers through referencesC++ReferencesMedium
- ○C++: Tidy a list of wordsC++ReferencesHard
- ○C++: Count a letterC++The string classEasy
- ○C++: Title CaseC++The string classMedium
- ○C++: Words in a lineC++The string classHard
- ○C++: Sum and averageC++VectorsEasy
- ○C++: Remove the even numbersC++VectorsMedium
- ○C++: Rotate a tableC++VectorsHard
- ○C++: Change it through a pointerC++Pointers and memoryEasy
- ○C++: An array from newC++Pointers and memoryMedium
- ○C++: A list with new and deleteC++Pointers and memoryHard
- ○C++: A struct with a functionC++Structs and your first classEasy
- ○C++: A class with rulesC++Structs and your first classMedium
- ○C++: A stack classC++Structs and your first classHard
- ○C++: Different valuesC++Maps and setsEasy
- ○C++: Count the wordsC++Maps and setsMedium
- ○C++: Group the anagramsC++Maps and setsHard
- ○C++: Reverse with a stackC++Stacks, queues and pairsEasy
- ○C++: Taking turnsC++Stacks, queues and pairsMedium
- ○C++: The k largestC++Stacks, queues and pairsHard
- ○C++: Largest firstC++Iterators and algorithmsEasy
- ○C++: Passing marksC++Iterators and algorithmsMedium
- ○C++: Clean up and searchC++Iterators and algorithmsHard
- ○C++: The largest of a listC++TemplatesEasy
- ○C++: A two-value boxC++TemplatesMedium
- ○C++: A queue templateC++TemplatesHard
- ○C++: Safe conversionC++Exceptions and filesEasy
- ○C++: Save and loadC++Exceptions and filesMedium
- ○C++: An account with its own errorsC++Exceptions and filesHard
- ○C++: enum classC++Modern C++Easy
- ○C++: Objects that clean upC++Modern C++Medium
- ○C++: Tracking ordersC++Modern C++Hard
- ○A name cardPythonYour first programEasy
- ○A date with dashesPythonYour first programMedium
- ○A small reportPythonYour first programHard
- ○Add two numbersPythonVariables and assignmentEasy
- ○Swap two wordsPythonVariables and assignmentEasy
- ○Move every value alongPythonVariables and assignmentMedium
- ○A running balancePythonVariables and assignmentHard
- ○Area and perimeterPythonNumbers and operatorsEasy
- ○Celsius to FahrenheitPythonNumbers and operatorsEasy
- ○Seconds to days and hoursPythonNumbers and operatorsMedium
- ○Paying with the fewest notesPythonNumbers and operatorsMedium
- ○What time will it be?PythonNumbers and operatorsHard
- ○Average of threePythonInput and type conversionEasy
- ○GreetingPythonInput and type conversionEasy
- ○Price with taxPythonInput and type conversionMedium
- ○Split the billPythonInput and type conversionHard
- ○A receipt linePythonFormatting outputEasy
- ○A score linePythonFormatting outputMedium
- ○A three-line invoicePythonFormatting outputHard
- ○Even or oddPythonDecisions with ifEasy
- ○Largest of threePythonDecisions with ifEasy
- ○Letter gradePythonDecisions with ifMedium
- ○Leap yearPythonDecisions with ifMedium
- ○What kind of triangle?PythonDecisions with ifHard
- ○Sum from 1 to nPythonRepeating with for loopsEasy
- ○Multiplication tablePythonRepeating with for loopsEasy
- ○Count the even numbersPythonRepeating with for loopsMedium
- ○Star trianglePythonRepeating with for loopsMedium
- ○Multiples of 3 or 5PythonRepeating with for loopsHard
- ○Sum of digitsPythonRepeating with whileEasy
- ○Reverse a numberPythonRepeating with whileMedium
- ○Decimal to binaryPythonRepeating with whileHard
- ○Multiplication gridPythonNested loopsEasy
- ○A hollow squarePythonNested loopsMedium
- ○All the primes up to nPythonNested loopsHard
- ○Count the vowelsPythonWorking with stringsEasy
- ○PalindromePythonWorking with stringsMedium
- ○Run-length encodingPythonWorking with stringsHard
- ○Largest and smallestPythonListsEasy
- ○Second largestPythonListsMedium
- ○The longest rising runPythonListsHard
- ○Numbered mark listPythonenumerate and zipEasy
- ○Sum of productsPythonenumerate and zipMedium
- ○Above or below the averagePythonenumerate and zipHard
- ○Row sumsPythonLists of listsEasy
- ○Swap rows and columnsPythonLists of listsMedium
- ○Who won at noughts and crosses?PythonLists of listsHard
- ○The bigger of twoPythonFunctions and recursionEasy
- ○FactorialPythonFunctions and recursionMedium
- ○Fibonacci numberPythonFunctions and recursionMedium
- ○Greatest common divisorPythonFunctions and recursionMedium
- ○Prime or notPythonFunctions and recursionMedium
- ○How many ways to reach a total?PythonFunctions and recursionHard
- ○Full name with an optional titlePythonMore about functionsEasy
- ○Power with a defaultPythonMore about functionsEasy
- ○Final price with optionsPythonMore about functionsMedium
- ○The basket that never emptiesPythonMore about functionsHard
- ○Apply it twicePythonFunctions as valuesEasy
- ○Calculator with a dictionaryPythonFunctions as valuesMedium
- ○A pipeline of functionsPythonFunctions as valuesHard
- ○Area of a circlePythonUsing modulesEasy
- ○HypotenusePythonUsing modulesEasy
- ○How many boxes?PythonUsing modulesMedium
- ○Class statisticsPythonUsing modulesHard
- ○Count the different valuesPythonTuples and setsEasy
- ○Values in both listsPythonTuples and setsMedium
- ○Different pairs with a given sumPythonTuples and setsHard
- ○A phone bookPythonDictionariesEasy
- ○Word frequencyPythonDictionariesMedium
- ○The three most common wordsPythonDictionariesHard
- ○Passing marksPythonList comprehensionsEasy
- ○List of squaresPythonList comprehensionsEasy
- ○Words and their lengthsPythonList comprehensionsMedium
- ○Flatten and filterPythonList comprehensionsHard
- ○Count words and lettersPythonProcessing text dataEasy
- ○A CSV reportPythonProcessing text dataMedium
- ○Reading a server logPythonProcessing text dataHard
- ○Even numbers from a generatorPythonGeneratorsEasy
- ○Fibonacci from a generatorPythonGeneratorsMedium
- ○Windows over a listPythonGeneratorsHard
- ○Double it, safelyPythonErrors and exceptionsEasy
- ○Safe divisionPythonErrors and exceptionsMedium
- ○A hundred shared outPythonErrors and exceptionsHard
- ○Password checkPythonRaising your own errorsEasy
- ○Validate agesPythonRaising your own errorsMedium
- ○An account that refusesPythonRaising your own errorsHard
- ○Is it sorted?PythonTesting your codeEasy
- ○Keep it in rangePythonTesting your codeMedium
- ○A median that does not breakPythonTesting your codeHard
- ○Fix the averagePythonDebuggingEasy
- ○Fix the range totalPythonDebuggingMedium
- ○Fix the searchPythonDebuggingHard
- ○A Temperature classPythonClasses and objectsEasy
- ○Bank accountPythonClasses and objectsMedium
- ○Rectangle classPythonClasses and objectsMedium
- ○A small libraryPythonClasses and objectsHard
- ○Animal soundsPythonInheritanceEasy
- ○Shapes with one interfacePythonInheritanceMedium
- ○PayrollPythonInheritanceHard
- ○A printable pointPythonSpecial methodsEasy
- ○Adding fractionsPythonSpecial methodsMedium
- ○Vectors that behave like numbersPythonSpecial methodsHard
- ○Recursive sumPythonRecursion in practiceEasy
- ○Tower of HanoiPythonRecursion in practiceMedium
- ○Every arrangement of a wordPythonRecursion in practiceHard
- ○Fast FibonacciPythonMemoizationEasy
- ○Climbing stairsPythonMemoizationMedium
- ○The fewest coinsPythonMemoizationHard
- ○Reverse with a stackPythonStacks and queuesEasy
- ○Balanced bracketsPythonStacks and queuesMedium
- ○Serving a queuePythonStacks and queuesMedium
- ○A postfix calculatorPythonStacks and queuesHard
- ○Length of a linked listPythonLinked listsEasy
- ○Reverse a linked listPythonLinked listsMedium
- ○Remove a value from a linked listPythonLinked listsHard
- ○Count the leavesPythonBinary treesEasy
- ○Binary search treePythonBinary treesMedium
- ○A tree level by levelPythonBinary treesHard
- ○Is it on the list?PythonHow fast is your code?Easy
- ○Binary searchPythonHow fast is your code?Medium
- ○Pairs with a given sumPythonHow fast is your code?Medium
- ○Two values, one passPythonHow fast is your code?Hard
- ○Words by lengthPythonSorting algorithmsEasy
- ○Sort it yourselfPythonSorting algorithmsMedium
- ○Rank the studentsPythonSorting algorithmsMedium
- ○Merge sort and inversionsPythonSorting algorithmsHard
- ○Reverse in placePythonTwo pointers and sliding windowsEasy
- ○Pair with a given sumPythonTwo pointers and sliding windowsMedium
- ○Longest stretch with no repeatsPythonTwo pointers and sliding windowsHard
- ○How many passed?PythonProject: a grade bookEasy
- ○Grade book reportPythonProject: a grade bookMedium
- ○A ranked grade bookPythonProject: a grade bookHard
- ○Total stock valuePythonProject: a shop inventoryEasy
- ○Inventory commandsPythonProject: a shop inventoryMedium
- ○An inventory with its own errorsPythonProject: a shop inventoryHard
- ○FizzBuzz in PythonPythonWhat comes nextEasy
- ○FizzBuzzBangPythonWhat comes nextMedium
- ○A tiny programming languagePythonWhat comes nextHard
- ○C: Greet by nameCYour first C programEasy
- ○C: A sum and a productCYour first C programMedium
- ○C: Printing special charactersCYour first C programHard
- ○C: Next yearCVariables and typesEasy
- ○C: Characters are numbersCVariables and typesMedium
- ○C: An area and its whole partCVariables and typesHard
- ○C: Average of twoCOperators and expressionsEasy
- ○C: Hours, minutes and secondsCOperators and expressionsMedium
- ○C: A product too big for an intCOperators and expressionsHard
- ○C: Add two numbersCInput and output: printf and scanfEasy
- ○C: A receipt lineCInput and output: printf and scanfMedium
- ○C: Reading mixed inputCInput and output: printf and scanfHard
- ○C: Even or oddCDecisions: if, else and switchEasy
- ○C: Letter gradeCDecisions: if, else and switchEasy
- ○C: Days in a monthCDecisions: if, else and switchMedium
- ○C: Income taxCDecisions: if, else and switchHard
- ○C: Sum from 1 to nCLoops: for, while and do-whileEasy
- ○C: Times tableCLoops: for, while and do-whileEasy
- ○C: Reverse the digitsCLoops: for, while and do-whileMedium
- ○C: A diamond of starsCLoops: for, while and do-whileHard
- ○C: Largest and smallestCArraysEasy
- ○C: Print in reverseCArraysEasy
- ○C: Second largestCArraysMedium
- ○C: Merge two sorted arraysCArraysHard
- ○C: Count vowelsCStrings are char arraysEasy
- ○C: Palindrome wordCStrings are char arraysMedium
- ○C: Reverse each wordCStrings are char arraysHard
- ○C: Power functionCFunctionsEasy
- ○C: Prime or not, with a functionCFunctionsMedium
- ○C: Armstrong numbersCFunctionsHard
- ○C: Digit sum by recursionCRecursion and the call stackEasy
- ○C: Fibonacci, fastCRecursion and the call stackMedium
- ○C: Binary strings with no 11CRecursion and the call stackHard
- ○C: Swap with pointersCPointersEasy
- ○C: Two results through pointersCPointersMedium
- ○C: Division that reports failureCPointersHard
- ○C: Sum of an arrayCPointers and arraysEasy
- ○C: Reverse with two pointersCPointers and arraysMedium
- ○C: A pointer to the largestCPointers and arraysHard
- ○C: Distance between two pointsCStructuresEasy
- ○C: Top studentCStructuresMedium
- ○C: Sort an array of studentsCStructuresHard
- ○C: A named constantCConstants, enums and macrosEasy
- ○C: A traffic lightCConstants, enums and macrosMedium
- ○C: Repair the macrosCConstants, enums and macrosHard
- ○C: An average on the heapCDynamic memory: malloc and freeEasy
- ○C: Store n numbers on the heapCDynamic memory: malloc and freeMedium
- ○C: An array that growsCDynamic memory: malloc and freeHard
- ○C: Add up a linked listCLinked listsEasy
- ○C: Add to the end of a listCLinked listsMedium
- ○C: A stack as a linked listCLinked listsHard
- ○C: Write numbers, read them backCReading and writing filesEasy
- ○C: Lines in a fileCReading and writing filesMedium
- ○C: A tiny file managerCReading and writing filesHard
- ○C: Fix the totalCBugs C will not catchEasy
- ○C: Fix the overrunCBugs C will not catchMedium
- ○C: Fix the vanishing arrayCBugs C will not catchHard
- ○Count the comparisonsCWhat a data structure isEasy
- ○Count equal pairsCWhat a data structure isMedium
- ○Halving stepsCWhat a data structure isHard
- ○Insert into a sorted arrayCArrays: insert, delete and 2D arraysEasy
- ○Delete at positionsCArrays: insert, delete and 2D arraysMedium
- ○Rotate a matrixCArrays: insert, delete and 2D arraysHard
- ○Build and measure a listCSingly linked listsEasy
- ○Reverse a linked listCSingly linked listsMedium
- ○Remove every copy of a valueCSingly linked listsMedium
- ○Merge two sorted listsCSingly linked listsHard
- ○Forwards and backwardsCDoubly and circular linked listsEasy
- ○The Josephus circleCDoubly and circular linked listsMedium
- ○A playlist cursorCDoubly and circular linked listsHard
- ○A stack of numbersCStacksEasy
- ○Undo typingCStacksMedium
- ○A stack that knows its minimumCStacksHard
- ○Depth of bracketsCUsing stacks: brackets and postfixEasy
- ○Balanced bracketsCUsing stacks: brackets and postfixMedium
- ○Evaluate a postfix expressionCUsing stacks: brackets and postfixMedium
- ○Infix to postfixCUsing stacks: brackets and postfixHard
- ○The ticket lineCQueuesEasy
- ○A circular queueCQueuesMedium
- ○A queue from two stacksCQueuesHard
- ○Leaves and heightCBinary treesEasy
- ○Level by levelCBinary treesMedium
- ○Three traversalsCBinary treesHard
- ○The search pathCBinary search treesEasy
- ○Build a binary search treeCBinary search treesMedium
- ○Delete from a search treeCBinary search treesHard
- ○Is it a min-heap?CHeaps and priority queuesEasy
- ○The k smallest numbersCHeaps and priority queuesMedium
- ○Join the ropesCHeaps and priority queuesHard
- ○Which bucket?CHash tablesEasy
- ○Linear probingCHash tablesMedium
- ○Count the wordsCHash tablesHard
- ○Vertex degreesCGraphsEasy
- ○Neighbour listsCGraphsMedium
- ○Count the trianglesCGraphsHard
- ○Can it be reached?CGraph traversal: BFS and DFSEasy
- ○Distances from vertex 0CGraph traversal: BFS and DFSMedium
- ○Connected componentsCGraph traversal: BFS and DFSMedium
- ○Shortest way through a gridCGraph traversal: BFS and DFSHard
- ○Seen before?CChoosing a data structureEasy
- ○Browser historyCChoosing a data structureMedium
- ○Most urgent task firstCChoosing a data structureHard
- ○Fix: free every nodeCData structure bugsEasy
- ○Fix: the queue that runs out of roomCData structure bugsMedium
- ○Fix: delete from a listCData structure bugsHard
- ○Word or prefix?CTries: prefix treesEasy
- ○Count words by prefixCTries: prefix treesMedium
- ○AutocompleteCTries: prefix treesHard
- ○Same group?CDisjoint sets (union-find)Easy
- ○Friend groupsCDisjoint sets (union-find)Medium
- ○Edges that close a cycleCDisjoint sets (union-find)Hard
- ○Range sums without updatesCSegment trees and Fenwick treesEasy
- ○Range minimum with updatesCSegment trees and Fenwick treesMedium
- ○Range sums with updatesCSegment trees and Fenwick treesHard
- ○Is the tree balanced?CAVL trees: self-balancing search treesEasy
- ○Rotate the rootCAVL trees: self-balancing search treesMedium
- ○Build an AVL treeCAVL trees: self-balancing search treesHard
- ○Count the loop stepsCAnalysing algorithmsEasy
- ○Two ways to find a pairCAnalysing algorithmsMedium
- ○Pairs with a sum divisible by kCAnalysing algorithmsHard
- ○Binary searchCBinary searchEasy
- ○Count numbers in a rangeCBinary searchMedium
- ○The smallest truck that will doCBinary searchHard
- ○Insertion sort, pass by passCBubble, selection and insertion sortEasy
- ○Count bubble sort swapsCBubble, selection and insertion sortMedium
- ○Rank students, keeping ties in orderCBubble, selection and insertion sortHard
- ○Repair the mergeCMerge sortEasy
- ○How many comparisons did merge sort make?CMerge sortMedium
- ○Count inversions with merge sortCMerge sortHard
- ○Split around a valueCQuick sortEasy
- ○One partition stepCQuick sortMedium
- ○The k-th smallest numberCQuick sortHard
- ○Sort marks by countingCHeap sort and counting sortEasy
- ○Turn an array into a max-heapCHeap sort and counting sortMedium
- ○Radix sort, digit by digitCHeap sort and counting sortHard
- ○All binary stringsCRecursion and backtrackingEasy
- ○Subsets with a given sumCRecursion and backtrackingMedium
- ○All permutations in orderCRecursion and backtrackingMedium
- ○The n-queens puzzleCRecursion and backtrackingHard
- ○Pay with the fewest taka notesCGreedy algorithmsEasy
- ○Activity selectionCGreedy algorithmsMedium
- ○Jobs with deadlinesCGreedy algorithmsHard
- ○Ways to climb the stairsCDynamic programmingEasy
- ○The fewest coinsCDynamic programmingMedium
- ○Longest increasing subsequenceCDynamic programmingHard
- ○Paths through a gridCKnapsack and longest common subsequenceEasy
- ○The 0/1 knapsackCKnapsack and longest common subsequenceMedium
- ○Longest common subsequenceCKnapsack and longest common subsequenceMedium
- ○Edit distance between two wordsCKnapsack and longest common subsequenceHard
- ○Is this order allowed?CTopological sortEasy
- ○Order the tasksCTopological sortMedium
- ○How long will the project take?CTopological sortHard
- ○Repair Floyd–WarshallCShortest paths: Dijkstra and Floyd–WarshallEasy
- ○Shortest distancesCShortest paths: Dijkstra and Floyd–WarshallMedium
- ○Shortest paths with negative edgesCShortest paths: Dijkstra and Floyd–WarshallHard
- ○Is it a spanning tree?CMinimum spanning treesEasy
- ○Minimum spanning treeCMinimum spanning treesMedium
- ○Finish the networkCMinimum spanning treesHard
- ○GCD and LCMCNumber algorithmsEasy
- ○Count the primesCNumber algorithmsEasy
- ○Fast power modulo mCNumber algorithmsMedium
- ○The modular inverseCNumber algorithmsHard
- ○The largest number, by halvesCDivide and conquer and the master theoremEasy
- ○The best run of numbersCDivide and conquer and the master theoremMedium
- ○The closest pair of pointsCDivide and conquer and the master theoremHard
- ○Find the first matchCString matching: naive search and KMPEasy
- ○Find every matchCString matching: naive search and KMPMedium
- ○The repeating unit of a wordCString matching: naive search and KMPHard
- ○How far can the paint spread?CSearching grids: BFS and A*Easy
- ○Shortest way through a mazeCSearching grids: BFS and A*Medium
- ○Distance to the nearest exitCSearching grids: BFS and A*Hard
- ○The number without a partnerCBit manipulationEasy
- ○Repair the bit tricksCBit manipulationMedium
- ○The two numbers without partnersCBit manipulationHard
- ○Decimal to binaryCNumber systems: binary, octal and hexadecimalEasy
- ○Any base from 2 to 16CNumber systems: binary, octal and hexadecimalMedium
- ○Hexadecimal to decimalCNumber systems: binary, octal and hexadecimalMedium
- ○Count the 1 bitsCBitwise operationsEasy
- ○Powers of twoCBitwise operationsEasy
- ○Two's complement bitsCNegative numbers and overflowMedium
- ○Caesar cipherCCharacters and textEasy
- ○Count lines, words and charactersCThe terminalEasy
- ○Fix the averageCDebugging with gdbEasy
- ○Be makeCBuilding with makeMedium
- ○Show the changesCVersion control with GitMedium
- ○C++: Greeting with cin and coutC++From C to C++Easy
- ○C++: Joining stringsC++From C to C++Easy
- ○C++: Initials from a full nameC++From C to C++Medium
- ○C++: Reverse the words of every lineC++From C to C++Hard
- ○C++: Swap with referencesC++References, overloading and default argumentsEasy
- ○C++: Overloaded area()C++References, overloading and default argumentsMedium
- ○C++: Three results through referencesC++References, overloading and default argumentsHard
- ○C++: A Rectangle classC++Classes and objectsEasy
- ○C++: A bank account classC++Classes and objectsMedium
- ○C++: A 24-hour clock classC++Classes and objectsHard
- ○C++: Two ways to build a pointC++Constructors and destructorsEasy
- ○C++: Constructor and destructor orderC++Constructors and destructorsMedium
- ○C++: Members are built firstC++Constructors and destructorsHard
- ○C++: An array made with newC++Objects on the heap: new and deleteEasy
- ○C++: An array that grows by doublingC++Objects on the heap: new and deleteMedium
- ○C++: A linked stack that cleans up after itselfC++Objects on the heap: new and deleteHard
- ○C++: Copies that look after themselvesC++Copying objects: shallow and deep copiesEasy
- ○C++: Repair the assignmentC++Copying objects: shallow and deep copiesMedium
- ○C++: A deep copy constructorC++Copying objects: shallow and deep copiesHard
- ○C++: Counting objects with static membersC++Static and const membersEasy
- ○C++: Student IDs from a static counterC++Static and const membersMedium
- ○C++: One interest rate for every accountC++Static and const membersHard
- ○C++: Comparing version numbersC++Operator overloadingEasy
- ○C++: Adding fractions with operator+C++Operator overloadingMedium
- ○C++: A 2D vector with operatorsC++Operator overloadingMedium
- ○C++: A 2 × 2 matrix with operatorsC++Operator overloadingHard
- ○C++: A student is a personC++InheritanceEasy
- ○C++: Employees and managersC++InheritanceMedium
- ○C++: Sale prices that build on the base priceC++InheritanceHard
- ○C++: Every animal speaks its own wayC++Virtual functions and polymorphismEasy
- ○C++: Shapes through a base pointerC++Virtual functions and polymorphismMedium
- ○C++: A payroll with three kinds of payC++Virtual functions and polymorphismHard
- ○C++: An abstract shape with two measurementsC++Abstract classes and interfacesEasy
- ○C++: A payment interfaceC++Abstract classes and interfacesMedium
- ○C++: A pipeline of number filtersC++Abstract classes and interfacesHard
- ○C++: One max for every typeC++TemplatesEasy
- ○C++: A Stack class templateC++TemplatesMedium
- ○C++: A sorted list for any typeC++TemplatesHard
- ○C++: Sort and reverse a vectorC++The standard library: vector, string, map and sortEasy
- ○C++: Word counts with mapC++The standard library: vector, string, map and sortMedium
- ○C++: Sorting studentsC++The standard library: vector, string, map and sortMedium
- ○C++: A grade book with a map of vectorsC++The standard library: vector, string, map and sortHard
- ○C++: Catch a bad indexC++ExceptionsEasy
- ○C++: Division with exceptionsC++ExceptionsMedium
- ○C++: Your own exception classesC++ExceptionsHard
- ○C++: Loan periods for each kind of itemC++Project: a small library systemEasy
- ○C++: A library that lends and takes backC++Project: a small library systemMedium
- ○C++: Late fines in the libraryC++Project: a small library systemHard
- ○CP: Read until the endC++Contests, judges and time limitsEasy
- ○CP: Range sum queriesC++Prefix sumsMedium
- ○CP: The best windowC++Two pointers and sliding windowsMedium
- ○CP: Split the jobsC++Binary search on the answerHard
- ○CP: The most meetingsC++Sorting first, then greedyMedium
- ○CP: Climbing stairs, modulo a primeC++Dynamic programming in contestsEasy
- ○CP: Longest increasing subsequenceC++Dynamic programming in contestsMedium
- ○CP: Escape the mazeC++Graphs with the STLMedium
- ○CP: n choose r, modulo a primeC++Math for contestsHard
- ○Fix the reported bugPythonIssues and bug reportsEasy
- ○Find the TODOsPythonReading a codebaseEasy
- ○Check the commit messagesPythonPull requestsMedium
- ○A tiny linterPythonCode review and styleMedium
- ○A truth tablePythonPropositions and truth tablesEasy
- ○Tautology or not?PythonLogical equivalenceMedium
- ○For all, there existsPythonPredicates and quantifiersEasy
- ○Set operationsPythonSetsEasy
- ○Injective, surjective, bijectivePythonFunctionsMedium
- ○Properties of a relationPythonRelationsMedium
- ○Permutations and combinationsPythonCounting: permutations and combinationsEasy
- ○gcd and lcmPythonDivisibility, primes and the gcdEasy
- ○Modular inversePythonModular arithmetic and RSAMedium
- ○Euler path or circuit?PythonGraphsMedium
- ○Tower of HanoiPythonRecurrence relationsEasy
- ○Every book in the tableSQLDatabases and tablesEasy
- ○Books from 2000 onwardsSQLDatabases and tablesMedium
- ○Add the new arrivalsSQLDatabases and tablesHard
- ○Three new studentsSQLCreating tables and adding rowsEasy
- ○Design the products tableSQLCreating tables and adding rowsMedium
- ○Change the design of a live tableSQLCreating tables and adding rowsHard
- ○Good marks in DhakaSQLChoosing rows and columns: SELECT and WHEREEasy
- ○Repair the name searchSQLChoosing rows and columns: SELECT and WHEREMedium
- ○A contact for everyone outside the big citiesSQLChoosing rows and columns: SELECT and WHEREHard
- ○The top threeSQLSorting, limiting and DISTINCTEasy
- ○Every city onceSQLSorting, limiting and DISTINCTEasy
- ○The second page of resultsSQLSorting, limiting and DISTINCTMedium
- ○Each city and department once, unknown cities lastSQLSorting, limiting and DISTINCTHard
- ○Restock daySQLChanging and deleting rowsEasy
- ○A pay rise and a clear-outSQLChanging and deleting rowsMedium
- ○Archive, then deleteSQLChanging and deleting rowsHard
- ○Statistics for the whole classSQLCounting and totals: GROUP BY and HAVINGEasy
- ○Department summarySQLCounting and totals: GROUP BY and HAVINGMedium
- ○Big customersSQLCounting and totals: GROUP BY and HAVINGMedium
- ○The months that reached 1000 takaSQLCounting and totals: GROUP BY and HAVINGHard
- ○Only adults may joinSQLKeys and constraintsEasy
- ○One account per email addressSQLKeys and constraintsMedium
- ○When an author leaves, their books go tooSQLKeys and constraintsHard
- ○Who ordered whatSQLJoining tablesEasy
- ○Customers who never orderedSQLJoining tablesMedium
- ○Earning more than the bossSQLJoining tablesHard
- ○From algebra to SQLSQLRelational algebraEasy
- ○Set difference: students not in the clubSQLRelational algebraMedium
- ○Division: who took every required courseSQLRelational algebraHard
- ○Above the class averageSQLSubqueries and WITHEasy
- ○Above their department's averageSQLSubqueries and WITHMedium
- ○The second-highest salarySQLSubqueries and WITHHard
- ○Letter gradesSQLCASE, views and set operationsEasy
- ○A view that keeps up with the dataSQLCASE, views and set operationsMedium
- ○In exactly one of the two teamsSQLCASE, views and set operationsHard
- ○How many students in each courseSQLDesigning a database: the ER modelEasy
- ○Credits per studentSQLDesigning a database: the ER modelMedium
- ○Build the junction tableSQLDesigning a database: the ER modelHard
- ○Find the update anomalySQLNormalizationEasy
- ○Move the course facts into their own tableSQLNormalizationMedium
- ○A lossless decomposition, checkedSQLNormalizationHard
- ○Add the missing indexSQLIndexes and how queries find rowsEasy
- ○What each index is sorted bySQLIndexes and how queries find rowsMedium
- ○Which indexes can a city search use?SQLIndexes and how queries find rowsHard
- ○Try a delete, then take it backSQLTransactions and concurrencyEasy
- ○Undo only the mistakeSQLTransactions and concurrencyMedium
- ○A transfer that cannot go wrongSQLTransactions and concurrencyHard
- ○FCFS schedulingCCPU scheduling: FCFS and SJFEasy
- ○Shortest job firstCCPU scheduling: FCFS and SJFMedium
- ○Round robinCRound robin, SRTF and priorityHard
- ○Page faults with FIFOCVirtual memory and page replacementEasy
- ○Page faults with LRUCVirtual memory and page replacementMedium
- ○Is the state safe?CDeadlockHard
- ○Translate addressesCPagingEasy
- ○Shortest seek firstCDisks and disk schedulingMedium
- ○First fitCMemory: addresses and allocationMedium
- ○Mean, median and spreadPythonData, statistics and featuresEasy
- ○Min-max scalingPythonData, statistics and featuresEasy
- ○The least-squares linePythonLinear regressionMedium
- ○Gradient descent stepsPythonGradient descentMedium
- ○k-nearest neighboursPythonk-nearest neighboursMedium
- ○Confusion matrix and scoresPythonMeasuring a classifierMedium
- ○Information gainPythonDecision treesMedium
- ○A Naive Bayes spam filterPythonBayes' rule and Naive BayesHard
- ○Two sumPythonArrays and hashingEasy
- ○First unique characterPythonArrays and hashingEasy
- ○Group the anagramsPythonArrays and hashingMedium
- ○Valid palindromePythonTwo pointersEasy
- ○Container with the most waterPythonTwo pointersMedium
- ○Longest substring without repeatsPythonSliding windowsMedium
- ○Shortest subarray with a big enough sumPythonSliding windowsMedium
- ○Balanced bracketsPythonStacks and queuesEasy
- ○Days until warmerPythonStacks and queuesMedium
- ○Ship within D daysPythonBinary search patternsHard
- ○Reverse in groups of kPythonLinked list patternsMedium
- ○Depth of a binary treePythonTree patternsEasy
- ○Number of islandsPythonGraph patternsMedium
- ○Course schedulePythonGraph patternsHard
- ○Merge intervalsPythonHeaps and intervalsMedium
- ○Meeting roomsPythonHeaps and intervalsMedium
- ○Coin changePythonDynamic programming patternsMedium
- ○Longest increasing subsequencePythonDynamic programming patternsMedium
- ○Combination sumPythonBacktrackingMedium
- ○Longest consecutive runPythonA mock interview, start to finishMedium
- ○How long does the file take?PythonDelay and throughputEasy
- ○The Internet checksumPythonDetecting errors: parity, checksums and CRCMedium
- ○CRC remainderPythonDetecting errors: parity, checksums and CRCMedium
- ○Subnet detailsPythonSubnettingMedium
- ○Longest prefix matchPythonRouters and forwarding tablesMedium
- ○Distance-vector routingPythonRouting algorithms: link state and distance vectorHard
- ○Counting Go-Back-N transmissionsPythonReliable delivery: Go-Back-N and Selective RepeatHard
- ○The congestion windowPythonTCP congestion controlMedium
- ○Three-input gatesPythonBits, logic gates and truth tablesEasy
- ○From a truth table to a sum of mintermsPythonMinterms, maxterms and canonical formsMedium
- ○Are they equal?PythonBoolean algebraMedium
- ○Gray codePythonKarnaugh mapsEasy
- ○A ripple-carry adderPythonAdders: from half adder to ripple carryMedium
- ○A multiplexerPythonMultiplexers, decoders and encodersEasy
- ○A JK flip-flopPythonLatches and flip-flopsMedium
- ○Detect 101PythonFinite state machinesMedium
- ○CPU timePythonMeasuring performanceEasy
- ○Run an accumulator machinePythonThe fetch–decode–execute cycleMedium
- ○Decode instructionsPythonInstruction sets and addressing modesMedium
- ○Booth's algorithmPythonMultiplication and division in hardwareHard
- ○Count the pipeline stallsPythonPipeline hazardsHard
- ○Average memory access timePythonThe memory hierarchyEasy
- ○A direct-mapped cachePythonCache memoryHard
- ○Amdahl's lawPythonParallel processors and multicoreEasy
- ○Add two digits8086Keyboard and screen with INT 21hEasy
- ○Count down8086LoopsEasy
- ○Shout it8086Bits: logic, shifts and rotatesEasy
- ○The largest digit8086Comparing and jumpingMedium
- ○Multiply two digits8086Multiplication and divisionMedium
- ○Decimal to binary8086Bits: logic, shifts and rotatesMedium
- ○Backwards8086The stackMedium
- ○Sum from 1 to n8086Procedures: CALL and RETHard
- ○Count the vowels8086Arrays and addressing modesMedium
- ○Mean, median and modePythonDescribing dataEasy
- ○Probability of a dice sumPythonOutcomes and probabilityEasy
- ○At least oncePythonRules: not, or, andEasy
- ○Is a positive test right?PythonBayes' theoremMedium
- ○Expected value and variancePythonRandom variables and expected valueEasy
- ○Binomial probabilityPythonThe binomial distributionMedium
- ○z-score and normal probabilityPythonThe normal distributionMedium
- ○Correlation and the best-fit linePythonCorrelation and regressionHard
- ○A polynomial and its slopePythonRules for derivativesEasy
- ○Area by rectanglesPythonIntegrals: area under a curveMedium
- ○A geometric seriesPythonSequences and seriesEasy
- ○Dot product and anglePythonVectors and the dot productEasy
- ○Multiply two matricesPythonMatrices and matrix multiplicationMedium
- ○Determinant of a matrixPythonDeterminants and inversesMedium
- ○Solve a linear system exactlyPythonSolving systems of linear equationsHard
- ○Eigenvalues of a 2×2 matrixPythonEigenvalues and eigenvectorsMedium