{"id":27990329,"url":"https://github.com/adlerhsieh/interview","last_synced_at":"2025-05-08T16:25:08.752Z","repository":{"id":50406663,"uuid":"61762213","full_name":"adlerhsieh/interview","owner":"adlerhsieh","description":"A tool for interviewing Ruby \u0026 Rails developers","archived":false,"fork":false,"pushed_at":"2017-03-10T10:45:17.000Z","size":61,"stargazers_count":60,"open_issues_count":0,"forks_count":14,"subscribers_count":8,"default_branch":"master","last_synced_at":"2023-03-27T18:09:00.487Z","etag":null,"topics":["interview","rails","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adlerhsieh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-23T01:08:51.000Z","updated_at":"2023-01-11T16:50:02.000Z","dependencies_parsed_at":"2022-09-09T05:10:22.270Z","dependency_job_id":null,"html_url":"https://github.com/adlerhsieh/interview","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adlerhsieh%2Finterview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adlerhsieh%2Finterview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adlerhsieh%2Finterview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adlerhsieh%2Finterview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adlerhsieh","download_url":"https://codeload.github.com/adlerhsieh/interview/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253104017,"owners_count":21854777,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["interview","rails","ruby"],"created_at":"2025-05-08T16:25:07.883Z","updated_at":"2025-05-08T16:25:08.726Z","avatar_url":"https://github.com/adlerhsieh.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Interview\n\nThis project serves to evaluate developers' proficiency in Ruby \u0026 Rails. \n\n## How Does It Help?\n\nInterviees are expected to clone this project and enter its interactive console for two types of tests:\n\n1. Read a piece of code, and name the returned value by evaluating the code.\n2. Read the specifications, and write a method to fulfill the specs.\n\nAlso, start the `rails server` if the they are expected to debug several Rails problems. Interviers can sit by the interviewees to see how they handle the problems.\n\nThe interactive console looks like this:\n\n![](http://i.imgur.com/yRox8fB.gif)\n\n## Ready for the Interview?\n\n### Installation\n\nClone:\n\n```\ngit clone https://github.com/adlerhsieh/interview.git\ncd interview\n```\n\nSetup:\n\n```\nbundle install\n```\n\n### Part 1: Name the Returned Value\n\nRun: \n\n```\nrake questions\n```\n\nwhich brings you to an interactive console. You will see several pieces of code. Input the returned values for each code piece. Type `Exception` if you expect an exception.\n\nOther commands:\n\n1. Use `exit` to exit.\n2. Use `skip` to skip a question.\n\n### Part 2: Write a Method\n\nRun: \n\n```\nrake methods\n```\n\nwhich brings you to another interactive console. Write methods in one line and fulfill the instructions.\n\nEach submission triggers `rspec` to run tests against the submitted code. Make them pass to move on to the next method.\n\nOther commands:\n\n1. Use `exit` to exit.\n2. Use `skip` to skip a method.\n\n### Part 3: Debugging Rails\n\nSetting up db is necessary for this part. Run:\n\n```\nrake db:migrate\nrake db:seed\n```\n\nStart `rails server` and open root `/` in the browser. The interviewee should solve these problems:\n\n1. The posts should display a default avatar, which is their authors' first character of their name. They are missing. Fix it.\n2. Enter the post with `(Slow Post)` text. It reveals the performance issue for this app. Don't modify the layout and improve its performance.\n3. When creating a `Post` with the `New post` button, the `content` is always blank. Make sure the content is correctly displayed in `posts#show`.\n\n### Part 4: Rails feature requests\n\nIntended for more senior candidates after debugging part 3. These are time consuming, so approach is more important than implementation. Encourage dialogue while discussing different approaches.\n\n1. Allow authors to optionally tag new posts.\n2. Paginate posts with an option size no less than 10 and no greater than 100 per page.\n3. Filter blog posts by author, date created, tags, and title.\n4. Full text search posts, comments, and user names\n\n## Other Interview Stuff\n\n1. [Some common Interview Questions](https://github.com/adlerhsieh/interview/blob/master/lib/README.md)\n2. The whole test takes about 1.5 hour based on my experience. It is suggested that interviers only assign necessary tests.\n\n## Customization\n\nQuestions and methods are customizable in `lib` directories. They follow a simple set of rules.\n\n### Questions\n\nAdd files in `lib/questions` directory. Name the file `0`, `1`, `2` and so on. Every file will be process in order of their filename. \n\nDo not add too many blank lines around the code. They will be displayed too.\n\nExample:\n\n```\na = 'foo'\nb = 'bar'\n\na + b\n```\n\nIf the filename is `lib/questions/0.rb`, it will be processed as the first question.\n\n### Methods\n\n#### Code\n\nAdd files in `lib/questions` directory.The specifications are:\n\n1. Name the file `0`, `1`, `2` and so on. Every file will be process in order of their filename. \n2. Each file is written with 2 parts: `instruction` and `method`. `Instruction` describes the purpose of this method, and `method` is for the interviewee to understand where the code is inserted.\n2. Use `# method` to separate instructions and method.\n3. Use `# code` to indicate which part the interviewees' code are inserted.\n4. You can either comment out instructions or not. They will not be evaluated.\n\nExample:\n\n```ruby\n# Create a method that returns the sum of x and y.\n# \n# Example: \n# \n#     plus(1, 1)\n#     # =\u003e 2\n#     plus(2, 3)\n#     # =\u003e 5\n#     plus(5, 5)\n#     # =\u003e 10\n\n# method\ndef plus(x, y)\n  # code\nend\n```\n\n#### Spec\n\nAlso, this project implements `RSpec` as the test framework. You need to add specs in `spec/lib/methods` in order to make sure interviewees' methods fulfill a specific standard.\n\nPlease add `require 'interview_helper'` at the beginning of every spec file.\n\nExample:\n\n```ruby\nrequire 'interview_helper'\n\ndescribe '#plus' do\n  it { expect(plus(1, 1)).to eq 2 }\n  it { expect(plus(2, 3)).to eq 5 }\n  it { expect(plus(5, 5)).to eq 10 }\nend\n```\n\n### Pull requests and issues are welcome\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadlerhsieh%2Finterview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadlerhsieh%2Finterview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadlerhsieh%2Finterview/lists"}