Search code examples
javaandroiddatabasetinder

App like tinder, how to never show the same card?


not sure if this is the right place to ask this, I am making an app that works kind of like tinder as in it has cards that you can swipe left or right on, however I can't figure out how I would never show the same card more than once to a user, would I have to have like a true/false value in a database?


Solution

  • Check out something called Bloom Filters. It's a way to test membership of an item in a set. Here, 'item' would be a card to potentially show to the user, and the set would contain all the cards that have already been shown. Using a bloom filter would mean you would never show a card to a user that has already seen that card. But the small downside is that, you may never show a card to him that he has never seen before.