一亩三分地

 找回密码 注册账号

扫描二维码登录本站

BBS
Offer多多
Salarytics
交友
Learn
Who's Hiring?
Visa Tracker
疫情动态
指尖新闻
Instant
客户端
微信公众号
扫码关注公众号
留学申请公众号
扫码关注留学申请公众号
Youtube频道
留学博客
关于我们
查看: 897|回复: 10
收起左侧

[学Python/Perl] 新手上路 发资料 求大米 发一些自己找的LinkedIn Python Skill Quiz 题目 (带参考...

[复制链接] |只看干货 |刷题, 学python/perl
我的人缘0

升级   92.5%


分享帖子到朋友圈
本楼: 👍   100% (3)
 
 
0% (0)   👎
全局: 👍   97% (45)
 
 
2% (1)    👎
有同学反映在之前的帖子里加不了大米。。。可能是楼主发错地方了😂。。。现在再发一遍 这次带部分相关知识点 有的知识点没有😂因为还没全部整理完
这几天在油管上面和各大网站搜刮的linkedin Python Assessment Quizzes的题目 分享给大家 刚才考了一遍,所有题目都中了!!! Yeah!!!现在还在整理问题知识点和参考答案。如果评分+米到100(主要看各位看官有没有需要 毕竟也只是参考答案),我就把整理好的知识点和答案附件Post上来!麻烦各路大神给新手投喂几升大米~
(PS:我是知识的搬运工:
领英 Linkedin 是现在比较流行专业的求职社交网络, 最近它家推出了一个在线技能小测验, 通过了会在你的技能属性旁边加上个认证标记. 没通过也不会显示在你的主页上, 但是重新参加测验得三个月以后了.

每个小测验15题选择题, 15分钟内完成, 每题一分钟, 页面复制选择功能禁用了. 这个验证功能虽然没有什么含金量, 但至少是免费的, 温故而知新, 用来检验自己知识点的不足还是挺好的. 对于求职者来说, 通过测验可以增加自信. 猎头和HR或许也能更优先准确的挖掘人才.
https://justyy.com/archives/7124


1.        What is an abstract class?
Abstract classes are classes that contain one or more abstract methods. An abstract method is a method that is declared, but contains no implementation. Abstract classes cannot be instantiated, and require subclasses to provide implementations for the abstract methods. It can only be inherited.
抽象类是一个特殊的类,它的特殊之处在于只能被继承,不能被实例化。如果说类是从一堆对象中抽取相同的内容而来的,那么抽象类就是从一堆类中抽取相同的内容而来的,内容包括数据属性和函数属性。

2.        What happens when you use built-in function “any()” on a list?
any() 函数用于判断给定的可迭代参数 iterable 是否全部为 False。

3.         What data structure does a binary tree degenerate to if it isn’t balanced properly?
A degenerate tree is a tree where for each parent node, there is only one associated child node.

4. What is a static method?
•        A static method is also a method which is bound to the class and not the object of the class.
•        A static method can’t access or modify class state.
•        It is present in a class because it makes sense for the method to be present in class.
•        Static methods in Python are extremely similar to python class level methods, the difference being that a static method is bound to a class rather than the objects for that class. This means that a static method can be called without an object for that class.
静态方法,通过类直接调用,不需要创建对象,不会隐式传递self,和类本身没有交互,即在静态方法中,不会涉及到类中的方法和属性的操作。

5.         What are attributes?
(attributes are like properties, instances are like items)
Class attributes belong to the class itself they will be shared by all the instances. Such attributes are defined in the class body parts usually at the top, for legibility.
Unlike class attributes, instance attributes are not shared by objects. Every object has its own copy of the instance attribute (In case of class attributes all object refer to single copy).

6.        What is the difference between class attributes and instance attributes?
Class attributes belong to the class itself they will be shared by all the instances. Such attributes are defined in the class body parts usually at the top, for legibility. Unlike class attributes, instance attributes are not shared by objects. Every object has its own copy of the instance attribute (In case of class attributes all object refer to single copy).

7.        What is the term used to describe this code? Count, fruit, price = (2, ‘apple’, 3.5)
In packing, we place value into a new tuple while in unpacking we extract those values back into variables.

Python tuples are immutable means that they can not be modified in whole program. In Python there is a very powerful tuple assignment feature that assigns right hand side of values into left hand side. In other way it is called unpacking of a tuple of values into a variable. In packing, we put values into a new tuple while in unpacking we extract those values into a single variable.

# Program to understand about  
# packing and unpacking in Python

# this lines PACKS values (assignment)
# into variable a
a = ("MNNIT Allahabad", 5000, "Engineering")   

# this lines UNPACKS values
# of variable a
(college, student, type_of college) = a   

# print college name
print(college)

# print no of student
print(student)

# print type of college
print(type_ofcollege)


8. What built-in method would you use to remove items from a list?
listname.pop(index)

9. What is a runtime of accessing a value in a dictionary by using its key?
1.        if key in dict:
It’s O(n)
if you use:
1.        if dict.get(key):
It’s O(1)

10. What is the correct syntax of defining a class called Game?
11. What is a correct way to write a doctest?


12. What built-in python data type is commonly used to represent a stack?

14.  How does “defaultdict” work?
A defaultdict works exactly like a normal dict, but it is initialized with a function (“default factory”) that takes no arguments and provides the default value for a nonexistent key. A defaultdict will never raise a KeyError. Any key that does not exist gets the value returned by the default factory.

15. What is the correct  syntax for defining a class name “Game”, if it inherit from a parent class called “LogicGame”?
16. When would you use a “try/except” block?
The try and except block in Python is used to catch and handle exceptions. Python executes code following the try statement as a “normal” part of the program. The code that follows the except statement is the program's response to any exceptions in the preceding try clause.
17. Which of there is NOT a characteristic of “namedtuples”?
Python supports a type of container like dictionaries called “namedtuples()” present in module, “collections“. Like dictionaries they contain keys that are hashed to a particular value. But on contrary, it supports both access from key value and iteration, the functionality that dictionaries lack.
Operations on namedtuple():
Access Operations
1. Access by index: The attribute values of namedtuple() are ordered and can be accessed using the index number unlike dictionaries which are not accessible by index.
2. Access by keyname: Access by keyname is also allowed as in dictionaries.
3. using getattr() :- This is yet another way to access the value by giving namedtuple and key value as its argument.

18. What is an instance method?
A class is a user-defined blueprint or prototype from which objects are created. Classes provide a means of bundling data and functionality together. Creating a new class creates a new type of object, allowing new instances of that type to be made. Each class instance can have attributes attached to it for maintaining its state. Class instances can also have methods (defined by its class) for modifying its state.

19. What would happen if you did not alter the state of the element that an algorithm is operating on recursively?
Like the robots of Asimov, all recursive algorithms must obey three important laws:
1.        A recursive algorithm must have a base case.
2.        A recursive algorithm must change its state and move toward the base case.
3.        A recursive algorithm must call itself, recursively.


20. Which statement does NOT describe the object-orented programming concept of encapsulation?
21. What is the runtime complexity of searching for an item in a binary search tree?
22. What is the algorithmic paradigm of merge sort?
23. Why would you use a decorator?
Decorators allow you to define reusable building blocks that can change or extend the behavior of other functions. And they let you do that without permanently modifying the wrapped function itself. The function's behavior changes only when it's decorated.

24. Why would you use a mixin?
Mixins are a sort of class that is used to "mix in" extra properties and methods into a class. This allows you to create classes in a compositional style.
A mixin is a special kind of multiple inheritance. There are two main situations where mixins are used:
1.        You want to provide a lot of optional features for a class.
2.        You want to use one particular feature in a lot of different classes.

Mixins encourage code reuse and can be used to avoid the inheritance ambiguity that multiple inheritance can cause (the "diamond problem"), or to work around lack of support for multiple inheritance in a language. A mixin can also be viewed as an interface with implemented methods.


25. What is the runtime complexity of adding an item to a stack and removing an item from a stack?
26. What is the purpose of self keyword when defining or calling instance methods?
self represents the instance of the class. By using the “self” keyword we can access the attributes and methods of the class in python. It binds the attributes with the given arguments. The reason you need to use self. is because Python does not use the @ syntax to refer to instance attributes.

27. which choice is the most syntactically correct example of conditional branching?
28. What is the purpose of an if/else statement?
Python IF...ELIF...ELSE Statements. ... An else statement contains the block of code that executes if the conditional expression in the if statement resolves to 0 or a FALSE value. The else statement is an optional statement and there could be at most only one else statement following if.
29. Which of the following is true about how numeric data would be organized in a binary search tree?

30. Running time of the code?
def my_print(a_list, b_list):  
     for a in a_list:  
         for b in b_list:  
             print(a, b)

31. What is the definition of abstraction as applied to object-oriented Python?
32. What is a key difference between a set and a list?
33. What is the correct syntax for calling an instance method on a class named Game?
34. What is the runtime complexity of the list’s built-in .append() method?
35. What is the algorithmic paradigm of quick sort?
36. What is a class method?
37. What does it mean for a function to have a linear runtime?
38. What does the built-in map( ) function do?
39. What is the correct syntax for defining an _init_( ) method that takes no parameters?
A?
40. Which syntax correctly creates a variable that is bound to a tuple?
41. Suppose a Game class inherits from two parent classes: BoardGame and LogicGame. Which statement is true about the methods of an object instantiated from the Game class?

42. What does this function print?

def print _alpha_nums(abc_list, num_list):
for char in abc_list:
  for num in num_list:
   print(char, num)
return
print _alpha_nums([‘a’, ‘b’, ‘c’],[1, 2, 3])



补充内容 (2020-8-3 18:47):
友好回复的朋友们都会被加米哦~

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册账号

x

评分

参与人数 18大米 +25 收起 理由
wo94wo + 2 很有用的信息!
落破琴师 + 1 很有用的信息!
filegaran + 1 很有用的信息!
bryanjhy + 3 给你点个赞!
99887766 + 1 给你点个赞!
andrea_005 + 1 给你点个赞!
Fake/Random + 1 赞一个
wyfz123 + 1 赞一个
凤歌 + 1 赞一个
safun1995 + 1 谢谢分享!

查看全部评分


上一篇:Java 面试题总结_附带文档
下一篇:Compiler vs Formal Method 哪个对工作有用点
头像被屏蔽
我的人缘0
a2335356 2020-8-10 20:58:31 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

我的人缘0

升级   87.5%

safun1995 2020-8-5 10:05:10 | 显示全部楼层
本楼: 👍   100% (1)
 
 
0% (0)   👎
全局: 👍   100% (13)
 
 
0% (0)    👎
感谢,刚刚通过了考试

评分

参与人数 1大米 +1 收起 理由
德彪西 + 1 赞一个

查看全部评分

回复

使用道具 举报

我的人缘0

升级   44.57%

FinalLi 2020-8-3 11:31:12 | 显示全部楼层
本楼: 👍   100% (1)
 
 
0% (0)   👎
全局: 👍   75% (21)
 
 
25% (7)    👎
感谢楼主分享,大米已加!

评分

参与人数 1大米 +1 收起 理由
德彪西 + 1 赞一个

查看全部评分

回复

使用道具 举报

我的人缘0

升级   92.5%

本楼: 👍   0% (0)
 
 
0% (0)   👎
全局: 👍   97% (45)
 
 
2% (1)    👎
safun1995 发表于 2020-08-04 19:05:10
感谢,刚刚通过了考试
加个米吧~
回复

使用道具 举报

我的人缘0

升级   87.5%

本楼: 👍   0% (0)
 
 
0% (0)   👎
全局: 👍   100% (13)
 
 
0% (0)    👎
加了哈哈哈哈
回复

使用道具 举报

我的人缘0

升级   92.5%

本楼: 👍   0% (0)
 
 
0% (0)   👎
全局: 👍   97% (45)
 
 
2% (1)    👎
比心♥️~
回复

使用道具 举报

我的人缘0

升级   48.5%

本楼: 👍   0% (0)
 
 
0% (0)   👎
全局: 👍   100% (29)
 
 
0% (0)    👎
感谢楼主!

评分

参与人数 1大米 +1 收起 理由
德彪西 + 1 哈哈哈 那也麻烦加个米吧

查看全部评分

回复

使用道具 举报

我的人缘0

升级   92.5%

本楼: 👍   0% (0)
 
 
0% (0)   👎
全局: 👍   97% (45)
 
 
2% (1)    👎
哈哈哈 那也麻烦加个米吧
回复

使用道具 举报

我的人缘0

升级   54.5%

落破琴师 2020-9-9 08:30:39 | 显示全部楼层
本楼: 👍   0% (0)
 
 
0% (0)   👎
全局: 👍   100% (5)
 
 
0% (0)    👎
早知道就先查一下再做题的。下面要等到三个月吼了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号

本版积分规则

隐私提醒:
■为防止被骚扰甚至人肉,不要公开留微信等联系方式,请以论坛私信方式发送。
■特定版块可以超级匿名:https://pay.1point3acres.com/tools/thread
■其他版块匿名方法:http://www.1point3acres.com/bbs/thread-405991-1-1.html

手机版|||一亩三分地

Powered by Discuz! X3

© 2001-2013 Comsenz Inc. Design By HUXTeam

Some icons made by Freepik from flaticon.com

快速回复 返回顶部 返回列表