avatar
关于python interview# JobHunting - 待字闺中
h*o
1
做了codecademy,感觉还不够。网上搜的interview题又都是概念性的。有没有什么容易
被面到的又有答案可参考的练习题可以加强一下。
不知道这个怎么样: codingbat.com
avatar
t*5
2
概念的话 如果有空 就看pro python吧
题目的话codecademy上的语法技巧基本上可以应付掉大部分的算法面试需要的语法了
直接刷题目cc150
leetcode之类的就行
avatar
h*o
3
我是想过用python刷leetcode的 (我其实正在用c++刷这些题)。但我脑子里还是 c/c
++ 的那一套。如果没有答案作参照的话,很可能python 写的和c++差不多。顶多用一
些list comprehension 代替for loop 而已。
谢谢回答。

【在 t********5 的大作中提到】
: 概念的话 如果有空 就看pro python吧
: 题目的话codecademy上的语法技巧基本上可以应付掉大部分的算法面试需要的语法了
: 直接刷题目cc150
: leetcode之类的就行

avatar
h*o
5
python 有现成的类似 c++ STL 的东西吗?
It is said in http://stackoverflow.com/questions/4637095/python-equivalent-for-c-stl-vector-list-containers
"There's no builtin linked list implementation in Python"
xiexie again

【在 t********5 的大作中提到】
: 有本书叫python altorithm还是什么的 你可以试试?我自己没看过 所以不知道靠不靠
: 谱。。。 我看的是pro python + 刷题
: http://www.amazon.com/Python-Algorithms-Mastering-Language-Expe

avatar
b*5
6
有啊:
a = []
a = {}
a = () (tuple, immutable)
这最简单了, 你愿意让他什么, 他就是什么。 你是去yelp interview么? yelp给
了我一个coding test, 我都他妈的懒的做。

【在 h**o 的大作中提到】
: python 有现成的类似 c++ STL 的东西吗?
: It is said in http://stackoverflow.com/questions/4637095/python-equivalent-for-c-stl-vector-list-containers
: "There's no builtin linked list implementation in Python"
: xiexie again

avatar
h*o
7
link list 怎么建?a = [1, [2, [3, None]]]?
是不是一般不大用tuple造数据结构啊? 因为没法改它啊。
我还没开始找工作那。yelp 用python面吗?为何懒的做?

【在 b**********5 的大作中提到】
: 有啊:
: a = []
: a = {}
: a = () (tuple, immutable)
: 这最简单了, 你愿意让他什么, 他就是什么。 你是去yelp interview么? yelp给
: 了我一个coding test, 我都他妈的懒的做。

avatar
t*5
8
代码很乱 凑合看=。=
"""
# 11.33
class Node(object):
def __init__(self, value = None, next = None):
self.value = value
self.next = next

class LinkedList(object):
def __init__(self):
self.head = None
self.size = 0

def __repr__(self):
result = []
tmp = self.head
while tmp is not None:
result.append(tmp.value)
tmp = tmp.next

return str(result)

def append(self, value):
node = Node(value)
if self.head is None:
self.head = node
return True
tmp = self.head
while tmp.next is not None:
tmp = tmp.next

tmp.next = node

def remove(self, value):
tmp = self.head
if tmp.value == value:
self.head = None
return True
last = tmp
tmp = tmp.next
while tmp is not None:
if tmp.value == value:
last.next = tmp.next
return True
else:
tmp = tmp.next
last = last.next
print 'Not Found!'
return False

def find(self, value):
index = 0
tmp = self.head
while tmp is not None:
if tmp.value == value:
print 'Find at index: ', index
return index
else:
tmp = tmp.next
index += 1

print 'Not Found!'
return False

def push(self, value):
if self.head is None:
return False
node = Node(value)
node.next = self.head
self.head = node

def pop(self):
if self.head is None:
return False

value = self.head.value
self.head = self.head.next
return value

if __name__ == '__main__':
l = LinkedList()
l.append(1)
l.append(2)
l.append(3)
l.append(4)
l.append(6)
print l
l.remove(3)
print l
l.find(2)
l.push(10)
l.push(11)
print l
print l.pop()
print l.pop()
print l.pop()
"""
avatar
h*o
9
知道了。
如果要用container, such as stl 中的vector,map,
就直接用[],{}表示。node, linklist 本身还是象c++那样写出来。
谢谢。

【在 t********5 的大作中提到】
: 代码很乱 凑合看=。=
: """
: # 11.33
: class Node(object):
: def __init__(self, value = None, next = None):
: self.value = value
: self.next = next
:
: class LinkedList(object):
: def __init__(self):

avatar
H*r
10
codingbat太简单了,给大一学生入门到。刚开始做一遍是可以的(有些题目比较重复
虽然)
avatar
h*o
11
我也发现了。谢谢

【在 H**r 的大作中提到】
: codingbat太简单了,给大一学生入门到。刚开始做一遍是可以的(有些题目比较重复
: 虽然)

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。