Should I go back to college for linear algebra/mathematics or is college a scam even for math-related degrees?
I've no idea about the usefulness of a degree but you can learn everything you can learn in a generic "college" on the online for free. Linear algebra is way easier than programming, the fucky parts of it are those which are programming-related (precision errors and shit).
STORYTIEM
(DISCLAIMER: this is not my current job, my current job is awesome)
I worked with a Data Scientist!!!! who'd studied and worked in Data Science!!! in Japan!!!!!
We needed to find "distances" between pairs of vectors and pick n smallest pairs (the actual numerical value did not matter).
An actual "linear" distance between two generic vectors is computationally expensive because it involves the square root.
However, what we had were unit vectors, each with a length of 1. A much cheaper proxy for distance in that case is the scalar product (multiply dimensions pairwise then sum up).
sp == 1: identical (distance 0). sp == 0.5: 60 degrees (distance 1). sp == 0: perpendicular (distance sqrt(2) = 1.414...). sp == -1: opposite (distance 2).
THEY (mostly the boss) FUCKING FOUGHT ME AND WON
NO WE AREN'T GOING TO USE YOUR INVENTED FAKE MATH, WE WILL USE THE TESTED LIBRARY FUNCTION
(That was the place I pulled an epic stunt when I quit.)
^ This is mostly how not-retarded you have to be. You can learn this faster than you can get
admitted to college.
Don't listen to this guy, this is why people are signing up for shit like Stack Overflow.
Stack Overflow has been shat up for ages. When I look up Django questions (how to do an operation in a database), I get python answers. "How to sort in this particular complicated way and pick the top 3" lolololol just pull ten million records into python and sort there, list.sort, very easy, tee hee, don't forget to mark my answer as accepted! For the last six years or more, Stack Overflow has only been helpful to me to solve problems with package incompatibility.
Even just knowing stuff on the level of (!a && !b) == !(a || b)
can really change how you think about and approach certain problems.
^ this.
These are the questions I used in a (python) coding interview:
1. What's NAND, a.k.a. the Sheffer stroke? (idgaf if you don't know, here's what it is: <splain>).
Now, using only NAND, implement a few other logical operations (btw which ones do you know?)
2. What's an eigenvalue of a matrix, in your own words?
3. Write a class, `A`, that on initialization takes a number and saves it into a field. No need to validate that it's a number or anything, this is prep work, it's not a trick question.
Expected result:
Python:
class A:
def __init__(self, x):
self.x = x
Now make it so that you can add instances of the class, so that the following line doesn't throw an error -- btw what does
assert do?
Python:
assert A(1) + A(1) == A(2)
(if can't magic, go to question 4, then come back)
on success:
Will it work with floats, I wonder? and with multiple additions? Let's check!
Python:
assert A(0.1) + A(0.1) + A(0.1) == A(0.3)
oops it broke, top kek
What's wrong?
4. What does this code do? (This is not a trick question, this code is verbatim from a real package.)
Python:
class ErrorDetail(str):
code = None
def __new__(cls, string, code=None):
self = super().__new__(cls, string)
self.code = code
return self
def __eq__(self, other):
result = super().__eq__(other)
if result is NotImplemented:
return NotImplemented
try:
return result and self.code == other.code
except AttributeError:
return result
def __ne__(self, other):
result = self.__eq__(other)
if result is NotImplemented:
return NotImplemented
return not result
def __repr__(self):
return 'ErrorDetail(string=%r, code=%r)' % (
str(self),
self.code,
)
def __hash__(self):
return hash(str(self))
(full points and no need to elaborate further if he knows where it's from, otherwise talk about magic methods, hashes, new vs init, string formatting, etc).
5. Which DBMSes are you familiar with?
There are 52 cards in a card deck, 13 of each of 4 suits, ace-two-three-...-ten-jack-queen-king.
I draw a few cards out of the deck and get a "set". Just like in a python set, the order doesn't matter, what matters is all of them are in my hand.
Propose a method of storing card sets in a database.
if mysql and sets: "cool, but we're using postgres in this project, we don't have sets, how'd you do it here?"