Chris Kenyon Interview questions WDI-09
GENERAL
-
Last week, the 24-hour hackathon was a tough time with 2 sick members and the 3rd not responding at night or showing up for the presentation. I scrambled to put together the functional pieces and offer some explanations in class, without accusing anyone else of being absent. I think the "judges" were happy with seeing something on the screen that worked. I focused on a distraction - the funny jobs that could result from searches. Coding isn't all about the code, sometimes the presentation matters.
-
I enjoy coding because I'm creating something. Taxes were not about doing anything outside the guidelines, but there's naturally a lot of different ways to code a simple project. I also like the teamwork with everyone accepting each other taking some time to learn things or pass off tasks that are suited for someone else. Accounting work was rarely about teamwork, since WIP time was supposed to be shorter.
-
During the hackathon, we struggled with a few problems. Early on, the database was not connecting with our program. It existed, it had info, but now it wasn't working. Sean looked and found the node_modules just needed an update. Later, the url wouldn't link up in a Href anchor tag, so I looked at some examples in Stack Overflow. I keep the working class copies active to quickly see examples.
-
Considerations? Too many to write.
-
Preferred dev environment? I'm not sure yet, beyond wanting to get away from coworker avoidance like accounting. I want real reviews, which are limited in accounting for many reasons.
-
Version controls? (SEARCH)
-
Workflow - I like the quick wireframe and chart start that we learned but didn't use in class much. We used it in projects, and we did much more brainstorming early with tech needs & questions to make sure we didn't dive too far into the project to get away from a bad decision that couldn't be fixed within the 1 week deadline (or wherever we were on the timeline). We used trello boards to keep track of all tasks abd avoid conflicts.
Order of tasks usually went by: function needs, then style.
-
5 Css partial stylesheets in a folder, if it gets larger then it's safest to keep them separate with a comparison top-level document (comments? control file with order of load priority?)
-
Progressive Enhancement is building a website with functionality on a low level to make sure that all or most browsers can handle it, and then building up from there.
Graceful degredation is when a computer keeps limited functionality when something breaks down. One example is with operating systems "safe mode" - when the full OS has a problem, the safemode allows the user to take a look at basic functions to see what broke if it wasn't clear.
-
Slideshow - caravel? That was an early bootstrap project. No frameworks? OK, make a slides folder to fill, your "projector" is the script that goes through those and controls timing, and the style (size, background) is also separate.
-
Master a tech? Not sure.
-
Standards/Standard Bodies? Standards are stylistic tendencies - simple. modularized. Standards bodies are the organizations that oversee this???
HTML
-
Doctype gets
-
HTML/XHTML (SEARCH) XML syntax is more strict XHTML includes the Ruby module
-
data-- attributes
-
Cookie- stored client side to re-open SessionStorage - client side, removed when session closes localStorage - server side, saved not expiring
-
Link/Script positions depend on the dependencies (JS for Jquery, Angular for Angular Attachement scripts). After that, the other pages or modules may often depend on those being loaded before any body calls, and the connecting pages go above the body. Scripts can go at the bottom if they exempt from a lot of these cases, but it really shouldn't happen if there's good attention to test cases.
CSS
-
Classes vs IDs - it's better for classes to apply to multiple instances, IDs for singles.
-
Reset vs Normalize - reset wipes all the default browser styles, normalize provides a starting point for them.
-
Floats - decimal numbers that take much more space than an int. Doublefloats.
-
z-content
-
grid system? like bootstrap?
-
Yes, media queries. Mobile-1st is often pushed as better in our class, but a lot of my current sites are made out of expediency. I'm always working on this, but styling is less than functionality at this point in my work.
JS
-
Event delegation
-
"this" works by "$scope", IT ALLOWS CHANGES TO variables within an environment, with child layers going down. "this.number" can be passed along in the object that made it, or a parent object.
-
Prototype inheritance - the constructor, not the objects, pass along info that is passed into the constructor (param differences)
-
Ternary expression - three parts
-
Null Undef Undeclared How to tell/check?
-
A closure is
-
Typical use case for anonymous functions?
-
function Person(){} - this function creates Person-functions that probably create person objects. var person = Person() - this makes a person var person = new Person()
-
.call .apply
-
Function.protoype.bind ??
-
feature detection, feature inference User Agent string
-
AJAX - database changing calls(sends - delete, post) DETAIL
-
Templates -
-
Hoisting ??
-
Event bubbling?
-
Attribute Property
-
Why not extend built-in js objects?
-
== vs === , it's about truthiness, the Stephen Colbert political meter.
-
Same-origin policy in JS?
-
Promises and their polyfills?
-
Promises - stuff.get(function() {
}) Multiple callback functions need to be nested.
Promises - stuff.get().then(function() {
})
This is more prominent as a standard, and gets cleaner code with the .then and chain on multiple promises instead of nesting them.
-
Tools for debugging JS code?
DATABASE
- Facebook, 4 models, attributes, 1:M, M:M
User Post Comment Messages
Ruby/Rails
-
Gems are installation dependencies
-
Symbol String
-
Class method Instance Method
-
Local class instance variables
-
Range
-
att_accessor
-
env files in config folder
-
application.rb file
-
define a constant
-
yield
-
storing API keys
-
send params through a url
-
MVC
-
before_action
-
controllers in rails?
-
RESTful routing
-
polymorphic association
-
params
-
make a migration to add a column
-
CSRF, protect against?
TESTING:
-
Testing ADVANTAGES - lots. DISADS - not much, time,
-
Tools for testing - this depends on the program. We used some in class
-
Unit test is for small pieces or modules of code. Function/integration test if for multiple scripts or holistic testing of links.
-
Code style linting tool
-
End-to-end testing applies to the whole app working.
INDIVIDUAL CODE TECHNICAL
Var foo = 10 + '20'; // what is the value of foo
//both return 7
add(2, 5) add(2)(5)
"i'm a lasagna hog".split("").reverse().join("");
var foo = "Hello"; (function() { var bar = " World"; alert(foo + bar); })(); alert(foo + bar);
var foo = []; foo.push(1); foo.push(2); //what is foo.length
var foo = {n: 1}; var bar = foo; foo.x = foo = {n: 2}; ///what is foo.x
console.log('one'); setTimeout(function() { console.log('two'); }, 0); console.log('three'); //what does this print
FUN QUESTIONS:
-
Cool project - the stolen bike app - useful, teamwork, inspiring
-
Pet projects - phazermole, bike steal app connections,