Skip to content

Instantly share code, notes, and snippets.

View sajjadmurtaza's full-sized avatar
🎯
Focusing

Sajjad Murtaza sajjadmurtaza

🎯
Focusing
View GitHub Profile

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.

@sajjadmurtaza
sajjadmurtaza / gist:ff0e472b02f8dd7e486f
Last active January 26, 2016 12:14
Component is not injecting in index.html file using grunt-wiredep
#boer.json
{
"name": "dc-customer-portal-spa",
"authors": [
"Sajjad Murtaza <myemail>"
],
"description": "",
"main": "",
@sajjadmurtaza
sajjadmurtaza / included_resource_params.rb
Last active June 29, 2017 21:28
TrustYou - Ruby Developer Screening
##____________ 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
# http://jsonapi.org/format/#fetching-includes for additional details although
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|
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
def find_final_one(list, g)
count = 0
last_precision = 0
last_recall = 0
target = []
list.each do |list|
count = (count + g.select { |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
@sajjadmurtaza
sajjadmurtaza / basic_router.jsx
Created October 27, 2020 20:02 — forked from siakaramalegos/basic_router.jsx
Basic example of React Router: BrowserRouter, Link, Route, and Switch
// BrowserRouter is the router implementation for HTML5 browsers (vs Native).
// Link is your replacement for anchor tags.
// Route is the conditionally shown component based on matching a path to a URL.
// Switch returns only the first matching route rather than all matching routes.
import {
BrowserRouter as Router,
Link,
Route,
Switch,
} from 'react-router-dom';
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:dfpvideo="http://api.google.com/dfpvideo">
<channel>
<title>Delta MRSS feed</title>
<description>Published Videos from Vox Media's Volume</description>
<pubDate>Mon, 05 Jun 2017 15:48:14 +0000</pubDate>
<atom:link rel="self" href="https://staging3-volume.voxmedia.com//feed/delta-mrss-feed/index.xml?page=1"/>
<openSearch:totalResults>7</openSearch:totalResults>
<openSearch:startIndex>1</openSearch:startIndex>
require 'nokogiri'
require 'open-uri'
# Get a Nokogiri::HTML:Document for the page we're interested in...
doc = Nokogiri::HTML(open('http://www.google.com/search?q=tenderlove'))
# Do funky things with it using Nokogiri::XML::Node methods...
####