User:Jimmy Novik/Technical Interviews

=JavaScript Perks= =Approaching a Problem= 1. Make sure you understand what input should produce what output (meaning you understand the problem) 2. Break the problem into components that have to be present (for mergesort it is "devide", "sort" and "merge") 3. Go through the inputs inductively ([], [one element], [two elements], etc)
 * 1) jQuery .click wants nameless function as a callback (e.g. .click(myFunction) would execute over and over without clicking)

Example
=Hosting=

Shared Hosting
Less common nowadays, as one physical server rarely hosts multiple apps logically incoherently.

Virtual Private Server
Virtual machines emulate physical servers and act as ones logically, but physically live on a single server.

Dedicated Server
Abstracted infrastructure. Usually not clear what physical storage is underneath. It is all on demand and abstract. =Python: Strings & Files=

Reading in File
with open('workfile', 'r') as f:   read_data = f.read

JSON
json.dump(x, f) x = json.load

Create Array of Strings from a String
str.split

Convert Array of Strings to Array of Ints
results = map(int, results)

Convert Array to a String with Delimiters
"-+=+-".join(str(e) for e in test)

Print Generated Tables
for x in range(1, 11): print('{0:4d} {1:4d} {2:4d}'.format(x, x*x, x*x*x))

Justify Parts of Strings
'{:<20} {}'.format('## execute', 'Execute an IRC command') // Justify Left str.center(40, 'a') // Justify Center

Zip to Arrays and Enumerate them
alist = ['a1', 'a2', 'a3'] blist = ['b1', 'b2', 'b3']

for i, (a, b) in enumerate(zip(alist, blist)): print i, a, b