<jupyter_start><jupyter_text>Phone Screen**This phone screen will consist of a non-technical series of questions about you and the company, and then a second half of a simple technical question to be coded out**___ Non-Technical Questions**Answer the following questions (2-5 minute responses) technical answers not required, more interested in hearing about your reasoning** * Give me some quick background about you (go over your resume)* Why do you want to work here?* What's your favorite programming language and why?* Where do you see yourself in 5 years?* Do you have any questions about the company for me?  SolutionThere aren't really any "correct" answers here, just make sure you're prepared to answer the following questions about the company you're interviewing with. Be honest, friendly and  ready to defend any statements you make with logical arguments to back them up. Note, you should ALWAYS have follow-up questions. ___ Technical Questions**Answer the following question in the *Markdown* cell below. It's important to note that the cell below does NOT have syntax highlighting, its common in a phone screen interview to be given a text editor hich doesn't have anything more than basic text support**1. Write a function that computes the Nth fibonacci number  SolutionThere's many ways to answer this question, you might be required to solve it multiple ways and discuss some pros and cons of each way. Listed below are various solutions<jupyter_code>## Example 1: Using looping technique
def fib(n):
    
    a,b = 1,1
    for i in range(n-1):
        a,b = b,a+b
    return a

print fib(7)
    
# Using recursion    
def fibR(n):
    if n==1 or n==2:
        return 1
    return fib(n-1)+fib(n-2)

print fibR(7)
 
## Example 3: Using generators
a,b = 0,1
def fibI():
    global a,b
    while True:
        a,b = b, a+b
        yield a
f=fibI()
f.next()
f.next()
f.next()
f.next()
f.next()
f.next()
print f.next()

 
## Example 4: Using memoization
def memoize(fn, arg):
    memo = {}
    if arg not in memo:
        memo[arg] = fn(arg)
    return memo[arg]
 
## fib() as written in example 1.
fibm = memoize(fib,7)
print fibm
 
## Example 5: Using memoization as decorator
class Memoize:
    def __init__(self, fn):
        self.fn = fn
        self.memo = {}
    def __call__(self, arg):
        if arg not in self.memo:
            self.memo[arg] = self.fn(arg)
            return self.memo[arg]
 
@Memoize
def fib(n):
    a,b = 1,1
    for i in range(n-1):
        a,b = b,a+b
    return a
print fib(7)<jupyter_output>13
13
13
13
13
{'fraction_non_alphanumeric': 0.08248631743549648, 'fraction_numerical': 0.014073494917904612, 'mean_word_length': 3.3299492385786804, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '374671', 'license': 'MIT', 'n_tokens_mistral': 795, 'n_tokens_neox': 752, 'n_words': 356, 'path': 'all_notebooks/21-24-Mock Interviews/Large Search Engine Company_/Phone Screen.ipynb', 'repo_name': 'robjpar/pdsa', 'size': '2558'}