Add office photos
Employer?
Claim Account for FREE

Urban Company

3.4
based on 1.1k Reviews
Video summary
Filter interviews by

10+ TCS Interview Questions and Answers

Updated 14 Sep 2024
Popular Designations

Q1. Meeting Rooms Allocation Problem Statement

Stark Industry is planning to organize meetings for various departments in preparation for Stark Expo. Due to limited rooms in Stark Tower, the goal is to allocate mee...read more

Ans.

Determine the minimum number of conference rooms needed to schedule meetings without overlap.

  • Sort the meetings by start time.

  • Iterate through the meetings and keep track of the rooms in use.

  • If a meeting starts after another ends, it can reuse the same room.

  • If a meeting starts before another ends, a new room is needed.

  • Return the maximum number of rooms in use at any point.

Add your answer

Q2. Maximize XOR Value

You are provided with an integer X and are tasked with identifying an integer Y such that the bitwise XOR operation between X and Y yields the maximum possible value. The condition is that Y ...read more

Ans.

Find an integer Y such that XOR operation with X yields maximum value within given constraints.

  • Iterate from the most significant bit to find the highest bit that can be toggled to maximize XOR value.

  • To maximize XOR value, toggle the highest bit of X to 0 and all lower bits to 1.

  • Ensure the final Y does not exceed (2^61) - 1.

  • Example: For X = 3, the highest bit to toggle is at position 61, so Y = 2305843009213693950.

  • Example: For X = 7, the highest bit to toggle is at position 60...read more

Add your answer

Q3. Print All Subsets Challenge

Given an array arr containing 'N' distinct integers, your task is to generate all possible non-empty subsets of this array.

Note: While the elements within each subset should be in i...read more

Ans.

Generate all possible non-empty subsets of an array of distinct integers.

  • Use recursion to generate all subsets by including or excluding each element in the array.

  • Maintain a current subset and add it to the result when reaching the end of the array.

  • Ensure elements within each subset are in increasing order.

  • Handle the input and output format as specified in the question.

Add your answer

Q4. Implement indexOf Function

You are provided with two strings A and B. Your task is to find the index of the first occurrence of A within B. If A is not found in B, return -1.

Example:

Input:
A = "bc", B = "abcd...read more
Ans.

Implement a function to find the index of the first occurrence of one string within another string.

  • Iterate through the second string and check if a substring of the same length as the first string matches the first string.

  • Return the index of the first occurrence of the first string within the second string, or -1 if not found.

  • Handle edge cases like empty strings or when the first string is longer than the second string.

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

Q5. Minimize Maximum Difference Between Adjacent Elements

You are provided with a non-decreasing array and an integer K. Your task is to remove exactly K elements from this array so that the maximum difference betw...read more

Ans.

Remove K elements from a non-decreasing array to minimize the maximum difference between adjacent elements.

  • Sort the array in non-decreasing order.

  • Iterate through the array and calculate the difference between adjacent elements.

  • Remove elements to minimize the maximum difference.

  • Return the minimized maximum difference.

Add your answer

Q6. Frequency in a Sorted Array Problem Statement

Given a sorted array ARR and a number X, your task is to determine the count of occurrences of X within ARR.

Note:

  • If X is not found in the array, return 0.
  • The ar...read more
Ans.

Count occurrences of a number in a sorted array efficiently.

  • Use binary search to find the first and last occurrence of the target number in the array.

  • Calculate the count of occurrences by subtracting the indices of the last and first occurrences.

  • Handle cases where the target number is not found in the array.

  • Time complexity: O(log(N)), Space complexity: O(1).

Add your answer
Are these interview questions helpful?

Q7. Distinct Subsequences Problem Statement

You are given a string 'S' of length 'N' which may include duplicate alphabets. Your goal is to calculate the number of distinct subsequences in the string.

Example:

Inpu...read more
Ans.

Calculate the number of distinct subsequences in a string with possible duplicates.

  • Use dynamic programming to keep track of the count of distinct subsequences for each character in the string.

  • Consider the cases where the current character is included or excluded in the subsequence.

  • Handle duplicates by considering the previous occurrence of the character.

  • Return the count of distinct subsequences modulo 10^9 + 7.

Add your answer

Q8. Problem: Search In Rotated Sorted Array

Given a sorted array that has been rotated clockwise by an unknown amount, you need to answer Q queries. Each query is represented by an integer Q[i], and you must determ...read more

Ans.

Search for integers in a rotated sorted array efficiently.

  • Implement binary search to find the target integer in the rotated array.

  • Handle the rotation by checking which side of the array is sorted before performing binary search.

  • Return the index of the target integer if found, else return -1.

  • Time complexity of O(logN) is required for each query.

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

Q9. Rotting Oranges Problem Statement

