allgreed / coding-interview-university

A complete computer science study plan to become a software engineer.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allgreed's Coding Interview University

Shoutout and disclaimer

  • This repo is a based on Jwasham's Coding Interview University
  • I implement everything in C, C++ and C++ with builtin-types
  • I've removed all the non-free links or those that I consider of little value

Prerequisites

Note: Those are only required to run my code, not to do the course

Google test

  • clone the repo
    sudo git clone https://github.com/google/googletest.git /opt/gtest
  • go into /opt/gtest/googletest/make
    cd /opt/gtest/googletest/make
  • test the Makefile
    sudo make
    sudo chmod +x sample1_unittest
    ./sample1_unittest
  • Gtest output should appear with tests passing, if so: you're all set!

Writing tests

  • copy Makefile to a new project
  • change locating variables, mine are:
    GTEST_DIR = /opt/gtest/googletest
    USER_DIR = .
  • test copied Makefile again with sample self-written test, example:
#include "gtest/gtest.h"

TEST(Confirming_setup_ok, dummy)
{
    // this should pass
}

TEST(Confirming_setup_ok, this_passes)
{
    EXPECT_EQ(2 + 2, 4);
}

TEST(Confirming_setup_ok, this_fails)
{
    EXPECT_TRUE(false);
}
  • incorporate [and refactor!] that Makefile into your flow

Valgrind

    sudo apt install valgrind

How to use it

  1. See Jwasham's repo for great non-technical content related to this course
  2. Fork this repo
  3. Clone the repo
  4. Undo all checks
  5. Code
  6. Code unit fingers burn and your veins pump raw binary
  7. Then code some more

Code -> ./code Chapter -> eg. data_structures Case -> inside a chapter -> eg. arrays

How to create new assignment

Go inside course directory

    cd code

Go inside chapter folder / create one

    cd [chapter_name_underscores_plural_lowercase] / mkdir [chapter_name_underscores_plural_lowercase]

Trigger script with assignment name

    ../../new_case.py [assignment_name_underscores_singular_lowercase]

About

A complete computer science study plan to become a software engineer.

License:Other


Languages

Language:Assembly 77.1%Language:C++ 10.3%Language:C 6.4%Language:Makefile 3.3%Language:Python 2.8%