-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathquestions.html
267 lines (224 loc) · 10.1 KB
/
questions.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="shortcut icon" href="http://www.thoughtworks.com/imgs/favicons/favicon.ico" type="image/vnd.microsoft.icon" />
<link type="image/x-icon" href="http://www.thoughtworks.com/imgs/favicons/favicon.ico" rel="shortcut icon">
<title>Xtreme Mobile Problem Statements</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="description" content="ThoughtWorks Agile Developer Bootcamp, April 2015">
<link rel="canonical" href="http://twhyderabad.github.io/xtrememobile/">
<!-- Custom CSS -->
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" type="text/css" href="css/training.css"/>
</head>
<body>
<div class="page-content">
<div class="wrap">
<div class="post">
<article class="post-content">
<div class="venue-mask">
<div class="venue">
<a href="https://www.thoughtworks.com/locations/hyderabad">
<img class="tw-logo" src="assets/img/tw-logo.png"/>
<span class="tw-hyd">Hyderabad</span></a>
<a href="http://twhyderabad.github.io/xtrememobile/">
<h1 id="venue">Extreme Mobile<br />for Developers</h1></a>
</div>
</div>
<div class = "about max-wrap">
<h1>What We Look For?</h1>
<p class = "about-description">
Any one of the below given problems should be solved using <b>Java</b>. Criteria on which the solution will be assessed are:
<ui>
<li>Good Object Oriented design.</li>
<li>Readable code.</li>
</ui>
The solutions which are close to the production code would get more weightage in the selection criteria.
</p>
</div>
<div class = "problem-statement max-wrap colored-box box-shadow">
<h1>Solve one of the two</h1>
<h2 id="problemStatement1">Problem Statement 1: </h2>
<div id="problemStatement1Desc" class="hide">
<div class = "pdf-link">
<a href="./assets/problems/xtreme-programming-problem-statement-1.pdf" target="_blank">Download as <img src="./assets/img/pdf-document.png"></a>
</div>
<pre>
Discounts on apparel
This shopping season you are having fun at the Mall. The Mall owner, himself, is quite stressed out having to manage the influx of customers.
He is struggling to calculate the discounts that he has on his clothing line. You decide to help him out by building a system that calculates the discounts on all the applicable items a customer has bought.
There are several categories of products. In fact, categories have subcategories which themselves can have subcategories. Below is a diagram.
Casuals is a subcategory of Trousers, which by itself is a subcategory of Men's wear. Some categories have discounts.
Men's wear Women's wear (50% off)
|- Shirts |- Dresses
|- Trousers |- Footwear
|- Casuals (30% off)
|- Jeans (20% off)
Each product you have belongs to a brand which by themselves are running discounts. Below is a table that lists them:
Brands Discounts:
Wrangler 10%
Arrow 20%
Vero Moda 60%
UCB None
Adidas 5%
Provogue 20%
This way, a product can have three types of discounts applicable:
1. Discount on the brand
2. Discount on the category
3. Discount on the ancestor category (e.g. Footwear doesn't have a discount, but it's parent category Women's wear has 50% off). It is worth noting, that it is an ancestor: not just a direct parent, anyone in the lineage.
The discount that is applied is the greatest of the above three. For example, if the customer buys a Jeans of Wrangler Brand, the discounts are:
1. Discount on brand: 10%
2. Discount on category (Jeans): 20%
3. Discount on parents (Trousers, Men's wear): None
So, the discount that is applied 20%.
Inventory (the list of items that shop has):
===========================================================
Id | Brand | Category | Price | Discounted Price |
===========================================================
1 | Arrow | Shirts | 800 | 640 |
2 | Vero Moda | Dresses | 1400 | 560 |
3 | Provogue | Footwear | 1800 | 900 |
4 | Wrangler | Jeans | 2200 | 1760 |
5 | UCB | Shirts | 1500 | 1500 |
===========================================================
You will be given the above table (without discounted price) in CSV form as standard input. This is the shop inventory.
You'll also get the customer options as comma separated Id's after a newline. In the example below, 1,2,3,4 are the customer choices.
Sample Input:
5
1, Arrow,Shirts,800
2, Vero Moda,Dresses,1400
3, Provogue,Footwear,1800
4, Wrangler,Jeans,2200
5, UCB,Shirts,1500
2
1,2,3,4
1,5
Expected output:
3860
2140
</pre></div>
<h2 id="problemStatement2">Problem Statement 2: </h2>
<div id="problemStatement2Desc" class="hide">
<div class = "pdf-link">
<a href="./assets/problems/xtreme-programming-problem-statement-2.pdf" target="_blank">Download as <img src="./assets/img/pdf-document.png"></a>
</div>
<pre>
Transportation in a metro city is a major issue for the Government of Telangana, and Hyderabad is no exception to this rule.
Keeping this in view, the Hyderabad Metro Rail is being developed as one of the largest modern transport systems in the world based upon the PPP model.
There are a lot of systems in HMR, one of them is Ticketing System. A passenger needs a ticket to travel by the metro rail.
Build a system which can print the ticket, given both source and destination.
Following are the pricing rules to consider:
Upto the 3 stations journey, fare is ₹ 10.00/- ( for all Lines )
After the 3 stations, for every extra station,
₹ 2.50/- for Line I
₹ 2.00/- for Line II
₹ 3.00/- for Line III
There is no extra cost associated with changing lines
Expected Input format:
Enter Source Station Code:
A4
Enter Destination Station Code:
B12
Expected Output format:
*************************************************************
Hyderabad Metro Rail
Source: Kukatpally Distance ( stations): 18
Destination: Charminar Cost: ₹ 46.50/-
*************************************************************
Following are the details of the Lines / Stations:
3 Lines - 66 Stations - 3 Interchange Stations:
Line I - Miyapur to L B Nagar - 27 Stations, 29 KM
Line II - JBS to Falaknuma - 16 Stations, 15 KM
Line III - Nagole to Shilparamam - 23 Stations, 28 KM
Stations – Line I:
Code Station Code Station Code Station
A1 Miyapur A2 JNTU College A3 KPHB Colony
A4 Kukatpally A5 Balanagar A6 Moosapet
A7 Bharat Nagar A8 Erragadda A9 ESI Hospital
A10 S R Nagar X1 Ameerpet A12 Punjagutta
A13 Irrum Manzil A14 Khairatabad A15 Lakdikapul
A16 Assembly A17 Nampally A18 Gandhi Bhavan
A19 Osmania Medical College X2 MG Bus station A21 Malakpet
A22 New Market A23 Musarambagh A24 Dilsukhnagar
A25 Chaitanyapuri A26 Victoria Memorial A27 L B Nagar
Stations – Line II:
Code Station Code Station Code Station
B1 JBS X3 Parade Grounds B3 Secunderabad
B4 Gandhi Hospital B5 Musheerabad B6 RTC Cross Roads
B7 Chikkadpally B8 Narayanguda B9 Sultan Bazar
X2 M G Bus Station B11 Salarjung Museum B12 Charminar
B13 Shalibanda B14 Shamsher Gunj B15 Jungametta
B16 Falaknuma
Stations - Line III:
Code Station Code Station Code Station
C1 Nagole C2 Uppal C3 Survey of India
C4 NGRI C5 Habsiguda C6 Tarnaka
C7 Mettuguda C8 Secunderabad X3 Parade Grounds
C10 Paradise C11 Rasool Pura C12 Prakash Nagar
C13 Begumpet X1 Ameerpet C15 Madhura Nagar
C16 Yusuf Guda C17 Road No 5 Jubilee Hills C18 Jubilee Hills Check Post
C19 Pedamma Temple C20 Madhapur C21 Durgam Chervu
C22 HITEC City C23 Shilparamam
Interchange Stations:
Code Station Connecting Lines
X1 Ameerpet Station Line I & III
X2 M G B S Station Line I & II
X3 Parade Grounds Station Line II & III
</pre>
<img src = "./assets/problems/problem-statement-xpbootcamp-2.jpg" width=100%>
</div>
</div>
<div class="queries max-wrap">
<h1 id="connect-us">Solved the Problems?</h1>
<span class="send-your-code">Then send your code with subject "xtreme-mobile-solution" to: </span>
<a class = "contact-us" href="mailto:xtrememobile@thoughtworks.com?Subject=xm-solution" target="_top" class="break-word">xtrememobile@thoughtworks.com</a>
</div>
</article>
</div>
</div>
</div>
<footer class="site-footer">
<div class="wrap clear-fix">
<div class="column left">
<ul>
<li><h2>About ThoughtWorks</h2></li>
<li><p class="about">We are a software company and a community of passionate, purpose-led individuals. We think disruptively to deliver technology to address our clients' toughest challenges, all while seeking to revolutionize the IT industry and create positive social change.</p></li>
</ul>
</div>
<div class="column right">
<ul>
<li><h2>Connect with us</h2></li>
<li class="link">
<a href="https://www.facebook.com/ThoughtWorksHyderabad" target="_blank">
<img src="./assets/img/facebook.png" width="50px">
</a>
</li>
<li class="link">
<a href="https://twitter.com/thoughtworks" target="_blank">
<img src="./assets/img/twitter.png" width="50px">
</a>
</li>
</ul>
</div>
</div>
</footer>
<script type="text/javascript">
var problemStatement1 = document.getElementById("problemStatement1"),
problemStatement2 = document.getElementById("problemStatement2"),
problemStatement1Desc = document.getElementById("problemStatement1Desc"),
problemStatement2Desc = document.getElementById("problemStatement2Desc");
problemStatement1.addEventListener("click", function() {
problemStatement1Desc.className = problemStatement1Desc.classList.contains("hide") ?
"" : "hide";
problemStatement2Desc.className = "hide";
});
problemStatement2.addEventListener("click", function() {
problemStatement2Desc.className = problemStatement2Desc.classList.contains("hide") ?
"" : "hide";
problemStatement1Desc.className = "hide";
});
</script>
</body>
</html>