Skip to content

Instantly share code, notes, and snippets.

@mhamzawey
mhamzawey / get_max.py
Last active December 17, 2018 22:18
Get the maximum number in an array that is increasing then decreasing.
def get_max(arr, start, end):
# arr of size 1
if start == end:
return arr[start]
#arr of size 2, first element is larger than the second
if start == end + 1 and arr[start] >= arr[end]:
return arr[start]
#arr of size 2, second element is larger than the first
if end == start + 1 and arr[start] < arr[end]:
return arr[end]
Trufla Challenge
DevOps Engineer
# Task
Write a Python function which takes the text from the file `data.txt` and outputs a list with all words from the text and the count of their occurrences, ordered by the occurrences.
The result should look like `result.txt`.
# Rules
- Delemiters should be excluded
Trufla Challenge
Backend Engineer
The multi website offers
We have multiple websites for online shopping. We need to create a website that has can be considered as a hub for the deals/offers from multiple website on a single platform.
The specifications:
You will need to collect the information for your website from other web sources There are plenty of resources you can draw, for example:

Please create a schedule movie seeder from https://www.themoviedb.org, they should: Api Application

1. Create schedule that runs every {configrable_interval_timer} that Seeding the recently movies including the related categories with {configrable_moves_nums} for example seed 100 movie
2. Store the movies and categories using mysql database
3. List the movies
4. Can filter the result by some parameters for example filter by category id /movies?category_id=5
5. Can sort the result by some parameters for example sort by most popular movies and highest rated /movies?popular|desc&rated|asc

Client Application Create dashboard that show the following

@mhamzawey
mhamzawey / Python Challenge.md
Created October 31, 2018 11:18
Trufla Python Challenge

Trufla Challenge

Backend Engineer

The multi website offers

We have multiple websites for online shopping. We need to create a website that has can be considered as a hub for the deals/offers from multiple website on a single platform.

The specifications: