SWE 645 FINAL EXAM QUESTIONS WITH VERIFIED
ANSWERS
Basic python variables - Answers - str (string), int, float, boolean
Python Collections - Container data types - Answers - List, dictionary, tuple, set
Comprehension
Comprehension in Python - Answers - used to create a new built-in data structure like a
list, a dictionary or a set from an existing data structure
three types of comprehension - Answers - List
Set
Dictionary
how python syntax differs from java - Answers - python doesn't have the semi colon
python relies on indentation rather than curly braces it uses x spaces for indentations as
long as its consistent (even a tab)
python doesn't declare the data type
python conditionals use a : (colon) rather than a curly brace
python 3 onward uses print(x) instead of print x
Syntax requires ____ after if, for, while, function def, etc. - Answers - : COLON
Python uses indentation instead of - Answers - {}, to specify blocks of code
Data science libraries add new data types to Python - Answers - - ndarray (NumPy)
- Series (Pandas) and
- DataFrame (Pandas)
Sequence of characters in 'single' or "double quotes" - Answers - string literals
'Hello' is same as "Hello" in python - Answers - True
Strings are immutable - Answers - Once assigned a value to a string, it can't be mutated
or changed.
mystring = 'hello'
mystring[0] = 'z' - Answers - Error: item assignment not supported by str object
SQL is optimized for - Answers - storage
NoSQL is optimized for - Answers - Compute
, NoSQL is - Answers - Denormalized/hierarchical
Instantiated views
scale horizontally
Built for OLTP at scale
SQL is - Answers - Normalized/relations
Ad hox queries
Scale vertically
Good for OLAP
Partition key - Answers - uniquely identifies item
used for building an unordered hash index
allows table to be partitioned for scale
Partition sort key - Answers - uses two attributes together to uniquely identify an item
within unorded hash index data is arranged by the sort key
no lmimit on the number of items per partition key
Local secondary index - Answers - alternate sort key atribute
index is local to partition key
Global Secondary Index - Answers - Alternate partition and/or sort key
index is accross all partition keys
GSI update - Answers - 1. update request from client to table
2. update response from table to client
2(contd). asynchronous update (in progress from table to GSI)
what happens if GSI dont have enough write capacity - Answers - the tables will be
throtled
when to use LSI - Answers - LSI can be modeled as a GSI
if data size in an item collection is > 10GB - Answers - use GSI
if eventual consistency is ok for your scenario - Answers - use GSI
Scaling is based on - Answers - throughput and size
Throughput - Answers - Provision any amount of thorughput to a table
size - Answers - add any number of items to a tables
max item size - Answers - 400kb
LSI limit the number of range keys due to a _____lmit - Answers - 10gb
ANSWERS
Basic python variables - Answers - str (string), int, float, boolean
Python Collections - Container data types - Answers - List, dictionary, tuple, set
Comprehension
Comprehension in Python - Answers - used to create a new built-in data structure like a
list, a dictionary or a set from an existing data structure
three types of comprehension - Answers - List
Set
Dictionary
how python syntax differs from java - Answers - python doesn't have the semi colon
python relies on indentation rather than curly braces it uses x spaces for indentations as
long as its consistent (even a tab)
python doesn't declare the data type
python conditionals use a : (colon) rather than a curly brace
python 3 onward uses print(x) instead of print x
Syntax requires ____ after if, for, while, function def, etc. - Answers - : COLON
Python uses indentation instead of - Answers - {}, to specify blocks of code
Data science libraries add new data types to Python - Answers - - ndarray (NumPy)
- Series (Pandas) and
- DataFrame (Pandas)
Sequence of characters in 'single' or "double quotes" - Answers - string literals
'Hello' is same as "Hello" in python - Answers - True
Strings are immutable - Answers - Once assigned a value to a string, it can't be mutated
or changed.
mystring = 'hello'
mystring[0] = 'z' - Answers - Error: item assignment not supported by str object
SQL is optimized for - Answers - storage
NoSQL is optimized for - Answers - Compute
, NoSQL is - Answers - Denormalized/hierarchical
Instantiated views
scale horizontally
Built for OLTP at scale
SQL is - Answers - Normalized/relations
Ad hox queries
Scale vertically
Good for OLAP
Partition key - Answers - uniquely identifies item
used for building an unordered hash index
allows table to be partitioned for scale
Partition sort key - Answers - uses two attributes together to uniquely identify an item
within unorded hash index data is arranged by the sort key
no lmimit on the number of items per partition key
Local secondary index - Answers - alternate sort key atribute
index is local to partition key
Global Secondary Index - Answers - Alternate partition and/or sort key
index is accross all partition keys
GSI update - Answers - 1. update request from client to table
2. update response from table to client
2(contd). asynchronous update (in progress from table to GSI)
what happens if GSI dont have enough write capacity - Answers - the tables will be
throtled
when to use LSI - Answers - LSI can be modeled as a GSI
if data size in an item collection is > 10GB - Answers - use GSI
if eventual consistency is ok for your scenario - Answers - use GSI
Scaling is based on - Answers - throughput and size
Throughput - Answers - Provision any amount of thorughput to a table
size - Answers - add any number of items to a tables
max item size - Answers - 400kb
LSI limit the number of range keys due to a _____lmit - Answers - 10gb