Problem database last updated: June 20, 2025

TThoughtWorks logo

ThoughtWorks Coding Interview Questions

7 problems · 3 Easy, 2 Medium, 2 Hard · Ranked #185 of 458

Difficulty breakdown

3 Easy

43% · avg 23%

2 Medium

29% · avg 59%

2 Hard

29% · avg 18%

Top topics

string
57.1%2x
dynamic-programming
42.9%2.2x
array
28.6%
bit-manipulation
28.6%8.5x
rolling-hash
14.3%38.2x
string-matching
14.3%16.4x

Interview profile

Based on 7 reported problems, ThoughtWorks interviews are significantly harder than average - 29% Hard vs 18% across all companies.

Compared to the industry average, ThoughtWorks puts unusual emphasis on bit-manipulation (28.6% of problems, 8.5x the industry average), dynamic-programming (42.9% of problems, 2.2x the industry average), string (57.1% of problems, 2x the industry average). If you're short on time, these are the categories to double down on.

The most common topics are string (57.1%), dynamic-programming (42.9%), array (28.6%), bit-manipulation (28.6%). Problems below are sorted by frequency, the ones at the top are asked most often.

All 7 problems

Number of Subarrays That Match a Pattern II

Solve

You are given a 0-indexed integer array nums of size n, and a 0-indexed integer array pattern of size m consisting of integers -1, 0, and 1.

HardVery Likely
arrayrolling-hashstring-matching

Maximize the Number of Partitions After Operations

Solve

You are given a string s and an integer k.

HardVery Likely
stringdynamic-programmingbit-manipulation

Number of Bit Changes to Make Two Integers Equal

Solve

You are given two positive integers n and k.

EasyVery Likely
bit-manipulation

Best Time to Buy and Sell Stock

Solve

You are given an array prices where prices[i] is the price of a given stock on the ith day.

EasyLikely
arraydynamic-programming

Valid Parentheses

Solve

Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.

EasyLikely
stringstack

Longest Palindromic Substring

Solve

Given a string s, return the longest palindromic substring in s.

MediumLikely
two-pointersstringdynamic-programming

Longest Substring Without Repeating Characters

Solve

Given a string s, find the length of the longest substring without duplicate characters.

MediumLikely
hash-tablestringsliding-window

How often are these problems asked?

Frequency scores are based on crowdsourced interview reports. A higher score means the problem has been reported more often in recent ThoughtWorks interviews.

Very Likely

75-100%

Likely

50-74%

Sometimes

25-49%

Rare

0-24%

Preparing for your ThoughtWorks coding interview

ThoughtWorks interviews focus heavily on string, dynamic-programming, array problems. If you're short on time, these are the categories to prioritize. The problems on this page are sorted by frequency, so start from the top and work your way down.

Beyond solving problems, practice explaining your approach. ThoughtWorks interviewers care about your thought process - how you break down a problem, consider edge cases, and evaluate tradeoffs between solutions. A clean O(n) solution you can explain clearly beats an O(log n) solution you can't articulate.

Looking for more companies? Browse all 458 companies in our directory, or sharpen your fundamentals with our free data structure visualizers and AI-powered DSA tutor.

Frequently Asked Questions

What coding problems does ThoughtWorks ask in interviews?add

ThoughtWorks has been reported to ask 7 distinct coding problems. The most common topics are string, dynamic-programming, array. 3 are Easy difficulty, 2 are Medium, and 2 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.

How hard are ThoughtWorks coding interviews?add

Based on 7 reported problems, ThoughtWorks interviews are significantly harder than average - 29% Hard vs 18% across all companies. 29% of questions are Medium difficulty. Focus on the high-frequency Medium problems first, then work through the Hard ones.

How should I prepare for a ThoughtWorks coding interview?add

Start with the highest-frequency problems listed on this page. Focus on the core topics: string, dynamic-programming, array. Practice solving them under time pressure and explaining your approach out loud. Mock interviews with AI can simulate the real experience.

Other companies to explore

Ready to ace your ThoughtWorks interview?

Simulate a real ThoughtWorks coding interview with an AI interviewer. Get a scorecard with specific feedback on your problem-solving, code quality, and communication.

Simulate a ThoughtWorks interview with AIarrow_forward