Table of Contents
AS3/Flex
Garbage Collection
1. What is reference counting?
- when you create a reference you increment its reference counter, when it is deleted you decrement the counter.
2. Advantages/Disadvantages of reference counting?
- (pro) simple methodology for knowing when to garbage collect
- (pro) doesn't carry huge CPU overhead
- (con) not optimal for circular referencing
- circular referencing is the situation when objects cross-reference each other (directory or indirectly)
Python
0. Does spacing and indentation matter in Python?
1. what are some common types of collections?
-- tuple, list, dict, set
What's the difference between tuple, list, dict, set?
What can be types can be used as keys in a dictionary? (any immutable type)
How do you slice a list? How do you remove something from a list? dictionary?
2. what's the type of 'x'?
x = (1)
3. what is tuple unpacking and how do you do it?
4. Which option gives the output "01234"?
a) [num for num in xrange(5)]
b) .join([num for num in xrange(5)])
c) .join([num for num in xrange(5)])
d) .join(['num' for num in xrange(5)])
5) how do you read the lines of a file?
6) which python library would you use to get the absolute path of a directory?
-- os.path (specifically call the os.path.abspath function)
7) whats the syntax for handling a variable list of arguments? key/value arguments?
-- *args -- **kwargs
8) Does python provide exception handling? how do you handle an exception?
-- can you handle more than one type of exception in a single "except" statement? -- how do you handle all exceptions?
9) what are decorators?
-- dynamically alter the functionality of a function,method or class without using subclasses or changing source code)
def audit(f, *args, **kwargs):
def new_f(*args, **kwargs):
print 'before', f.name
f(*args, **kwargs) print 'after', f.name
new_f.name = f.name return new_f
@audit def greet(name):
print 'Hello', name
9) Do you test python code? how? does python provide anything to help unit test your code?
-- python includes the unittest library (aka PyUnit?) -- has test case (unittest.TestCase?) and test suites, etc -- just like JUnit
Django
1) have you used django? any other python web frameworks? compare likes/dislikes
-- what are some of the features it provides?
ORM, automatic admin interface, "pretty URL's", template system, caching system, internationalization
2) What is MVC? How does Django do MVC?
-- MTV (model-template-view),
-- why "view" and not "controller"?
view describes which data you see, not how you see it)
3) What does the Django admin functionality provide?
-- can create users, groups -- create, edit, delete instances of your models (do have to register them with the "admin")
4) What is ORM? How does Django provide ORM?
-- ORM (object relational mapper) provides a database abstraction API -- models all have a "Manager" called "objects"
Database
1) If you have a many-to-many relationship, how many tables would you have?
MySQL
1) From the command line, how do you list the databases in a MySQL instance?
show databases;
2) From the command line, how do you select a DB to use?
use <db name>;
3) From the command line, how do you list the tables in the selected database?
show tables;
4) From the command line, how do you list the details of a table (i.e. column names, types, etc)?
describe <table name>;
Troubleshooting
1. User is getting an error, "can't connect to <DB type here>" message, what do you do first?