I Tested a “Simple” Like System… And It Allowed Duplicate Likes

I Tested a “Simple” Like System… And It Allowed Duplicate Likes

BackerLeader posted 2 min read

At first, this looked like one of the easiest features.

Click like → count increases → done.

That’s how every social media app works.

So I created a small challenge around this idea to see how systems handle it.

And the result was surprising.


The Problem

Here’s the basic logic:

  • User clicks like
  • System checks if already liked
  • If not → store the like

Seems correct.

But there’s a hidden issue.


⚠️ What Can Go Wrong?

In real-world systems:

• The same user can like the same post multiple times
• Duplicate records can be stored
• Object comparison may fail silently
• Concurrent requests can bypass checks

And suddenly:

Like count becomes incorrect
System shows wrong engagement
Data becomes inconsistent


Why This Happens

The problem is not just logic.

It’s how the system compares and stores data.

For example:

Two objects that look the same are not always equal in memory.

So even if the system checks:

“Is this already liked?”

It may still fail.


What I Observed

When testing this type of problem:

• Many solutions checked basic conditions
• Some failed in object comparison
• Some ignored concurrency
• Very few ensured data consistency

The code works.

But the system is not reliable.


The Real Issue

This is not just about liking a post.

It’s about:

• Data integrity
• Unique constraints
• System consistency
• Handling real-world traffic

Because:

One user should equal one like

How Real Systems Solve This

Strong systems handle this using:

• Database unique constraints (userId + postId)
• Atomic operations
• Idempotent APIs
• Proper indexing

This ensures:

No duplicate likes
Correct counts
Reliable data


Try This Kind of Problem

If you want to explore how different solutions handle this, you can check here:

https://vibecodearena.ai/duel/131106af-1f77-48a8-8d66-cb9695a3640f

You’ll quickly see the difference between:

Code that looks correct
And systems that behave correctly


Final Thought

Like systems don’t fail because of clicks.

They fail because of data consistency issues.

And that’s where real engineering begins.


What do you think
Can AI handle these edge cases… or does it still miss something important?

More Posts

I’m a Senior Dev and I’ve Forgotten How to Think Without a Prompt

Karol Modelskiverified - Mar 19

How I Built a React Portfolio in 7 Days That Landed ₹1.2L in Freelance Work

Dharanidharan - Feb 9

TypeScript Complexity Has Finally Reached the Point of Total Absurdity

Karol Modelskiverified - Apr 23

Sovereign Intelligence: The Complete 25,000 Word Blueprint (Download)

Pocket Portfolioverified - Apr 1

Just completed another large-scale WordPress migration — and the client left this

saqib_devmorph - Apr 7
chevron_left

Related Jobs

View all jobs →

Commenters (This Week)

1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!