1. What are polymorphic associations?
class Person < ActiveRecord::Base
 has_one :photo, :as => :photoable
end
class Company < ActiveRecord::Base
 has_one :photo, :as => :photoable
end
class Photo < ActiveRecord::Base
 belongs_to :photoable, :polymorphic => true
end
This basically allows the photo class to belongs_to any model. Which is good, the alternative would be to say:
class Photo < ActiveRecord::Base
 belongs_to :person
 belongs_to :company
end
Then you’d have all these foreign keys in your photos table but you only would ever have a value for one of them because a photo can only belong to a person or a company but not both.
So here polymorphic associations helps! :-)
2. What are SASS mixins?
Mixins are one of the most powerful Sass features. They allow re-use of styles – properties or even selectors – without having to copy and paste them or move them into a non-semantic class. Mixins are defined using the “@mixin” directive, which takes a block of styles that can then be included in another selector using the “@include” directive.

@mixin rounded($side, $radius: 10px) {
border-'$side'-radius: $radius;
}
navbar li { @include rounded(top); }
3. How to Implement map for array in ruby?
def map
out = []
each { |e| out << yield(e) }
out
end