Skip to content

Instantly share code, notes, and snippets.

@arpit
Last active June 17, 2018 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arpit/53282a359fe93d80861a4592d6eade5f to your computer and use it in GitHub Desktop.
Save arpit/53282a359fe93d80861a4592d6eade5f to your computer and use it in GitHub Desktop.
Ruby Plan

Skills

  • Follow the Rabbit: Verify the code path
  • Understand the state machine
  • Learn the nomenclature: What exactly is:
    • Class, Method, variable, constant, Module
    • Design Pattern, Algorithm, Data Structure
      • Program = Data Structures + Logic / Code
    • Polymorphism, idempotency
  • How do you learn new ideas? Whats one new idea you learnt this week?
  • Patience, Persistence, Concentration, Communication
  • Time management

Questions:

  • What are the disadvantages of Ruby on Rails?

Ruby Basics

  • What is a ruby expression

  • Expressions vs statements

  • What is an operator

  • Simple ruby code expressions

    • String manipulation
    • Math
    • Arrays and Hashes

    Navigating nested arrays and hashes

 * Find pair with given sum in the array

  • Find all the pair-sums in an array
    • Note: Unlike in Ruby or JavaScript where Arrays can grow arbitrarily, in C, arrays are of fixed size and there is a cost to growing them. So in a problem like above, you should start thinking about how big the final array will be.

Some good algorithms to implement here

Organizing code

  • Methods

    • Why are Methods called Actions?
    • instance methods vs class methods
    • Methods in included modules
  • Classes

    • initialize method

    • attributes and attr_accessors

    • is it a method or a attribute?

    • Create a basic Ruby class to represent the following situation:

    A city has a number of high schools
    Each school has a different name
    Each school has a number of students
    If the school has more than 200 students, it gets federal funding
    
    How do I find out how many schools have federal funding in the city ?
    
    
  • Modules

    • What is a module?
  • Gems

Different methodologies for code organization

  • Procedural
  • Object oriented
  • Functional

Follow the code path

Rails

  • What is a web framework
  • Frameworks vs. Libraries

Model

  • Find all the models in a project
  • Model associations
  • Find models by different parameters
  • Whats the difference between find and where
  • Using custom SQL for advanced queries
  • Active Record Callbacks

View

  • What are the different templating engines for Ruby?
  • What are helpers? Give an example of a custom helper method
  • JQuery basics
  • Forms

Controller

  • Controller Callbacks

Basic HTTP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment