We interviewed nine companies, got 5 copies Offer

Click the above " Developer Technical frontline ", select the "star"

13:21 look at love


Source: KotlinPython   | Editor: Cocoa


From the end of August to start looking for a job, just a week more, we interviewed nine companies to get 5 parts Offer, probably because I've interviewed some of the companies are entrepreneurial companies now, but still have mixed feelings, because learning Python very short time, I did not expect fairly easy to find a job these days put the interview experience and share with you, hope to provide some help to learn Python little friends looking for work.

I feel the most important interview of two things: 1 project experience. 2. The project is consistent experience and Jobs, which is the most important, everything else is icing on the cake.

Self introduction

This is the first problem to send a sub-themes, the same years. However, some partners may not be too concerned about small, in fact, this issue already decided your fate intention in the minds of the interviewer. The main structure of self-introduction: basic personal information constitutes the basic technical + + project experience (as well as specific projects in the project is responsible for part) + self-evaluation, which is to focus on the principle of recruitment needs to do introduction. Prior to this preparatory work to do and see in what direction the recruiter R & D engineers specific needs. Currently for Python, pull hook on recruitment for the design and development of multi-platform automated testing, data mining and clean. Simply it seems to have no web development, web direction so the students attention, and operation and maintenance as well as multi-automation move closer.

Two-stage inquiry

In the course of the interview, when the interviewer to ask questions, often on the issue itself come out of deep-seated problems. For example: You used the statement with it? My answer is: with statements often for the occasion access to resources, ensuring that no matter abnormalities will refer performs the necessary cleanup has occurred during the visit, such as automatically closing the file and automatically obtain the release thread lock. Then the interviewer asked, do you know why that statement can be made with the correct file is closed, all of a sudden I asked bored, can only vaguely remember with statement opened up a stand-alone environment to execute access to the file, similar to the sandbox mechanism. The interviewer to answer noncommittal, be barely passed. So we know these to know why. In the usual course of study, ask a why, when the interview would not be too passive.

Do not give yourself digging

Make sure you are in the process of answering the interviewer, each knowledge point answers are clear in the chest, or being asked to live, is very embarrassing. In answer to my web security issues, said Shunzui SQL injection, the interviewer mentioned that since SQL injection, then you talk about its principles and solutions it! I was ashamed even to cross-site injection attacks XSS and SQL injection confused, and the scene is a little awkward. So every word you say, as appropriate, wise students can also guide the interviewer, let him ask the questions they want to be asked.

You will be asked to Redis, high concurrency solution

Interview a lot of companies will inevitably asked how much understanding Redis, high concurrency solutions. The author's answer is not very good.

This year you learn something new skills

This is the interviewer in the study if you have great enthusiasm for fresh technology. I interview the interviewer without exception asked this question. They are hoping to find a continuous learning, including open innovation of young people. Multi browse the latest technical information, select the field on the one hand they are interested in.

You can select as start-up companies or large companies like BAT, and why?

Which of course is to look at a company recruiter belongs to you, but start-up companies usually ask this question. The answer is simply: big challenge, enjoy the challenge; start-up companies with the possibility of unlimited success, want to grow together with the company;

Why do you want to leave the company?

这也是一个必问问题,找一个比较正当的理由,不要说什么公司零食太多胖了20斤,公司周别附近的外卖都吃腻了,真的别这样说…主要原则就是不要对前公司抱有怨言,BOSS朝令夕改,PM不靠谱什么的,多寻找自身原因:公司发展比较稳定,但我还年轻,希望有更大的挑战和更多的学习机会。像这样就可以。

描述一下你的上一家公司

这个问题问到的几率不太大,不过也还是有三家公司问到过,招聘方主要想从上一家公司的具体经营规模以及主营业务来定位你的水平,知道招聘方的目的就可以从容应答。

技术性问题

非技术性的问题就是以上这么多,作为参考稍加准备,面试的时候就能对答如流。下面讲一下在面试中的技术性问题。个人感觉技术性的问题面试官问的没有特别多,一般考察2-3个,由浅到深。


简述函数式编程

在函数式编程中,函数是基本单位,变量只是一个名称,而不是一个存储单元。除了匿名函数外,Python还使用fliter(),map(),reduce(),apply()函数来支持函数式编程。

什么是匿名函数,匿名函数有什么局限性

匿名函数,也就是lambda函数,通常用在函数体比较简单的函数上。匿名函数顾名思义就是函数没有名字,因此不用担心函数名冲突。不过Python对匿名函数的支持有限,只有一些简单的情况下可以使用匿名函数。

如何捕获异常,常用的异常机制有哪些?

如果我们没有对异常进行任何预防,那么在程序执行的过程中发生异常,就会中断程序,调用python默认的异常处理器,并在终端输出异常信息。

try…except…finally语句:当try语句执行时发生异常,回到try语句层,寻找后面是否有except语句。找到except语句后,会调用这个自定义的异常处理器。except将异常处理完毕后,程序继续往下执行。finally语句表示,无论异常发生与否,finally中的语句都要执行。

assert语句:判断assert后面紧跟的语句是True还是False,如果是True则继续执行print,如果是False则中断程序,调用默认的异常处理器,同时输出assert语句逗号后面的提示信息。

with语句:如果with语句或语句块中发生异常,会调用默认的异常处理器处理,但文件还是会正常关闭。

copy()与deepcopy()的区别

copy是浅拷贝,只拷贝可变对象的父级元素。deepcopy是深拷贝,递归拷贝可变对象的所有元素。

函数装饰器有什么作用(常考)

装饰器本质上是一个Python函数,它可以让其他函数在不需要做任何代码变动的前提下增加额外功能,装饰器的返回值也是一个函数对象。它经常用于有切面需求的场景,比如:插入日志、性能测试、事务处理、缓存、权限校验等场景。有了装饰器,就可以抽离出大量与函数功能本身无关的雷同代码并继续重用。

简述Python的作用域以及Python搜索变量的顺序

Python作用域简单说就是一个变量的命名空间。代码中变量被赋值的位置,就决定了哪些范围的对象可以访问这个变量,这个范围就是变量的作用域。在Python中,只有模块(module),类(class)以及函数(def、lambda)才会引入新的作用域。Python的变量名解析机制也称为 LEGB 法则:本地作用域(Local)→当前作用域被嵌入的本地作用域(Enclosing locals)→全局/模块作用域(Global)→内置作用域(Built-in)

新式类和旧式类的区别,如何确保使用的类是新式类

为了统一类(class)和类型(type),python在2.2版本引进来新式类。在2.1版本中,类和类型是不同的。

为了确保使用的是新式类,有以下方法:

放在类模块代码的最前面 __metaclass__ = type
从内建类object直接或者间接地继承
在python3版本中,默认所有的类都是新式类。

简述__new__和__init__的区别

创建一个新实例时调用__new__,初始化一个实例时用__init__,这是它们最本质的区别。

new方法会返回所构造的对象,init则不会.

new函数必须以cls作为第一个参数,而init则以self作为其第一个参数.

Python垃圾回收机制(常考)

Python GC主要使用引用计数(reference counting)来跟踪和回收垃圾。在引用计数的基础上,通过“标记-清除”(mark and sweep)解决容器对象可能产生的循环引用问题,通过“分代回收”(generation collection)以空间换时间的方法提高垃圾回收效率。

1 引用计数

PyObject是每个对象必有的内容,其中ob_refcnt就是做为引用计数。当一个对象有新的引用时,它的ob_refcnt就会增加,当引用它的对象被删除,它的ob_refcnt就会减少.引用计数为0时,该对象生命就结束了。

优点:

简单 实时性 缺点:

维护引用计数消耗资源 循环引用

2 标记-清除机制

基本思路是先按需分配,等到没有空闲内存的时候从寄存器和程序栈上的引用出发,遍历以对象为节点、以引用为边构成的图,把所有可以访问到的对象打上标记,然后清扫一遍内存空间,把所有没标记的对象释放。

3 分代技术

分代回收的整体思想是:将系统中的所有内存块根据其存活时间划分为不同的集合,每个集合就成为一个“代”,垃圾收集频率随着“代”的存活时间的增大而减小,存活时间通常利用经过几次垃圾回收来度量。

