Skip to content

Instantly share code, notes, and snippets.


Sajjad Murtaza sajjadmurtaza

Block or report user

Report or block sajjadmurtaza

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View find_final_one.rb
def find_final_one(list, g)
count = 0
last_precision = 0
last_recall = 0
target = []
list.each do |list|
count = (count + { |g| list == g }.count).to_f
precision, recall = (count/list.count.to_f).to_f, (count/10).to_f
target << list if precision >= last_precision and recall >= last_recall
View schema_matching.rb
def schema_matching(imdb, rt, g)
list = []
imdb.each do |imdb_column_name|
d = 999
rt.each do |rt_column_name|
distance = (0..rt_column_name.length).select { |k| imdb_column_name[k] != rt_column_name[k] }.count
distance = distance + (imdb_column_name.length-rt_column_name.length).abs if imdb_column_name.length != rt_column_name.length
list << ["imdb.#{imdb_column_name}", "rt.#{rt_column_name}"] if distance <= imdb_column_name.length/2 and distance < d
View di_schema_machining_algo_implementation.rb
imdb = ["Id", "Name", "YearRange", "ReleaseDate", "Director", "Creator", "Cast", "Duration", "RatingValue", "ContentRating", "Genre", "Url", "Description"]
rt = ["Id", "Name", "Year", "ReleaseDate", "Director", "Creator", "Actors", "Cast", "Language", "Country", "Duration", "RatingValue", "RatingCount", "ReviewCount", "Genre", "FilmingLocations", "Description"]
g = [["imdb.Name", "rt.Name"],["imdb.YearRange", "rt.Year"],["imdb.ReleaseDate", "rt.ReleaseDate"],["imdb.Director", "rt.Director"],["imdb.Creator", "rt.Creator"],
["imdb.Cast", "rt.Cast"],["imdb.Duration", "rt.Duration"],["imdb.RatingValue", "rt.RatingValue"],["imdb.Genre", "rt.Genre"],["imdb.Description", "rt.Description"]]
list = []
target = []
imdb.each do |imdb_column_name|
sajjadmurtaza / included_resource_params.rb
Last active Jun 29, 2017
TrustYou - Ruby Developer Screening
View included_resource_params.rb
##____________ Soultion Description _________________
## ruby 2.4
## Just download or copy the code and run following command to test it.
## ruby included_resource_params.rb
## ____________ Task Description _______________________________________
# The IncludedResourceParams class is responsible for parsing a string containing
# a comma separated list of associated resources to include with a request. See
# for additional details although
sajjadmurtaza / gist:ff0e472b02f8dd7e486f
Last active Jan 26, 2016
Component is not injecting in index.html file using grunt-wiredep
View gist:ff0e472b02f8dd7e486f
"name": "dc-customer-portal-spa",
"authors": [
"Sajjad Murtaza <myemail>"
"description": "",
"main": "",
View gist:d2599d240d8bf5e2bc89

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

You can’t perform that action at this time.