bigbearsio / strength

1 stars 1 forks source link

Finalize Rules #6

Open tnuanchuay opened 6 years ago

tnuanchuay commented 6 years ago

How do we know who will win this competition? just only they pass the test and get correct booking result? response time/capacity should be minor factor?

tnuanchuay commented 6 years ago

Reference (sorry, thai language video) https://www.youtube.com/watch?v=y9I4Vsj6G0g

varokas commented 6 years ago

Thats still fuzzy on my mind. Can u help spell down the rules. Likely we would pick the one that withstand the most increasing load but how do we resolve when correctness is in consideration.

Can u open PR with RULES.md file and spell out some of these so we can all review ? Thx

tnuanchuay commented 6 years ago

I've read Rule page in Google Slide after create this issue and it's very clear, actually. I thought we choose winner from they can pass the load testing so we may have many winners.

btw, I'll write RULES.md

phantomnat commented 6 years ago

I think we should put more weight on the correctness. Because even if the correctness is 99 percent, but if 2 users got the same seat, that doesn't sound good.

varokas commented 6 years ago

Actually now that i think about it. Maybe we should make the rules easier to check

Let's remove concept of rounds. only limited number of seats (say 10k). But we decide who wins by those who can sell all tickets correctly, and use the least amount of time.

  1. user call getAvailableTickets() to get up to 10 remaining seats
  2. user call book(seat) -> wait 1-2 seconds -> confirm(seat) (if seat is not confirmed within 5 seconds. it will be back to the pool
  3. repeat until getAvailableTickets() returns empty

The winner needs to do these

  1. Service did not crash
  2. all seats are sold correctly (no duplicate seats, all reserved seats can be confirmed within 3 sec)
  3. sell faster than other people

Ref: https://github.com/bigbearsio/strength-ref/pull/3

varokas commented 6 years ago

@mahasak if this LGTU i'll merge

varokas commented 6 years ago

Please add the agreed rules to README.md and change reference implemenatation to match (Remove rounds)

mahasak commented 6 years ago

@varokas LGTM, let @tspn add details to README.md

varokas commented 6 years ago

Also, getAvailableTickets() returns count of tickets booked but not confirmed

varokas commented 6 years ago

From Thai about persistence. we will check 2 times

  1. after tix is done
  2. we will force reset all, then check again
tnuanchuay commented 6 years ago

@varokas It shouldn't call getAvailableTickets() if it returns only tickets booked but not confirmed I will name it getUnconfirmed(). Is it ok?

varokas commented 6 years ago

I think getAvailableTickets() should make sense. It means get all tickets that is available to book.