TCS NQT 2026 Coding Questions (Gym Fees + Duplicate Transaction)

Posted
20 Mar 2026
1,009 reads

Summary

I encountered two coding questions, Gym Fees Calculator and Duplicate Transaction Detection, during the TCS NQT 2026, which involved a greedy approach and hash map/set for their solutions.

How it went

Hi everyone,

I came across these coding questions from TCS NQT 2026. Sharing here for practice.


🔹 Q1. Gym Fees Calculator

Plans: 3 months = 5000
6 months = 9000
9 months = 12000
12 months = 15000

Given N months, calculate total cost based on priority: 12 → 9 → 6 → 3

If not divisible by 3, print "Error"

👉 Concept: Greedy Algorithm


🔹 Q2. Duplicate Transaction Detection

Detect duplicate transactions where:

  • sender, receiver, amount are same
  • timestamp is different

👉 Concept: HashMap / HashSet


💡 Key Takeaways:

  • Greedy + Hashing are very important for TCS
  • Focus on basic logic and clean implementation

Would love to know if anyone else got similar questions!

Thanks 🚀

Questions asked (2)

  1. 01

    Gym Fees Calculator

    Data Structures & Algorithms

    Plans: 3 months = 5000
    6 months = 9000
    9 months = 12000
    12 months = 15000

    Given N months, calculate total cost based on priority: 12 → 9 → 6 → 3

    If not divisible by 3, print "Error"

  2. 02

    Duplicate Transaction Detection

    Data Structures & Algorithms

    Detect duplicate transactions where:

    • sender, receiver, amount are same
    • timestamp is different

How they prepared

My key takeaways were that greedy algorithms and hashing are very important for TCS, and it's crucial to focus on basic logic and clean implementation.

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at TCS recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!