Professional Documents
Culture Documents
Algorithm: General 1
Algorithm: General 1
Aulia
ALGORITHM
General 1
You are given 2 bottles, a 3 Litre bottle and a 5 Litre bottle. You are asked to measure 4
litres of water with 2 bottles. You have unlimited water sources. Explain in detail your
steps to get 4 litres of water?
First way, fill the 5 Litre bottle from the tap and pour it into the 3 Litre bottle so
the 5 Litre bottle has only 2 litres left. Next, pour away the water in the 3 Litre
bottle. Then, pour the 2 litres from the 5 Litre bottle to the 3 Litre bottle so that
bottle has 2 litres water. The next step, fill the 5 Litre bottle again and pour 1 litre
into the 3 Litre bottle. Then, the 5 Litre bottle has 4 litres water left.
Second way, fill the 3 Litre bottle from the tap and pour it into the 5 Litre bottle
so its has 3 liters. Next, fill the 3 Litre bottle again from the tap and pour it again
into the 5 Litre bottle so the 3 Litre bottle has only 1 litre. Pour away the water in
the 5 Litre bottle and fill it with 1 litre water from 3 Litre bottle. Next step, fill the
3 Litre bottle again from the tap and pour it again into the 5 Litre bottle. So, now
the 5 Litre bottle has 4 litres water.
General 2
There are N sticks, with various lengths. Then do the bulk cutting of the N stick along the
smallest stick that is there. After that, the cutting of the remaining stick along the
smallest stick done, and so on until it runs out.
Input as follows :
Write down the program to find out how many times the cut is needed so that it cannot
be cut back.
Example :
N=4
arr = [5, 3, 1, 6]
Cutting:
5 3 1 6 (Cut 1)
4 2 5 (Cut 2)
2 3 (Cut 2)
1 (Cut 1) Done. Answer = 4
ASSES Nanda
Aulia
First way, fill the 5 Litre bottle from the tap and pour it into the 3 Litre bottle so
the 5 Litre bottle has only 2 litres left. Next, pour away the water in the 3 Litre
bottle. Then, pour the 2 litres from the 5 Litre bottle to the 3 Litre bottle so that
bottle has 2 litres water. The next step, fill the 5 Litre bottle again and pour 1 litre
into the 3 Litre bottle. Then, the 5 Litre bottle has 4 litres water left.
Second way, fill the 3 Litre bottle from the tap and pour it into the 5 Litre bottle
ASSES Nanda
Aulia
SQL QUERYING
Company A has a system to find out transactions that occur in stocks owned by the
company. The table transaction records all transactions that occur in stock, both
decreasing and increasing. In the table there are several transaction codes used to
record the movement of stock. The table has several other tables as a store of additional
information from the transactions that occur, namely detail_storage, detail_price, and
detail_transactio. Write SQL Queries that can answer the following questions:
STUDY CASE
Question 1
Our Arisan Mapan in Surabaya performed very well last month - they had 20% more
registration group last month than the month before. The manager of branch in
Surabaya needs to see what is happening in order to constantly maintain this success
for the next month onwards.
Question : What quantitative methods would you use to evaluate the sudden growth?
How would you evaluate the customers' behavior?
Question 2
You need to determine the optimal voucher discount amount to offer churned
registration users. You have tested 2 variables in the past 7 days. One experiment tested
different voucher amounts while the other experiment was testing the frequency of
sending push notifications to our customers. Experiment design :
Participants were randomly assigned to experimental group and control group.
There are 4 types of voucher amounts tested (10K,15K,20K and 25K). The non-
frequent reminder group received one push notification per day for 2 days, while the
frequent reminder group received one push notification per day for 4 days.
By inspection, it appears that 25K discount draws high attention to the users, but is it
statistically significant?
Question :
Design the hypothesis and give your suggestions to the manager for the optimal
voucher and reminder scheme based on your analysis using proper method.