Skip to content

Instantly share code, notes, and snippets.

View vin-droid's full-sized avatar
🐢
Keep going

vinspro vin-droid

🐢
Keep going
View GitHub Profile
@vin-droid
vin-droid / rails-interview-questions-README.md
Last active September 13, 2019 04:36
Currently, I am searching for a job as a ruby on rails developer, I had many interviews and still going on hunting. I hope when you will be on the same track, these question will definitely help you to prepare for rails interview.

Rails Interview questions

lntro: Currently, I am searching for a job as a ruby on rails developer, I had many interviews and still going on hunting. I hope when you will be on the same track, these question will definitely help you to prepare for rails interview.  If you find some new question please comment here. For now I am adding just a list of questions but next, I will add solutions and links too.

Mostly Interviewer asks whatever you have mentioned in your resume/cv:

  • about your project
  • about your role in that project
  • gems which you used in the project
@vin-droid
vin-droid / flatten.rb
Last active September 24, 2019 12:03
flatten in ruby
## Q-2 Write a method which will flatten an Array?
arr = [1, [2, 3], [4]]
def flatten(arr)
flatten_arry = []
arr.each do |item|
if item.class == Array
flatten_arry += flatten(item)
else
flatten_arry << item
@vin-droid
vin-droid / gist:430fa72d8112cd777d42cc4cc4906ed0
Created September 24, 2019 12:04
count the number occurrence of a character in a string
## Q-1 Can write a method which will count the number occurrence of a character in a string?
## str = 'element'
def occurance(str)
str_arr = str.split('')
str_arr.inject({}) do |counter, i|
if counter.key?(i)
counter[i] +=1
else
counter[i] = 1

Vim commands

vim installation config in .vimrc Vim basic commands

  • show line number :set number
  • insert :i
  • save :w
  • quit :q
  • force quit :q!
  • save and quit :wq

ruby-training-plan

Plan for a training on Ruby language to new interns

Day's Schedule:

  • 2-3 hours of interactive training
  • Rest of the day:
    • few questions related to what was taught
    • a coding assignment
    • the interns will interact with their mentors throughout the day

Git Basics:

  • why?
  • what?
  • create a repo
  • adding, staging, commiting files locally
  • gitignore
  • Github, and pushing code to remote repos
  • branching
  • merge, merge conflicts

Jimmy is foodie and he visits Pune. He has X rupees with him. There are n number of hotels with different menu. Jimmy has list of all hotels with their menu and price with him.

Now instead of searching manually he wants to design a system to will give him a list of hotels that are under his budget.

Help Jimmy in writing the program.

Restaurant List:

  1. Box8
  • Rajma 30
### https://github.com/training-mode/ruby
https://github.com/sagarmuth/rails-learning
https://github.com/ministryofjustice/laa-ruby-learning-path
https://github.com/excid3/Rails-Learning