Add office photos
ThoughtWorks logo
Employer?
Claim Account for FREE

ThoughtWorks

3.9
based on 521 Reviews
Video summary
Filter interviews by
Fresher
Experienced
Clear (1)

ThoughtWorks Interview Questions and Answers for Freshers

Updated 25 Jun 2024
Popular Designations

Q1. Add 20% discount code, Implement cashback

Ans.

To add a 20% discount code and implement cashback in an application.

  • Create a discount code field in the application where users can enter the code to avail 20% off.

  • Calculate the discounted price by applying the 20% discount on the original price.

  • Implement a cashback feature where users receive a certain percentage of the purchase amount back as cashback.

  • Ensure that the cashback amount is credited to the user's account after the purchase is completed.

Add your answer
right arrow

Q2. Why python is used for data science

Ans.

Python is used for data science due to its simplicity, readability, extensive libraries, and community support.

  • Python is easy to learn and read, making it accessible for beginners and experts alike

  • Python has a wide range of libraries like NumPy, Pandas, and Scikit-learn for data manipulation and analysis

  • Python has a strong community support with active forums and resources for data science enthusiasts

  • Python's versatility allows for integration with other tools and languages c...read more

Add your answer
right arrow

Q3. Hasmap working on the backend

Ans.

HashMap is a data structure commonly used in backend development for efficient key-value storage and retrieval.

  • HashMap is a collection that stores key-value pairs and allows for fast retrieval of values based on keys.

  • It is commonly used in backend development for caching, session management, and data storage.

  • Example: HashMap employeeSalaries = new HashMap<>(); employeeSalaries.put("Alice", 50000); int salary = employeeSalaries.get("Alice");

Add your answer
right arrow

Q4. Total Unique Paths Problem Statement

You are located at point ‘A’, the top-left corner of an M x N matrix, and your target is point ‘B’, the bottom-right corner of the same matrix. Your task is to calculate the...read more

Ans.

The problem involves finding the total number of unique paths from the top-left to bottom-right cell of a matrix by moving only right or down.

  • Use dynamic programming to solve the problem efficiently.

  • Create a 2D array to store the number of unique paths at each cell.

  • Initialize the first row and first column with 1 as there is only one way to reach them.

  • For each cell (i, j), the number of unique paths is the sum of paths from the cell above and the cell to the left.

  • Return the v...read more

Add your answer
right arrow
Discover ThoughtWorks interview dos and don'ts from real experiences

Q5. River Crossing: Help Ninja Cross Over

Ninja stands at the start of a wooden bridge over a river. Some segments of the bridge are damaged. The undamaged segments, marked as 'safe', are listed in an array SAFE, s...read more

Ans.

Check if Ninja can cross the river by jumping from one safe segment to another based on given constraints.

  • Iterate through the 'SAFE' array and check if Ninja can make the required jumps to reach the last safe segment.

  • Ensure that the next jump is either 'X' - 1, 'X', or 'X' + 1 units from the previous jump.

  • Return 'true' if Ninja can successfully cross the river, otherwise return 'false'.

Add your answer
right arrow

Q6. Subtree Node Count Problem

We are provided with a tree containing 'N' nodes, numbered from 0 to N-1. The objective is to determine the total number of nodes within each subtree of the provided tree. Specificall...read more

Ans.

Given a tree with N nodes, find the number of elements in each subtree rooted at every node.

  • Traverse the tree using Depth First Search (DFS) to calculate subtree sizes for each node.

  • Use an array to store subtree sizes for each node, starting with leaf nodes having size 1.

  • The subtree size of a node is the sum of subtree sizes of its children plus 1 for the node itself.

Add your answer
right arrow

Q7. Middle of a Linked List

You are given the head node of a singly linked list. Your task is to return a pointer pointing to the middle of the linked list.

If there is an odd number of elements, return the middle ...read more

Ans.

Return the middle element of a singly linked list, or the one farther from the head if there are even elements.

  • Traverse the linked list with two pointers, one moving twice as fast as the other

  • When the fast pointer reaches the end, the slow pointer will be at the middle

  • Return the element pointed to by the slow pointer

Add your answer
right arrow

Q8. Check If Linked List Is Palindrome

Given a singly linked list of integers, determine if the linked list is a palindrome.

Explanation:

A linked list is considered a palindrome if it reads the same forwards and b...read more

Ans.

Check if a given singly linked list of integers is a palindrome or not.

  • Traverse the linked list to find the middle element using slow and fast pointers.

  • Reverse the second half of the linked list.

  • Compare the first half with the reversed second half to determine if it's a palindrome.

Add your answer
right arrow

More about working at ThoughtWorks

Back
Awards Leaf
AmbitionBox Logo
#2 Best IT/ITES Company - 2022
Awards Leaf
HQ - Chicago, Illinois, United States (USA)
Contribute & help others!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos

Interview Process at ThoughtWorks for Freshers

based on 10 interviews
Interview experience
4.1
Good
View more
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Interview Questions from Similar Companies

Infosys Logo
3.6
 • 4.6k Interview Questions
L&T Technology Services Logo
3.3
 • 324 Interview Questions
Capgemini Engineering Logo
3.5
 • 309 Interview Questions
Morningstar Logo
3.9
 • 168 Interview Questions
S&P Global Logo
4.1
 • 149 Interview Questions
Yes Bank Logo
3.7
 • 143 Interview Questions
View all
Recently Viewed
INTERVIEWS
Tata Communications
No Interviews
INTERVIEWS
Tata Communications
No Interviews
INTERVIEWS
Tata Communications
No Interviews
INTERVIEWS
Tata Communications
No Interviews
INTERVIEWS
Tata Communications
No Interviews
INTERVIEWS
Tata Communications
No Interviews
INTERVIEWS
Tata Communications
No Interviews
INTERVIEWS
Tata Communications
No Interviews
INTERVIEWS
Tata Communications
No Interviews
INTERVIEWS
Tata Communications
No Interviews
Top ThoughtWorks Interview Questions And Answers
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
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