Python默认定义了三代对象集合,索引数越大,对象存活时间越长。

Python中的@property有什么作用?如何实现成员变量的只读属性?

@property装饰器就是负责把一个方法变成属性调用,通常用在属性的get方法和set方法,通过设置@property可以实现实例成员变量的直接访问,又保留了参数的检查。另外通过设置get方法而不定义set方法可以实现成员变量的只读属性。

*args and **kwargs

*args代表位置参数,它会接收任意多个参数并把这些参数作为元组传递给函数。**kwargs代表的关键字参数,允许你使用没有事先定义的参数名,另外,位置参数一定要放在关键字参数的前面。

有用过with statement吗?它的好处是什么?具体如何实现?

with语句适用于对资源进行访问的场合,确保不管使用过程中是否发生异常都会执行必要的“清理”操作,释放资源,比如文件使用后自动关闭、线程中锁的自动获取和释放等。

what will be the output of the code below? explain your answer

def extend_list(val, list=[]):
list.append(val) return list

list1 = extend_list(10)
list2 = extend_list(123, [])
list3 = extend_list('a')

print(list1) # list1 = [10, 'a']print(list2) # list2 = [123, []]print(list3) # list3 = [10, 'a']class Parent(object):
x = 1class Child1(Parent):
passclass Child2(Parent):
passprint(Parent.x, Child1.x, Child2.x) # [1,1,1]Child1.x = 2print(Parent.x, Child1.x, Child2.x) # [1,2,1]Partent.x = 3print(Parent.x, Child1.x, Child2.x) # [3,2,3]

在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。

 
  

arr = [[1,4,7,10,15], [2,5,8,12,19], [3,6,9,16,22], [10,13,14,17,24], [18,21,23,26,30]]def getNum(num, data=None):
while data: if num > data[0][-1]: del data[0]
print(data)
getNum(num, data=None) elif num < data[0][-1]:
data = list(zip(*data)) del data[-1]
data = list(zip(*data))
print(data)
getNum(num, data=None) else: return True
data.clear() return Falseif __name__ == '__main__':
print(getNum(18, arr))

获取最大公约数、最小公倍数

a = 36b = 21def maxCommon(a, b):
while b: a,b = b, a%b return adef minCommon(a, b):
c = a*b while b: a,b = b, a%b return c//aif __name__ == '__main__':
print(maxCommon(a,b))
print(minCommon(a,b))

获取中位数

 
  

def median(data):
data.sort()
half = len(data) // 2
return (data[half] + data[~half])/2l = [1,3,4,53,2,46,8,42,82]if __name__ == '__main__':
print(median(l))

输入一个整数,输出该数二进制表示中1的个数。其中负数用补码表示。

 
  

def getOneCount(num):
if num > 0:
count = b_num.count('1')
print(b_num) return count elif num < 0:
b_num = bin(~num)
count = 8 - b_num.count('1') return count else: return 8if __name__ == '__main__':
print(getOneCount(5))
print(getOneCount(-5))
print(getOneCount(0))

That is all I interview process that asked questions, arithmetic problem is still relatively small, only two companies asked to write algorithms, data structures seem to be asked is not particularly large, and asked to structure a B + tree. Asked database is an index related to optimization. Somewhat basic can answer up, but the best you can explore the deep-seated.

This article only initiate purposes, some insight is not particularly mature, hoping to provide some help to learn Python partners looking for a job, the interview process among the most important point is the flat state of mind, is that both sides of the job search process, does not require too much tight, put their knowledge to fully express it enough. As long as you are horses Maxima, horses will be sooner or later led out for a walk in.

END

Developer Technical frontline, bringing together technology industry trends and concerns of front-line newsletter, dry goods manufacturers, is an excellent guide developers experience and growth.

Reading history


Python and find yourself a suitable sister

Who leaked the rumor? I have spent a Flutter

Learn not move, Jingdong cross-end mobile development platform Ares released!

640? 640?wx_fmt=gif 640?wx_fmt=png Like a good-looking, right on the point 640?wx_fmt=gif

Guess you like

Origin blog.csdn.net/DevolperFront/article/details/90725397