Skip to content

Instantly share code, notes, and snippets.

@sourabh-upadhyay
Last active August 16, 2017 07:14
Show Gist options
  • Save sourabh-upadhyay/7b53ab16e5ef9f045737d934b16af947 to your computer and use it in GitHub Desktop.
Save sourabh-upadhyay/7b53ab16e5ef9f045737d934b16af947 to your computer and use it in GitHub Desktop.
Ruby on Rails interview questions

Ruby

  • What is eigenclass ?

  • Module and class (difference and when to use)?

  • 'class_evel', 'module_eval' and 'instance_eval'(explain and difference, when to use)?

  • Difference between 'each' and 'map'.

  • Difference between 'find' and 'select'.

  • 'delegate' in ruby.

  • Single qoute('') vs Double qoute ("")

  • Bang operate(!) differences.

  • instance variable vs Class variable?

  • Is ruby pure OOPS?

  • extend Vs include?

  • Difference between multiple and multi level inheritence?

  • How to implement multiple inheritence?

  • Super keyword?

  • instance method Vs class method?

  • Public class method?

  • What is block?

  • How do you create proc?

  • difference between symbol and string.

  • variable VS symbol.

  • Write a program to print this pattern N = 7. So value of N is dynamic. If N is 6 or 5 then it should scale accordingly

    7

    7 6

    7 6 5

    7 6 5 4

    7 6 5 4 3

    7 6 5 4 3 2

    7 6 5 4 3 2 1

    7 6 5 4 3 2

    7 6 5 4 3

    7 6 5 4

    7 6 5

    7 6

    7


Rails Questions


DB

  • Advantages of MongoDB

SQL

EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY JOINING_DATE DEPARTMENT_ID
1 Michel Clarke 1000000 01-JAN-14 11.00.00 AM 1
2 Ricky Charma 800000 05-JAN-14 11.00.00 AM 2
3 Michel Farma 700000 05-FEB-14 11.00.00 AM 3
4 Lasith Karma 600000 03-APR-14 11.00.00 AM 1
5 Trish Dharma 650000 15-JUNE-14 11.00.00 AM 2
6 Mike Sharma 700000 04-AUG-14 11.00.00 AM 4
7 Lees Monte 650000 02-SEP-14 11.00.00 AM 4
8 Clees Clarke 600000 03-NOV-14 11.00.00 AM 3

Table NameDepartment

DEPARTMENT_ID DEPARTMENT_NAME
1 Programming
2 Billing
3 TestingG
4 Sales
5 Designing

Get department name and department wise average salary from employee and department table order by salary ascending?

Desired output

Dept Name Avg Salary / Dept
Programming 200000
Billing 100000
TestingG 800000
Sales 900000
Designing 400000

Javascrip/Jquery

  • Difference between 'find' and 'closest'
  • bind Vs live

HR

  • What is determination
  • If you would have a conflicts with co-worker related to one solution, your solution is good then what will you do?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment