Coder Social home page Coder Social logo

xxks-kkk / shuati Goto Github PK

View Code? Open in Web Editor NEW
9.0 3.0 2.0 115.86 MB

Interview questions central repo

License: GNU General Public License v3.0

Makefile 0.06% Java 6.22% C 4.88% Python 14.58% Shell 0.07% CMake 2.10% C++ 70.78% Emacs Lisp 0.01% Rust 0.62% Go 0.67%
leetcode interview-practice algorithm hackerrank elements-of-programming-interviews

shuati's Introduction

shuati

Build Status

This is the respository that I put my systematic algorithm learning into practice by solving various interview questions. This is also the place where I practice different programming languages.

Steps to developing a usable algorithm.

  • Model the problem.
  • Find an algorithm to solve it.
  • Fast enough? Fits in memory?
  • If not, figure out why not.
  • Find a way to address the problem.
  • Iterate until satisfied

Usage

The repo contains a mixture of different programming languages. To build and test solutions written in specific language, follow steps below:

C, C++

To build all C, C++ solutions, run

$ mkdir -p build && cd build && cmake .. && make -j4

Java

To build Java solutions, find Makefile inside the directory that program resides, and run make

Rust

To test all Rust solutions, run

$ cd rust
$ cargo test

Go

To test all Go solutions, run

$ cd shuati
$ go test ./...

shuati's People

Contributors

dependabot[bot] avatar xxks-kkk avatar yanghu-yh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

spani73 ridhap

shuati's Issues

scraper.py stop working

the content with <div id="question-detail-app"></div> seems to be dynamically loaded by javascript and beautifulsoup cannot get the content anymore.

Sunset testall.py

In PR #181, we enable CTest in CMake. This allows us to add test case directly in CMakeList.txt. This way is better than testall.py method as we now need to run make test to kick off all the tests.

Reorg repos

  • Move goinclude, cppinclude, cinclude from leetcode directory under a separate directory include, which is at the same level as leetcode directory
  • Breakdown CMakelists.txt into different sub CMakelists and write a test script that to be run by travis

Automatically add dependency during the build

Consider how we build LC138 binary in C++

add_executable(138
  leetcode/138-CopyListWithRandomPointer/copyListWithRandomPointer.cc
  include/cppinclude/linkedList_rand.cc
  include/cppinclude/cpputility.h
  include/jsoncpp/jsoncpp.cpp)

Is there a way to include jsoncpp.cpp automatically whenever we include the .cc that has dependency on it (e.g., linkedList_rand.cc has dependency on jsoncpp.cpp. Can we include jsoncpp.cpp whenever we use linkedList_rand.cc automatically?)

Build Misc binary not in numbers

PR #178 offers a way to build all the binary under hackerrank/ without enforcing the binary name be the numeric. We want to do the same for misc/

EPI code integration

EPI has better C++ code implementation and definition than Leetcode's. Using leetcode has negative impact on C++ practice. Try to integrate EPI code along with test infrastructure in the repo and point to the EPI implementation whenever we can find the same leetcode problem in EPI.

See PR #168 Todo section on one example.

Enable Java compilation with CMake

Add performance test infrastructure

Add performance test infrastructure to test the code runtime finish within the given time budget. For example, in LC5, we have the following input as s:

"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg"

And, we get TLE on such input for certain solution, according to run test case, the time budget is smaller than 240ms, and we need to enforce this when perform performance test.

Add Doc written in LaTex about pseudo algorithm for each problem

Write LaTex doc with pseudo algorithm for each problem and list out the optimization point with the performance gain.

It should include:

  • Problem description
  • Link to the problem description
  • Pseudo algorithm
  • Link to the actual implementation
  • Optimization technique and performance gain from each technique

New test infrastructure for Linked List/ Graph problems in Leetcode

Leetcode now adopts a new way to represent linked list and graph input. For example, in LC138, the input looks like:

Input:
{"$id":"1","next":{"$id":"2","next":null,"random":{"$ref":"2"},"val":2},"random":{"$ref":"2"},"val":1}

Now, we need to have infrastructure support for creating linked list and graph based on the new input format.

This issue is critical as now linked list and graph problem cannot be properly tested locally.

Automatically generate C++ template boilerplate

Should automatically generate C++ template boilerplate to remove the overhead of writing specific solution. For example, we should generate main function, necessary macros and test structs, etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.