Skip to content

Commit 185cfaa

Browse files
committed
Created initial folder structure and wrote out initial readme documentation for tasks.
0 parents  commit 185cfaa

4 files changed

Lines changed: 167 additions & 0 deletions

File tree

README.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Python Developer Assessment
2+
3+
The aim of this Python assessment is to see how experienced a Python developer is. The test is not a binary pass / fail test. It assess where someone is on the Junior, Mid, Senior scale. It should be seen as a validation process and there are no right or wrong answers to solve the tasks defined.
4+
5+
There are four tasks to complete based around a list of dictionaries which represent pseudo data for website URLs. Each task aims to test a developer's ability to manipulate and edit a list of data.
6+
7+
The data can be found in the `/websites/resouces/data.py` file.
8+
9+
The data structure is as follows:
10+
11+
```python
12+
[
13+
{
14+
"name": "Google",
15+
"url": "https://www.google.co.uk",
16+
"domain": "google.co.uk",
17+
"secure": True,
18+
"value": 5,
19+
},
20+
{
21+
"name": "Facebook",
22+
"url": "https://developers.facebook.com/blog/post/2018/10/02/facebook-login-update/",
23+
"domain": "facebook.com",
24+
"secure": True,
25+
"value": 4,
26+
}
27+
]
28+
```
29+
30+
## Tasks
31+
32+
### Task One: Find Data
33+
34+
Find and return a new list of data where each item's value key is equal to or greater than four.
35+
36+
**Example:** The below dictionary should be one of the items returned in the new list.
37+
38+
```python
39+
{
40+
"name": "Facebook",
41+
"url": "https://developers.facebook.com/blog/post/2018/10/02/facebook-login-update/",
42+
"domain": "facebook.com",
43+
"secure": True,
44+
"value": 4,
45+
}
46+
```
47+
48+
### Task Two: Amend Data
49+
50+
Amend the list so each domain key value is prepended with the string `www.`
51+
52+
**Example:** An amended dictionary should look like this.
53+
54+
```python
55+
{
56+
"name": "Facebook",
57+
"url": "https://developers.facebook.com/blog/post/2018/10/02/facebook-login-update/",
58+
"domain": "www.facebook.com",
59+
"secure": True,
60+
"value": 4,
61+
}
62+
```
63+
64+
### Task Three: Cleanse Data
65+
66+
Some of the data is inaccurate, the secure key is set to False when the url key contains a url beginning with `http://`. The opposite is also true in some cases.
67+
68+
The list should be cleansed and returned so the secure keys are accurate.
69+
70+
**Example:** The below dictionary should be amended to look as follows. It's current state is secure equals false even though the url key contains `https://`.
71+
72+
```python
73+
{
74+
"name": "Bing",
75+
"url": "https://www.bing.com/search?q=athlete&qs=n&form=QBLH&sp=-1&pq=athlete&sc=8-7&sk=&cvid=53830DD7FB2E47B7A5D9CF27F106BC9A",
76+
"domain": "bing.com",
77+
"secure": True,
78+
"value": 3,
79+
}
80+
```
81+
82+
### Task Four: Data Calculation
83+
84+
Add up all the value keys in the list and return an integer.
85+
86+
**Example:** If we added up the below value keys we'd get an integer of 9.
87+
88+
```python
89+
[
90+
{
91+
"name": "Google",
92+
"url": "https://www.google.co.uk",
93+
"domain": "google.co.uk",
94+
"secure": True,
95+
"value": 5,
96+
},
97+
{
98+
"name": "Facebook",
99+
"url": "https://developers.facebook.com/blog/post/2018/10/02/facebook-login-update/",
100+
"domain": "facebook.com",
101+
"secure": True,
102+
"value": 4,
103+
}
104+
]
105+
```

websites/__init__.py

Whitespace-only changes.

websites/resources/__init__.py

Whitespace-only changes.

websites/resources/data.py

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
'''
2+
A list of dicts containing data on website urls.
3+
'''
4+
5+
WEBSITES = [
6+
{
7+
"name": "Google",
8+
"url": "https://www.google.co.uk",
9+
"domain": "google.co.uk",
10+
"secure": True,
11+
"value": 5,
12+
},
13+
{
14+
"name": "Facebook",
15+
"url": "https://developers.facebook.com/blog/post/2018/10/02/facebook-login-update/",
16+
"domain": "facebook.com",
17+
"secure": True,
18+
"value": 4,
19+
},
20+
{
21+
"name": "Bing",
22+
"url": "https://www.bing.com/search?q=athlete&qs=n&form=QBLH&sp=-1&pq=athlete&sc=8-7&sk=&cvid=53830DD7FB2E47B7A5D9CF27F106BC9A",
23+
"domain": "bing.com",
24+
"secure": False,
25+
"value": 3,
26+
},
27+
{
28+
"name": "Ask",
29+
"url": "https://uk.ask.com/web?o=0&l=dir&qo=serpSearchTopBox&q=jupiter",
30+
"domain": "ask.com",
31+
"secure": False,
32+
"value": 1,
33+
},
34+
{
35+
"name": "Duck Duck Go",
36+
"url": "http://duckduckgo.com/?q=plane&t=h_&ia=web",
37+
"domain": "duckduckgo.com",
38+
"secure": True,
39+
"value": 2,
40+
},
41+
{
42+
"name": "Vimeo",
43+
"url": "https://vimeo.com/53812885",
44+
"domain": "vimeo.com",
45+
"secure": False,
46+
"value": 2,
47+
},
48+
{
49+
"name": "YouTube",
50+
"url": "https://www.youtube.com/watch?v=09Cd7NKKvDc",
51+
"domain": "youtube.com",
52+
"secure": True,
53+
"value": 5,
54+
},
55+
{
56+
"name": "Daily Motion",
57+
"url": "http://www.dailymotion.com/search/football",
58+
"domain": "dailymotion.com",
59+
"secure": True,
60+
"value": 1,
61+
}
62+
]

0 commit comments

Comments
 (0)