CIS 2750 COMPREHENSIVE EXAM QUESTIONS AND
ANSWERS MARKED A+
✔✔Object Oriented - ✔✔scripting languages can be difficult to manage for large
problems, OO attempts to address that
Functions are first class citizens (objects)
✔✔Javascript - ✔✔OO scripting language
browser based scripting
familiar structures, garbage collecting, support for OO, dynamic, weak type system
syntax is kinda like java except no basic print function
✔✔console.log() vs document.write() - ✔✔JS 'print' functions: first goes to console,
second goes to browser
✔✔Node.js - ✔✔basically a command line runtime environment for JS
helps support server side scripting
✔✔JS Function expressions - ✔✔arrow functions :
(param1, param2, ..., paramn)=>{statements}
(param1, param2, ..., paramn)=>expression
otherwise: function name(param1, param2, ... paramN){
statements
}
can define function inside of an expression, function argument, using function keyword
✔✔JS Variables - ✔✔only one numeric type: Number
let x = block level scope for x
var x = global/function scope for x
(DONT USE VAR)
✔✔FFI-NAPI - ✔✔Foreign Function Interface for N-API
for adding and loading dynamic libs using pure JS and Node.js API
can be used to wrap libs in pure JS
✔✔JSON - ✔✔JavaScript Object notation
JSON.parse() -- parse string return JS object
JSON.stringify() -- make string frm JSON object
✔✔JSON object - ✔✔unorderd set of name/value pairs
✔✔JSON values - ✔✔anything basically
, ✔✔JSON arrays - ✔✔ordered collection of values
✔✔HTML - ✔✔Hypertext Markup Language
describes how page is laid out
✔✔HTTP - ✔✔Hypertext Transfer Protocol
communications framework to navigate web servers pages
✔✔HTTP Protocol - ✔✔requests(methods) client can make to server
GET = request representation of resource
POST = submit entity to resource
✔✔Ajax - ✔✔helps JS access web server in the background
✔✔DOM - ✔✔Document Object Model
✔✔jQuery - ✔✔helps simplify client side scripting of HTML
$() to create jQuery objects
$.- prefixed utility functions
$ literally a shorthand for jQuery
✔✔$(document).ready() - ✔✔It's argument itself is a function, called when page loads
(like after kind of)
$(document).ready(function(){
console.log("page loaded");
});
✔✔Traditional Server Setup: LAMP - ✔✔Linux = host OS
Apache = HTTP Server
MySQL = database backend
PHP = server side scripting
✔✔Index.js - ✔✔all client side JS code
make an ajax call using an $.ajax() function
argument to it is an object:
- request type (get, post)
- data type (JSON, obj, text)
- URL (path) of endpoint
- additional data
- callback funcs for success, failure
✔✔App.js - ✔✔js side of server
ffi-napi lets you call c functions
essentially a series of callback functions
ANSWERS MARKED A+
✔✔Object Oriented - ✔✔scripting languages can be difficult to manage for large
problems, OO attempts to address that
Functions are first class citizens (objects)
✔✔Javascript - ✔✔OO scripting language
browser based scripting
familiar structures, garbage collecting, support for OO, dynamic, weak type system
syntax is kinda like java except no basic print function
✔✔console.log() vs document.write() - ✔✔JS 'print' functions: first goes to console,
second goes to browser
✔✔Node.js - ✔✔basically a command line runtime environment for JS
helps support server side scripting
✔✔JS Function expressions - ✔✔arrow functions :
(param1, param2, ..., paramn)=>{statements}
(param1, param2, ..., paramn)=>expression
otherwise: function name(param1, param2, ... paramN){
statements
}
can define function inside of an expression, function argument, using function keyword
✔✔JS Variables - ✔✔only one numeric type: Number
let x = block level scope for x
var x = global/function scope for x
(DONT USE VAR)
✔✔FFI-NAPI - ✔✔Foreign Function Interface for N-API
for adding and loading dynamic libs using pure JS and Node.js API
can be used to wrap libs in pure JS
✔✔JSON - ✔✔JavaScript Object notation
JSON.parse() -- parse string return JS object
JSON.stringify() -- make string frm JSON object
✔✔JSON object - ✔✔unorderd set of name/value pairs
✔✔JSON values - ✔✔anything basically
, ✔✔JSON arrays - ✔✔ordered collection of values
✔✔HTML - ✔✔Hypertext Markup Language
describes how page is laid out
✔✔HTTP - ✔✔Hypertext Transfer Protocol
communications framework to navigate web servers pages
✔✔HTTP Protocol - ✔✔requests(methods) client can make to server
GET = request representation of resource
POST = submit entity to resource
✔✔Ajax - ✔✔helps JS access web server in the background
✔✔DOM - ✔✔Document Object Model
✔✔jQuery - ✔✔helps simplify client side scripting of HTML
$() to create jQuery objects
$.- prefixed utility functions
$ literally a shorthand for jQuery
✔✔$(document).ready() - ✔✔It's argument itself is a function, called when page loads
(like after kind of)
$(document).ready(function(){
console.log("page loaded");
});
✔✔Traditional Server Setup: LAMP - ✔✔Linux = host OS
Apache = HTTP Server
MySQL = database backend
PHP = server side scripting
✔✔Index.js - ✔✔all client side JS code
make an ajax call using an $.ajax() function
argument to it is an object:
- request type (get, post)
- data type (JSON, obj, text)
- URL (path) of endpoint
- additional data
- callback funcs for success, failure
✔✔App.js - ✔✔js side of server
ffi-napi lets you call c functions
essentially a series of callback functions