Part1 Software Engineering Basics
- How to create a Git remote branch? And how to delete it?
- What is git rebase and how can it be used to resolve conflicts in a feature branch before merge?
- What is Git Flow and GitHub Flow ? Briefly describe how it works.
Part2 Web Development Basics
- List at least 3 HTTP response codes, and describe their meanings.
- What is JSON format? What are the benefits of using it?
- When you click a link that directs to https://www.google.com/ , what would happen between the browser and the server? Please describe as much detail as you know.
Part3 Ruby on Rails
- Suppose that there is a resources :posts line in routes.rb , list all the 7 CRUD actions in the PostsController, and describe what they should do.
- Given an action controller in Rails as follows, what are the differences between statement (1) and (2)?
class PostsController < ApplicationController
def show
@length = 10_000 # (1)
length = 10_000 # (2)
end
end
- Given an action controller in Rails as follows, what are the differences between redirect_to (1) and render (2)?
class UsersController < ApplicationController
def create
@user = User.new(name : 'Joe', age: 31)
if @user.save
redirect_to root_path # (1)
else
render :new # (2)
end
end
end
- The method authenticate_user! will be used in all actions but index action, how do you modify the below code snippet?
before_action :authenticate_user!
- What’s the problem with the following statement? How would you fix it?
Post.where ("id = #{params[:post_id]}")