Add office photos
Employer?
Claim Account for FREE

ION Group

3.5
based on 161 Reviews
Filter interviews by

10+ TCS Interview Questions and Answers

Updated 31 Aug 2024
Popular Designations

Q1. Count Ways to Climb Stairs Problem

Given a staircase with a certain number of steps, you start at the 0th step, and your goal is to reach the Nth step. At every step, you have the option to move either one step...read more

Add your answer

Q2. Trapping Rain Water in 2-D Elevation Map

You're given an M * N matrix where each value represents the height of that cell on a 2-D elevation map. Your task is to determine the total volume of water that can be ...read more

Add your answer

Q3. You are the owner of a petrol pump. Formulate a profitable strategy

Ans.

Offer competitive prices, provide excellent customer service, and diversify revenue streams.

  • Offer competitive prices to attract more customers

  • Provide excellent customer service to build customer loyalty

  • Diversify revenue streams by offering additional services like car wash or convenience store

  • Implement loyalty programs to incentivize repeat business

  • Invest in technology to streamline operations and reduce costs

Add your answer

Q4. Find the most occuring element in array

Ans.

Find the most occuring element in array of strings

  • Iterate through the array and count the occurrences of each element

  • Keep track of the element with the highest count

  • Return the element with the highest count

Add your answer
Discover TCS interview dos and don'ts from real experiences

Q5. Payment Management System using four pillars of object oriented programming

Ans.

A Payment Management System can be designed using the four pillars of object-oriented programming: encapsulation, inheritance, polymorphism, and abstraction.

  • Encapsulation: Hide the internal implementation details of payment processing and provide a public interface for interacting with the system.

  • Inheritance: Create a hierarchy of payment classes such as CreditCardPayment, PayPalPayment, etc. to reuse common functionality.

  • Polymorphism: Implement different payment methods usin...read more

Add your answer

Q6. Diff between sql / no sql primary key unique key

Ans.

SQL uses primary keys to uniquely identify records in a table, while NoSQL databases use unique keys for the same purpose.

  • SQL databases use primary keys to uniquely identify each record in a table, typically using an auto-incrementing integer value.

  • NoSQL databases use unique keys to achieve the same purpose, but the key can be any unique value, not necessarily an integer.

  • In SQL, primary keys are used to enforce entity integrity and ensure data consistency, while in NoSQL, uni...read more

Add your answer
Are these interview questions helpful?

Q7. Implement design using hashmap

Ans.

Implementing design using hashmap for efficient key-value storage and retrieval.

  • Create a hashmap object to store key-value pairs.

  • Use put() method to add key-value pairs to the hashmap.

  • Use get() method to retrieve values based on keys.

  • Handle collisions using chaining or open addressing techniques.

  • Consider resizing the hashmap if load factor exceeds a certain threshold.

Add your answer

Q8. What are the 4 pillars of OOPs

Ans.

Encapsulation, Inheritance, Polymorphism, Abstraction

  • Encapsulation: Bundling data and methods that operate on the data into a single unit

  • Inheritance: Ability of a class to inherit properties and behavior from another class

  • Polymorphism: Ability to present the same interface for different data types

  • Abstraction: Hiding the complex implementation details and showing only the necessary features

Add your answer
Share interview questions and help millions of jobseekers 🌟

Q9. common puzzles found on gfg

Ans.

Common puzzles found on GeeksforGeeks

  • Tower of Hanoi

  • N-Queens Problem

  • Knights Tour Problem

  • Sudoku Solver

  • Water Jug Problem

Add your answer

Q10. Explain time complexity of binary tree

Ans.

Time complexity of binary tree refers to the amount of time it takes to perform operations on the tree based on its size.

  • Time complexity for searching, inserting, and deleting in a binary tree is O(log n) on average.

  • In worst case scenarios, time complexity can be O(n) for operations like searching if the tree is unbalanced.

  • Balanced binary trees like AVL trees or Red-Black trees ensure O(log n) time complexity for all operations.

Add your answer

Q11. Implement stack using linked list.

Ans.

Implement stack using linked list

  • Create a Node class with data and next pointer

  • Create a Stack class with top pointer

  • Implement push, pop, and peek methods by manipulating the linked list

Add your answer

Q12. reverse a linked list

Ans.

Reverse a linked list by changing the direction of pointers

  • Start with three pointers: current, previous, and next

  • Iterate through the linked list, updating pointers to reverse the direction

  • Update the head of the linked list to be the previous node

Add your answer

Q13. Longest Common Prefix

Ans.

Find the longest common prefix among an array of strings.

  • Iterate through the characters of the first string and compare with the corresponding characters of other strings.

  • Stop when a mismatch is found or when reaching the end of any string.

  • Return the prefix found so far.

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at TCS

based on 19 interviews
3 Interview rounds
Aptitude Test Round
Technical Round - 1
Technical Round - 2
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Interview Questions from Similar Companies

3.5
 • 35 Interview Questions
4.1
 • 25 Interview Questions
4.0
 • 19 Interview Questions
4.0
 • 13 Interview Questions
3.4
 • 11 Interview Questions
3.8
 • 10 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter