Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 96 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,96 @@
The Assingment is divided into 2 sets - Tasks and Features.
Candidates are free to implement any single or multiple task.
Features are optional and hence are not mandatory, but implementing it would increaes their weighted in interview.

Candidates must not use any 3rd party library. Assingment will not be evaluated if 3rd party library is used


1. Go to https://exchangeratesapi.io/
This website will provide you data regarding the exchange rate for various curriencies.
You have to use the REST End point exposed by https://exchangeratesapi.io/ to get the required data for the assingment.
Your task is to
- [T-1] Plot the graph of INR exchange rate against USD from 1 Jan 2019 to 31 Jan 2019.
- [T-2] Plot the graph of INR and GBP exchange rate against USD from 1 Jan 2019 to 31 Jan 2019.
- [T-3] Plot the graph of INR and GBP exchange rate against USD from 1 Jan 2019 to 31 Jan 2019 and also indicate current rate for INR and GBP on graph itself.

Nice to have feature
- [F-1] - Make date range dyanamic so that we can select our own date range
- [F-2] - Make selection of currency symbol dyanamic, so we can choose any currency and graph should update accordingly.


- You can chosse any graph style as per your choice but it should represent data in meaningfull way.


[ Find the video link which describe the below propcess: ]
1. You must fork this empty git repository.
- Github link : https://github.com/winsoft-technologies/2020-interns
2. Once you forked it they you clone their own copy on your machines and can start coding.
3. You have to do periodic commits, so that we can track the code development process.
4. Once you are done, you have to generate the pull request into the main github repo from where you have cloned. (https://github.com/winsoft-technologies/2020-interns)
5. While generating pull request make sure your title discribe what you have done....
For Example:
A candidate who have implemet only task 1 should have title
[T - 1] - <some short discription>

A candidate who have implemet only task 1 and 2 should have title
[T - 1 - 2] - <some short discription>

A candidate who have implemet only task 1 and Feature 1 should have title
[T - 1 - F - 1] - <some short discription>

A candidate who have implemet only task 1,2 and Feature 1,2 should have title
[T - 1 - 2 - F - 1-2] - <some short discription>
6. Only first "n" pull requested will be evaluated.
7. If any copy is found then both candidates will be disqulified.
8. Candidate attempting more task and feature will obiviously take more time than the one implemting single task,
hence top "n" will be shortlistied accordingly, so dont be in hurry if you fell confident try implementing more Task and Feature to make your candidature more solid.
### ROUND 1: ASSIGNMENT (SUBMISSON IN GIT HUB)

`Deadline of submission of assignment = Wednesday, 22nd July 2020 @ 12 Noon`

- No submission after 22nd July 20; 12 Noon will be considered
- Higher weightage will be given to candidates with early submission {the earliest, the better}

#### Please find below the path to proceed for 1st ROUND of evaluation –

- This is an assignment submission round.
- The Assignment is divided into 2 sets - Tasks and Features.
- Candidates are free to implement any single or multiple tasks.
- Features are optional and hence are not mandatory, but implementing it would increase their weighted in
an interview.
- Candidate attempting more tasks and features will obviously take more time than the one implementing
single task, hence the candidates will be shortlisted accordingly, so don't be in a hurry if you feel confident try
implementing more Task and Feature to make your candidature more solid.
- If any copy is found then both candidates will be *disqualified*.


`IMPORTANT NOTE-``

**Candidates must not use any 3rd party library. The assignment will not be evaluated if the 3rd party library is used**

`PART 1 - ASSIGNMENT DETAILS`
- Draw a graph which represents the performance of currencies over a period of time
- The data to plot the graph can be found in `data.json` file in the Github repository
`Github link : https://github.com/winsoft-technologies/2020-interns`



##### Your work is to submit any one or all of the below mentioned tasks

`Applicable to [T1], [T2], and [T3]: Historic data can be found using data.json file`
- `[T-1]` Plot the graph of INR exchange rate against EUR from 1 Jan 2019 to 31 Jan 2019
- `[T-2]` Plot the graph of INR and GBP exchange rate against EUR from 1 Jan 2019 to 31 Jan 2019.
- `[T-3]` Plot the graph of INR and GBP exchange rate against EUR from 1 Jan 2019 to 31 Jan 2019 and also indicate
the current rate for INR and GBP on the graph itself. (You will get latest rates in the latest-rates.json file)
- `[T-4]` Replace the data.json file with the data from the Rest EndPoint exposed at https://exchangeratesapi.io/
> - This website will provide you data regarding the exchange rate for various currencies.

> - You have to use the REST Endpoint exposed by https://exchangeratesapi.io/ to get the required data for the
Assignment.


#### Nice to have features-
- `[F-1]` - Make date range dynamic so that we can select our own date range
- `[F-2]` - Make selection of currency symbol dynamic, so we can choose any currency and the graph should
update accordingly.You can choose any graph style as per your choice but it should represent data in a
meaningful way.


### PART 2- HOW TO DO IT?

- Find the video link which describes the below process:
https://drive.google.com/file/d/1WHOFewqLn9VZeanQX4VTf6vWyaN9nUWC/view?usp=sharing]

STEPS TO FOLLOW-
1. You must fork this empty Git repository

> Github link: https://github.com/winsoft-technologies/2020-interns

2. Once you forked it then you have to clone your own copy on your machines and can start coding.
3. You have to do periodic commits (no bulk commits), so that we can track the code development process.
4. Once you are done, you have to generate the pull request into the main GitHub repo from where you have
cloned. (https://github.com/winsoft-technologies/2020-interns)
5. While generating pull requests make sure your title describes what you have done....

`For Example:`

- A candidate who has implemented only task 1 should have the title

`[T - 1] - <some short discription>`

- A candidate who has implemented only task 1 and 2 should have the title

`[T - 1 - 2] - <some short discription>`

- A candidate who has implemented only task 1 and Feature 1 should have the title

`[T - 1 - F - 1] - <some short discription>`

- A candidate who has implemented only task 1,2 and Feature 1,2 should have the title

`[T - 1 - 2 - F - 1-2] - <some short discription>`

#### NOTES:
1. Candidate sending first will get higher preference
> Candidate attempting more tasks and features will obviously take more time than the one implementing single task, hence the candidates will be shortlisted accordingly, so don't be in a hurry if you feel confident try implementing more Task and Feature to make your candidature more solid.

2. Don't commit in bulk, do small commit so that we can see the code development process.

3. `IMPORTANT`

- In pull request comment add your contact details, so that we can easily reach you
> mention you full name, college name, email id and mobile number.
58 changes: 58 additions & 0 deletions T-1 F-1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!DOCTYPE HTML>
<html>
<head>
<script>
window.onload = function() {
var dates = []
for (var i = 0; i < data.length; i++){
dates.push(data['rates'][i]);
}
var specified_date = [];
for (var i = 0; i < dates.length; i++){
var arr = d.split("-");
var month_index = parseInt(arr[1],10) - 1;
if(month_index == 1){
specified_date.push(i);
}
}
specified_date.sort();
eur_exchange = []
for (var i = 0; i < specified_date.length; i++){
eur_exchange.push(data['rates'][i]['INR']);
}
for (var i = 0; i < specified_date.length; i++) {
dataPoints.push({
x: specified_date,
y: eur_exchange
});
}
}
var ctx = document.getElementById('myChart').getContext('2d');
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: specified_date,
datasets: [{
label: '# of Votes',
data: eur_exchange,
borderWidth: 1
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero: true
}
}]
}
}
});
</script>
</head>
<body>
<canvas id="myChart" width="400" height="400"></canvas>
<script src="https://canvasjs.com/assets/script/jquery-1.11.1.min.js"></script>
<script src="https://canvasjs.com/assets/script/jquery.canvasjs.min.js"></script>
</body>
</html>
34 changes: 34 additions & 0 deletions T-1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import json
import datetime
import matplotlib.pyplot as plt
# Opening JSON file
f = open('data.json','r')

# returns JSON object as
# a dictionary
data = json.load(f)

# Iterating through the json
# list
dates = []
for i in data['rates']:
dates.append(i)
jan_dates = []
for i in dates:
datee = datetime.datetime.strptime(i, "%Y-%m-%d")
if datee.month==1:
jan_dates.append(i)
jan_dates.sort()
INR_EUR_exchange = []
for i in jan_dates:
INR_EUR_exchange.append(data['rates'][i]['INR'])
plt.plot(jan_dates,INR_EUR_exchange,marker='o')
plt.xticks(rotation=90)
plt.ylim(min(INR_EUR_exchange)-0.5,max(INR_EUR_exchange)+0.5)

plt.xlabel('January Dates')
plt.ylabel('INR-EUR Exchange Rates')
plt.title('INR exchange rate against EUR from 1 Jan 2019 to 31 Jan 2019')
plt.show()
# Closing file
f.close()
42 changes: 42 additions & 0 deletions T-2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import json
import datetime
import matplotlib.pyplot as plt
# Opening JSON file
f = open('data.json','r')

# returns JSON object as
# a dictionary
data = json.load(f)

# Iterating through the json
# list
dates = []
for i in data['rates']:
dates.append(i)
jan_dates = []
for i in dates:
datee = datetime.datetime.strptime(i, "%Y-%m-%d")
if datee.month==1:
jan_dates.append(i)
jan_dates.sort()

INR_EUR_exchange = []
for i in jan_dates:
INR_EUR_exchange.append(data['rates'][i]['INR'])

GBP_EUR_exchange = []
for i in jan_dates:
GBP_EUR_exchange.append(data['rates'][i]['GBP'])


plt.plot(jan_dates,INR_EUR_exchange,'r')
plt.plot(jan_dates,GBP_EUR_exchange,'b')
plt.xticks(rotation=90)
plt.ylim(min(GBP_EUR_exchange)-1,max(INR_EUR_exchange))

plt.xlabel('January Dates')
plt.ylabel('INR-EUR Exchange Rates')
plt.title('INR exchange rate against EUR from 1 Jan 2019 to 31 Jan 2019')
plt.show()
# Closing file
f.close()
46 changes: 46 additions & 0 deletions T-3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import json
import datetime
import matplotlib.pyplot as plt
# Opening JSON file
f = open('data.json','r')
l = open('latest-rates.json','r')
# returns JSON object as
# a dictionary
latest = json.load(l)
data = json.load(f)

# Iterating through the json
# list

inr = latest['rates']['INR'] #latest rate of INR
gbp = latest['rates']['GBP'] #latest rate of EUR

dates = [] # array to store month dates
for i in data['rates']:
dates.append(i)
jan_dates = []
for i in dates:
datee = datetime.datetime.strptime(i, "%Y-%m-%d")
if datee.month==1: # getting all january dates
jan_dates.append(i)
jan_dates.sort()
INR_EUR_exchange = []
for i in jan_dates: # getting date wise INR exchenge rate
INR_EUR_exchange.append(data['rates'][i]['INR'])

GBP_EUR_exchange = []
for i in jan_dates: # getting date wise GBP exchenge rate
GBP_EUR_exchange.append(data['rates'][i]['GBP'])

# plotting graph
plt.plot(jan_dates,INR_EUR_exchange,marker='o',color='r')
plt.plot(jan_dates,GBP_EUR_exchange,marker='o',color='b')
plt.xticks(rotation=90)
plt.ylim(min(GBP_EUR_exchange)-1,max(INR_EUR_exchange))

plt.xlabel('January Dates')
plt.ylabel('INR-EUR Exchange Rates')
plt.title('INR Latest Rates : '+str(inr)+' , GBP Latest Rates : '+str(gbp)+'')
plt.show()
# Closing file
f.close()
Loading