General Flashcards

1
Q

what is scope?

A

Scope refers to where a variable or function is accessible in your program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does JSON stand for?

A

Javascript object notation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is JSON?

A

JSON is a language-independent data interchange format, because of it’s simple text-based data structure is similar to that found in most popular programming languages, it makes it very good for communicating data between services.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

why do we use JSON?

A

its data structure is very similar to that found in most programming languages so it’s easy to parse and create JSON objects in most languages, making it a good data interchange format. it’s also very human-readable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

describe the JSON structure

A

JSON is built on two structures, a collection of key-value pairs and a collection of values. python supports very primitive data types.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is AJAX?

A

AJAX is a set of technology; It is a technique of dynamically updating parts of UI without having to reload the page.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

how does AJAX work?

A

in Ajax, the request are sent to the server by using XMLHttpRequest objects. The response is used by javascript code to dynamically alter the current page.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are cookies?

A

Cookies send(sets) state information to a users browser, and returns the state information to the origin site when requested. This state information can be anything, from authentication, identification, shopping cart information, account information. Prone to manipulation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a session

A

a session is much like a cookie in the sense that it stores/set state information. The only difference is that it stores it in a session file on the server side instead of th e browser, and its generally more secure. Sessions expire when the user closes the browser. We often use cookies to set session ids.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is object-oriented programming?

A

Object oriented programming is a programming style where your program is broken down into smaller self contained code called objects. objects are defined by classes and contain all the attributes that describe the state of the object and methods to describe the behavior of the object. We put these smaller units of code together to construct larger program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the core fundamentals of OOP? hint P.E.A.I

A

Polymorphism, Encapsulation, Abstraction, Inheritance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is Unicode?

A

Unicode is an international encoding standard that encapsulates written language and symbols from around the world.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is utf-8?

A

utf-8 is a type of encoding. a way of storing the code points of Unicode in a byte form.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the difference between synchronous and asynchronous

A

Synchronous execution refers to code executing in sequence. Asynchronous execution refers to execution that doesn’t run in the sequence it appears in the code.

An example of a aysnc non-blocking server is Node

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the difference between blocking and non-blocking

A

Blocking refers to operations that block further execution until that operation finishes. Non-blocking refers to code that doesn’t block execution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Synchronous, blocking example

A

An example of synchronous, blocking operations is how some web servers like ones in Java or PHP handle IO or network requests. If your code reads from a file or the database, your code “blocks” everything after it from executing. In that period, your machine is holding onto memory and processing time for a thread that isn’t doing anything.

In order to cater other requests while that thread has stalled depends on your software. What most server software do is spawn more threads to cater the additional requests. This requires more memory consumed and more processing.

17
Q

Asynchronous, non-blocking example

A

Asynchronous, non-blocking servers - like ones made in Node - only use one thread to service all requests. This means an instance of Node makes the most out of a single thread. The creators designed it with the premise that the I/O and network operations are the bottleneck.

When requests arrive at the server, they are serviced one at a time. However, when the code serviced needs to query the DB for example, it sends the callback to a second queue and the main thread will continue running (it doesn’t wait). Now when the DB operation completes and returns, the corresponding callback pulled out of the second queue and queued in a third queue where they are pending execution. When the engine gets a chance to execute something else (like when the execution stack is emptied), it picks up a callback from the third queue and executes it.

18
Q

What is an injection attack

A

An injection attack is when a malicious user injects commands into an application in order to change it’s behaviour.