You are on page 1of 5

ASSES Nanda

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?

There are two ways to solve this problem.

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 :

N = Number of sticks (positive integers)


Arr = An array containing the length of each stick (the size of the array is N)

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

There are two ways to solve this problem.

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:

1. How many transactions have occurred?


2. What is the number of outbound transactions per storage location that has occurred?
3. What is the total price of goods from returned goods transactions that have occurred?
4. How many items are outbound to the customer?
5. Show total price of item adjustment plus!
6. Show the total price of the item adjustment minus!

1. SQL Query : SELECT COUNT (transaction_key) FROM transaction

2. SQL Query : SELECT COUNT(transaction_key), storage_code_origin,


note FROM transaction WHERE transaction_code = 1003 GROUP BY
storage_code_origin

3. SQL Query : SELECT SUM(detail_price.price) FROM transaction JOIN


detail_price ON transaction.product_code =
detail_price.product_code WHERE transaction_code = 1005
ASSES Nanda
Aulia

4. SQL Query : SELECT COUNT(transaction_code) FROM transaction WHERE


transaction_code = 1003

5. SQL Query : SELECT SUM(detail_price.price) FROM transaction join


detail_price ON transaction.product_code =
detail_price.product_code WHERE transaction_code = 1001

6. SQL Query : SELECT SUM(detail_price.price) FROM transaction join


detail_price ON transaction.product_code =
detail_price.product_code WHERE transaction_code = 1002
ASSES Nanda
Aulia

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.

You might also like