You are given a grid containing oranges where each cell of the grid can contain one of the three integer values:

  • 0 - representing an empty cell
  • 1 - representing a fresh orange...read more
Ans.

Find the minimum time required to rot all fresh oranges in a grid.

  • Use Breadth First Search (BFS) to simulate the rotting process

  • Track the time taken to rot all oranges and return -1 if any fresh oranges remain

  • Handle edge cases such as no fresh oranges or all oranges already rotten

  • Consider using a queue to efficiently process neighboring oranges

Add your answer

Q10. Clone Linked List with Random Pointer Problem Statement

Given a linked list where each node has two pointers: one pointing to the next node and another which can point randomly to any node in the list or null, ...read more

Ans.

Yes, the cloning of a linked list with random pointer can be accomplished without utilizing extra space.

  • Use a hashmap to store the mapping between original nodes and cloned nodes.

  • Iterate through the original linked list to create the cloned linked list by mapping the random pointers using the hashmap.

  • Time complexity of this approach is O(N) where N is the number of nodes in the linked list.

Add your answer

Q11. how can you generate leads?

Ans.

Generating leads can be done through networking, cold calling, email marketing, social media, and attending industry events.

  • Networking: Build relationships with potential clients through industry events, conferences, and online platforms.

  • Cold calling: Reach out to prospects directly via phone to introduce your product or service.

  • Email marketing: Send targeted emails to potential leads to inform them about your offerings.

  • Social media: Utilize platforms like LinkedIn, Twitter, ...read more

Add your answer

Q12. Shortest Path Visiting All Nodes

You are given a connected undirected unweighted graph comprising 'N' nodes and 'M' edges. In this graph, each pair of connected nodes is linked by exactly one undirected edge, a...read more

Ans.

Find the length of the shortest path visiting all nodes in a connected undirected unweighted graph.

  • Use Breadth First Search (BFS) to find the shortest path that visits all nodes at least once.

  • Maintain a bitmask to keep track of visited nodes and their states.

  • Consider all possible permutations of nodes to find the shortest path length.

Add your answer

Q13. Find Row With Maximum 1's in a Sorted 2D Matrix

You are provided with a 2D matrix containing only the integers 0 or 1. The matrix has dimensions N x M, and each row is sorted in non-decreasing order. Your objec...read more

Ans.

Find the row with the maximum number of 1's in a sorted 2D matrix.

  • Iterate through each row of the matrix and count the number of 1's in each row.

  • Keep track of the row index with the maximum number of 1's seen so far.

  • Return the index of the row with the maximum number of 1's.

  • If multiple rows have the same number of 1's, return the row with the smallest index.

Add your answer

Q14. Amazing Strings Problem Statement

Determine if the third string contains all the characters from both the first and second strings in any order. If so, return "YES"; otherwise, return "NO".

Input:

Line 1: First...read more
Ans.

Check if the third string contains all characters from the first and second strings in any order.

  • Create a frequency map for characters in the first and second strings.

  • Check if all characters in the third string are present in the frequency map.

  • Ensure the count of characters in the third string matches the count in the frequency map.

  • Return 'YES' if all conditions are met, otherwise return 'NO'.

Add your answer

Q15. Why a plumber should sign up for urban company by paying rupees 2500

Ans.

Plumbers should sign up for Urban Company by paying Rs 2500 because it offers a wide customer base, marketing support, and access to advanced tools and technology.

  • Urban Company provides a large customer base, allowing plumbers to reach more potential clients.

  • The platform offers marketing support, helping plumbers promote their services and attract more customers.

  • By signing up, plumbers gain access to advanced tools and technology that can enhance their efficiency and service ...read more

View 1 answer

Q16. How to convert a potential customers

Ans.

To convert potential customers, build rapport, understand their needs, offer solutions, and follow up.

  • Build rapport by asking questions and actively listening

  • Understand their needs and pain points

  • Offer solutions that address their specific needs

  • Follow up regularly to stay top of mind

  • Provide excellent customer service to build loyalty

Add your answer

Q17. Design a Customer Support Chat Application System

Ans.

A customer support chat application system for efficient communication and problem-solving.

  • Implement live chat functionality for real-time communication

  • Include automated responses for common queries

  • Integrate ticketing system for tracking and resolving issues

  • Provide chat history for reference and continuity

  • Ensure data security and privacy measures are in place

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

Interview Process at TCS

based on 17 interviews
Interview experience
4.0
Good
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Interview Questions from Similar Companies

4.1
 • 546 Interview Questions
3.9
 • 497 Interview Questions
4.1
 • 401 Interview Questions
3.3
 • 312 Interview Questions
3.6
 • 204 Interview Questions
3.6
 • 168 Interview Questions
View all
Top Urban Company Interview Questions And Answers
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
75 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