Thoughtworks Coding Questions And Answers

Thoughtworks Coding Questions For Freshers

Thoughtworks Coding Questions is a part of Online Test of Thoughtworks which is conducted on Hackerearth Platform. The information on this page will help you to have a bigger picture about the Application Developer Role at Thoughtworks. We recommend you to go through this page thoroughly.

Get to know about Recruitment Process, Online Assessments which take place when you appear for Thoughtworks Application Developer hiring drive.

Coding Questions

About Thoughtworks

Global technology consulting firm Thoughtworks combines strategy, engineering, and design to promote digital innovation. The clients have relied on their independent teams to develop solutions that go beyond the apparent for more than 28 years.

Here, recent computer science graduates meet with seasoned engineers, self-taught programmers, career changers in their forties, and others to challenge and learn from one another. With the power of their cultivation culture, which has received countless honours worldwide, career journeys bloom.

Recruitment Process at Thoughtworks

Below is a description of Thoughtworks hiring procedure that will aid you in understanding the method used to find applicants for the position of Application Developer – Graduate Consultant.

The Thoughtworks Recruitment Process contains the mentioned rounds.

  • Pre – Placement Talk
  • Online Test
  • Code Pairing Round
  • Technical Interview
  • Leadership & Social Change Interview

We have even tabulated some more information for your reference and understanding.

ThoughtworksRelated Information
Batch2023
CourseApplication Developer – Graduate Consultant
RoleB.Tech (CSE IT ECE)
Education
  • 70% aggregate / 7.4 CGPA in Xth, XIIth & Engineering
  • No backlogs
PlatformHackerearth
Cost to Company (CTC)11.10 LPA
ExpertiseDS,  Algorithms, OS,  Networking, Java, OOPs Concept

Prime Course Trailer

Related Banners

Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription

Sample Thoughtworks Coding Questions With Solutions

Question 1 : Number with 2

Problem Statement  :

Suppose you are in a number system, where if the number doesn’t contain 2 in the unit digit then the number is not valid. So the first number of the number system is 2, the second number is 12, and the third is 22.
for a given integer n, you have to print the nth element of the number system.

Input Format:
First line, containing n denoting the number of test cases.
then n number of lines for the query.

Output Format:
Print the consecutive number in the number system for each query.

Sample Input:
3

Sample Output:
22

Explanation:
1st number will be 2 , 2nd number will be 12 and third number will be 32

Question 2 : Duplicates

Problem Statement  :

The principal has a problem with repetitions. Everytime someone sends the same email twice he becomes angry and starts yelling. His personal assistant filters the mails so that all the unique mails are sent only once, and if there is someone sending the same mail again and again, he deletes them. Write a program which will see the list of roll numbers of the student and find how many emails are to be deleted.

Sample Input:
6
1
3
3
4
3
3

Sample Output:
3

Question 3 : Maximum Revenue

Problem statement : Amit is a salesman who wishes to know the maximum revenue received from a given item of the N products each day . Amit has a sales record of N products for M days.Helo amit to find the highest revenue received each day.

Input : 

  • The first line of the input consists of two space-separated integers- day(M) and item(N) representing the days and the products in the sales record.
  • The next M lines consist of N space separated integers representing the sales revenue from each product each day.

Output: 

  • Print m space-separated integers representing the maximum revenue received each day .

Example Input:

  • 3 4
  • 101 123 234 344
  • 143  282 499 493
  • 283 493 202 304

Output:

  • 344 499 493

Explanation:

  • The maximum revenue received on the first day is 344 , followed by a maximum revenue of 499 on the second day and a maximum revenue of 493 on the third day.

Question 4 : Game Of Clicks (R->Hard)

Problem Statement  :

Sahil watches TV all day and gets bored. He started playing this dumb game of identifying minimum number of inputs needed to reach a channel. As his cousin, you have to help him, but you live far from his house. So you decide to write a code that will ask Sahil for some inputs and give outputs respectively.

Here are the problems you need to keep in mind :

  • There are 13 buttons on his remote: 10 buttons for the numbers (0-9) to form integers denoting respective channel index, “Up channel” button and “ Down channel” button for going i +1th channel and i-1th channel from i respectively, and a “Last viewed” button to see what’s the last channel before it.
  • The number buttons allow you to jump directly to a specific channel (Ex: to go to channel 172 by typing 1,7,2).
  • If the channel which you are in is ith and that is the max channel index possible, by Up channel, you will reach the first channel possible. Same goes for the down channel button. You can go to the highest channel possible if you go down from the lowest channel possible.
  • Sahil can get from one channel to the next in one of the two ways.
  • Sahil’s parents have set some parental control on some channels on Aniruth’s television. The “Up Channel “ and “Down buttons” buttons skip these channels as these channels are not viewable.
  • Given a list of channels to view, the lowest channel, the highest channel, and a list of blocked channels, your program should return the minimum number of clicks necessary to get through all the shows that Anirudh would like to match.

Input Format :

  • First line is the lowest Channel
  • Second-line is the highest Channel
  • Followed by a number of blocked channels B,
    and the next B lines contain the actual blocked channels.
  • Followed by the number of Channels to view V, and the next V lines contain the actual channels to view.

Constraints :

  • The lowest channel on the television will be greater than 0. and less than or equal to 10,000.
  • The highest channel on the television will be greater than or equal to the lowest channel. and less than or equal to 10.000.
  • The list of channels that are blocked on Anirudh’s television. All the channels in this list will be valid channels (greater than or equal to lowest channel, less than or equal 1 to highest channel). Duplicates may be Ignored. The blocked list can be a maximum of 40 channels.
  • The sequence that Sahil must view contains between 1 and 50 elements. inclusive. All channels in this sequence are not in the blocked list and are between lowest channel and highest channel. Inclusive.

Sample Input 0:
1
20
2
18
19
5
15
14
17
1T
17
Sample output 0:
7

Question 5 : Share Holder (R -> Hard)

Problem statement :

Ratan is a crazy rich person. And he is blessed with luck, so he always made the best profit possible with the shares he bought. That means he bought a share at a low price and sold it at a high price to maximize his profit. Now you are an income tax officer and you need to calculate the profit he made with the given values of stock prices each day. You have to calculate only the maximum profit Ratan earned.
Note that:
Ratan never goes into loss.

Example 1 :

Price=[1,6,2]
Ratan buys it on the first day and sells it on the second.

Example 2 :

Price=[9,8,6]

The Price always went down, Ratan never bought it.

Input Format:
First line with an integer n, denoting the number days with the value of the stack
Next n days, telling the price of the stock on that very day.

Output Format:
Maximum profit done by Ratan in a single line.
Constraints:
Number of days <=10^8

Sample Input for Custom Testing

STDIN
———–
7
1
9
2
11
1
9
2

Sample Output

10

Explanation

The maximum profit possible is when Ratan buys it in 1 rupees and sells it in 11.

FAQs related to Thoughtworks Coding Questions

Question 1: How the Recruitment test is conducted by Thoughtworks?

Thoughtworks has partnered with Hackerearth for conducting the Online Coding Assessments for Recruitment Process.

Question 2: What are the major field does Thoughtworks works on?

ThoughtWorks works on a wide variety of projects across industries, including e-commerce, healthcare, finance, and education. Some examples of past projects include developing a mobile banking app, creating a platform for healthcare data analysis, and building a system to optimize supply chain operations.

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others

Checkout list of all the video courses in PrepInsta Prime Subscription

Checkout list of all the video courses in PrepInsta Prime Subscription