Interview Questions
Ruby Questions.
* What is the difference between a class and a module? "modules are like libraries"
* How would you declare and use a constructor in Ruby? .new
* How would you create getter and setter methods in Ruby? "attr_accessor"
* Describe the difference between class and instance variables? "available only if you have an instance"
* What does 'self' mean?
* What is the difference between Proc and lambda? " return in a Proc returns from its enclosing block/method, while a return in a lambda simply returns from the lambda."
* What are some active record call backs? "after_create, before_validation, before_save around_save before_update around_update after_update "
* difference between filters and callbacks? filters in controllers, callbacks in models
Gems and Engines.
* Difference between Gem and Engine
* What is RubyGems? How does it work?
* Have you worked with any gems or published any?
* what goes in the gemspec? name, version, authors, email, homepage, summary, description, licence, files, dependencies
* how would you publish a gem? Publish your Gem to rubygems: gem push mega_bar-0.0.1.gem
* Can you give me some examples of your favorite gems besides Ruby on Rails? Active admin, pry
Rails Questions
* If you created a rails app what would some directories be? App, controllers, models, layouts, views, lib, config
* What is ActiveJob? When should we use it? What's behind it? Sidekiq, resque,
* What is Asset Pipeline? -> where would you include jquery? application.js
* Where would you put your site's header and footer? /app/layouts.
* What's a resource route? Supports full basic crud's. New, Create, Edit, Update, Index, Show, Delete.
* What rest methods for create vs update? Post vs Patch
* What would happen if you didn't have a 'index' method in your controller? Index.html.erb would process it.
* Erb vs haml vs slim? Slim requires fewer symbols <% %>, looks cleaner, 8x faster and supports http streaming
* What are Strong Parameters? Action Controller parameters are forbidden to be used in Active Model mass assignments until they have been permitted params.require(...).permit(...)
* Describe Active Record conventions. table 'articles' class Article. table line_items, class LineItem, controller LineItemController (file line_item_controller.rb)
* What's a Concern? Where do you put them? A place for sharing code for models or controllers.
* What's a Scaffold? Builds all pieces of a MVC for a db table.
* What's a Generator? Kind of what scaffold uses to make its stuff. Can be customized. Ever make one?
* Explain the Migrations mechanism.
* Describe types of associations in Active Record. Has_one, has_many, belongs_to, has_many_thru
* What is a scope? Shortcut for adding where clauses to sql.
* How do you protect from CSRF? protect_from_forgery with: :exception, in application controller and <%= csrf_meta_tags %> in application.html.erb
Testing
* what do you use for testing rails apps? rspec., cucumber,
* what's simplecov? What's rubocop?
* What's a vcr?
* What does allowing to receive and return do?
* Stub ('allow' for 'query' methods) vs Mocks and Spies (for 'command' methods). Fakes: classes.
* Organize object creation? Factories. FactoryBot.
Front End
* What do you use to step thru javascript?
* Experience with node, or Grunt (automation)?
* What js frameworks? Angular, Ember, React, Meteor (written in node)
* What css frameworks? Twitter bootstrap, foundation.
* What is SASS? A CSS preprocessor that lets you write more concise css. LESS too.
React info:
* React is a front-end JavaScript library developed by Facebook in 2011.
* It follows the component based approach which helps in building reusable UI components.
* It is used for developing complex and interactive web and mobile UI.
* Even though it was open-sourced only in 2015, it has one of the largest communities supporting it.
3. What are the features of React? Major features of React are listed below:
i. It uses the virtual DOM instead of the real DOM.
ii. It uses server-side rendering.
iii. It follows uni-directional data flow or data binding.
4. List some of the major advantages of React. Some of the major advantages of React are:
i. It increases the application's performance
ii. It can be conveniently used on the client as well as server side
iii. Because of JSX, code's readability increases
iv. React is easy to integrate with other frameworks like Meteor, Angular, etc
v. Using React, writing UI test cases become extremely easy
5. What are the limitations of React? Limitations of React are listed below:
i. React is just a library, not a full-blown framework
ii. Its library is very large and takes time to understand
iii. It can be little difficult for the novice programmers to understand
iv. Coding gets complex as it uses inline templating and JSX
Building:
Used Heroku? Aws? Capistrano?
Circle vs Jenkins?
Git? Bitbucket? SVN?
DB's. Postgres, mysql, oracle, sqlserver,