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

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

●6 ●40 ●123
calendar_today • schedule2 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?

Want more #webdev & #techblog deep dives?

Join 6,175+ developers sharing real benchmarks, code breakdowns, and projects. Free forever.

More Posts

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

Karol Modelski - 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 Modelski - Apr 23

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

Pocket Portfolio - Apr 1

Cisco's Amy Chang: A Model's "Passport" Doesn't Tell You Where It Actually Came From

Tom Smithverified - Aug 27
chevron_left
7.1k Points • 169 Badges
Kolkata,WB,IND • edulumix.in
64Posts
34Comments
27Connections
Software Engineer @2Coms Group

Commenters (This Week)

16 comments
7 comments
2 comments

Contribute meaningful comments to climb the leaderboard and earn badges!