Skip to content

Instantly share code, notes, and snippets.

@GA-MEB
Last active January 6, 2016 21:21
Show Gist options
  • Save GA-MEB/fcc78a5e765823e5b936 to your computer and use it in GitHub Desktop.
Save GA-MEB/fcc78a5e765823e5b936 to your computer and use it in GitHub Desktop.

Web Development Immersive :: Pre-work Assessment

INSTRUCTIONS

You have 60 minutes to complete this quiz - please open this form in a new tab and submit your answers there.

Q-01

What would happen if someone entered the following command into the bash terminal? `rm -r ~/GA_Projects`

Q-02

Suppose your present working directory is `/Users/someuser/Desktop/images`. What command(s) could you enter into the terminal to display all files (including hidden ones) in `Desktop`?

Q-03

Explain the difference between relative and absolute addresses in a filesystem. When might it be important to use one vs the other?

Q-04

Please describe the difference between a client and a server in the context of loading a webpage.

Q-05

Consider the following CSS. ```CSS .class1 { font-size: 10px; } .class2 { color: yellow; font-size: 75px; } div p { color: blue; font-size: 50px; } p { color: red; } #specialP { color: orange; font-style: italic; } ``` For the following HTML code, what will be the color and size of "HELLO WORLD"? Why? ```HTML

HELLO WORLD

```

Q-06 to Q-11

Consider the following Ruby code. It uses a tool called `Pry` to pause the program at specific points, called "breakpoints". ```ruby require 'pry' # Include Pry in our program.

a = 14 b = 25 a = b - a binding.pry # First breakpoint c = 4 d = 7 e = c + d c = 1 binding.pry # Second breakpoint f = (g = 2) + 1 g = (f == 2) binding.pry # Third breakpoint h = true if !h i = 23 else i = 11 end binding.pry # Fourth breakpoint j = 3 def f(x) 2*x end j = f(j) + f(f(j)) + f(f(f(j))) binding.pry # Fifth breakpoint while a > 0 puts "Hello" a -= 2 end

<h3>Q-06</h3>
What are the values of `a` and `b` when the program hits the first breakpoint? Why?
<h3>Q-07</h3>
What are the values of `c`, `d` and `e` by the second breakpoint? Why?
<h3>Q-08</h3>
What are the values of `f` and `g` by the third breakpoint? Why?
<h3>Q-09</h3>
What are the values of `h` and `i` by the fourth breakpoint? Why?
<h3>Q-10</h3>
What is the value of `j` by the fifth breakpoint? Why?
<h3>Q-11</h3>
By the end of the program, what is the final value of `a`, and how many times has "Hello" been printed to the terminal?

<h3>Q-12</h3> 
Write a method in Ruby called "type_it_x_times" that takes in a number `X` as input and **returns** a string containing that number `X` times in a row. Assume `X` will always be greater than or equal to 1.

e.g. <br />
```ruby
type_it_x_times(1)
 => "1"
type_it_x_times(4)
 => "4444"
type_it_x_times(7)
 => "7777777"

Q-13

GitHub provides a workflow for creating a new repository: ```markdown 1. touch README.md 2. git init 3. git add README.md 4. git commit-m "first commit" 5. git remote add origin git@github.com:some_username/some_repo.git 6. git push -u origin master ``` Describe what each command does, line by line.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment