Thought Works interview experience Real time questions & tips from candidates to crack your interview

Full Stack Engineer

Thought Works
upvote
share-icon
5 rounds | 8 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 3 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming , Recursion
Tip
Tip

Tip 1 : Practice Atleast 250 DS Questions
Tip 2 : maintain consistency while doing questions
Tip 3 : Do some projects

Application process
Where: Campus
Eligibility: 7 CGPA
Resume Tip
Resume tip

Tip 1 : Have some projects on resume.
Tip 2 : Do not put false things on resume.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 minutes
Interview date15 Sep 2021
Coding problem2

1. Minimum Swaps To Make Identical Array

Moderate
0/80
Asked in companies
WalmartThought WorksAmazon

You are given two arrays, ‘A’ and ‘B’, with the same elements in a different order. Your task is to make ‘B’ identical to the ‘A’ by swapping the elements in array ‘B’. You have to find out the minimum number of swaps required.

For Example:
For the first test case, ‘A’ = [5, 6, 4, 10], ‘B’ = [4, 6, 10, 5], here in the ‘B’ we can swap 4 with 10 to form [10, 6, 4, 5] and we can then swap 10 with 5 to form the array [5, 6, 4, 10] which is identical to ‘A’. Hence the answer is 2.
Problem approach

A simple solution is to first count all elements less than or equal to k(say ‘good’). Now traverse for every sub-array and swap those elements whose value is greater than k. The time complexity of this approach is O(n2)
An efficient approach is to use the two-pointer technique and a sliding window. The time complexity of this approach is O(n)


Find the count of all elements which are less than or equal to ‘k’. Let’s say the count is ‘cnt’
Using the two-pointer technique for a window of length ‘cnt’, each time keep track of how many elements in this range are greater than ‘k’. Let’s say the total count is ‘bad’.
Repeat step 2, for every window of length ‘cnt’ and take a minimum of count ‘bad’ among them. This will be the final answer.

Try solving now

2. Rearrange The Array

Moderate
15m average time
90% success
0/80
Asked in companies
Thought WorksOracleOla

You are given an array/list 'NUM' of integers. You are supposed to rearrange the elements of the given 'NUM' so that after rearranging the given array/list there are no two adjacent elements present in the rearranged 'NUM' which will be the same.

For example:
Input: NUM[] = {1,1,1,2,2,2} 
Output: {1,2,1,2,1,2}
Note: {2,1,2,1,2,1} is also valid because there are no two adjacent which are the same.
Problem approach

Observe that array consists of [n/2] even positioned elements. If we assign the largest [n/2] elements to the even positions and the rest of the elements to the odd positions, our problem is solved. Because element at the odd position will always be less than the element at the even position as it is the maximum element and vice versa. Sort the array and assign the first [n/2] elements at even positions.

Try solving now
02
Round
Easy
Online Coding Test
Duration120 minutes
Interview date17 Sep 2021
Coding problem1

This round was pair programming round. In this round we code along with the interviewer. He/She will give us a typical system design question which we have to solve using OOPS.

1. Design a Parking Lot

The focus should be on following set of requirements while designing the parking lot:The parking lot should have multiple floors where customers can park their cars.The parking lot should have multiple entry and exit points.Customers can collect a parking ticket from the entry points and can pay the parking fee at the exit points on their way out.Customers can pay the tickets at the automated exit panel or to the parking attendant.Customers can pay via both cash and credit cards.Customers should also be able to pay the parking fee at the customer’s info portal on each floor. If the customer has paid at the info portal, they don’t have to pay at the exit.The system should not allow more vehicles than the maximum capacity of the parking lot. If the parking is full, the system should be able to show a message at the entrance panel and on the parking display board on the ground floor.Each parking floor will have many parking spots. The system should support multiple types of parking spots such as Compact, Large, Handicapped, Motorcycle, etc.The Parking lot should have some parking spots specified for electric cars. These spots should have an electric panel through which customers can pay and charge their vehicles.The system should support parking for different types of vehicles like car, truck, van, motorcycle, etc.Each parking floor should have a display board showing any free parking spot for each spot type.The system should support a per-hour parking fee model. For example, customers have to pay $4 for the first hour, $3.5 for the second and third hours, and $2.5 for all the remaining hours.

Problem approach

here is my take on it:

ParkingSlot > Floor > Parking
And separate FareController

So, a Parking can have many Floors and Floor and can have many ParkingSlots. Each Parking Slot is of certain slot size.
Vehicle is the interface type and all Vehicles just have to implement getType method to return type of Vehicle.
There is a separate enum for Slot size, and each slot size has the list of vehicle types it can accommodate. This keeps Parking and Vehicle objects independent of each other.

For calculating Fare, there is a separate FareController class which maintains map of each vehicle parked with details of parking and entry and exit time. Fare for Vehicle type can be kept in Parking and then getFare method can return the final fare on the basis of its inputs which is Parking, entryTime and exitTime.

03
Round
Medium
Video Call
Duration60 minutes
Interview date20 Sep 2021
Coding problem3

DS algo and project related questions were asked

1. Median In Matrix

Moderate
25m average time
75% success
0/80
Asked in companies
AdobeThought WorksReverie Language Technologies

Given a row-wise sorted matrix having N number of rows and M number of columns. Your task is to find the median of the given matrix.

Note :

Assume that the size of the matrix N*M is always odd.
Problem approach

An efficient approach for this problem is to use a binary search algorithm. The idea is that for a number to be median there should be exactly (n/2) numbers that are less than this number. So, try to find the count of numbers less than all the numbers

Try solving now

2. Majority element

Easy
15m average time
85% success
0/40
Asked in companies
AmazonInfo Edge India (Naukri.com)HCL Technologies

You have been given an array/list 'ARR' consisting of 'N' integers. Your task is to find the majority element in the array. If there is no majority element present, print -1.

Note:
A majority element is an element that occurs more than floor('N' / 2) times in the array.
Problem approach

A better solution is to use sorting. First, sort all elements using a O(nLogn) algorithm. Once the array is sorted, we can find all required elements in a linear scan of array. So overall time complexity of this method is O(nLogn) + O(n) which is O(nLogn).

Try solving now

3. Find All Anagrams in a String

Easy
15m average time
85% success
0/40
Asked in companies
American ExpressThought WorksWalmart

You have been given a string STR and a non-empty string PTR. Your task is to find all the starting indices of PTR’s anagram in STR.

An anagram of a string is another string which contains the same characters and is obtained by rearranging the characters.

For example: ‘SILENT’ and ‘LISTEN’ are anagrams of each other. ‘ABA’ and ‘ABB’ are not anagram because we can’t convert ‘ABA’ to ‘ABB’ by rearranging the characters of particular strings.

Note:

1. Both STR and PTR consist of English uppercase letters.
2. Length of string 'STR' will always be greater than or equal to the length of string ‘PTR’.
3. In case, there is no anagram substring, then return an empty sequence.
4. In case of more than one anagrams, return the indices in increasing order.
Problem approach

A simple method is to create a Hash Table. Calculate the hash value of each word in such a way that all anagrams have the same hash value. Populate the Hash Table with these hash values. Finally, print those words together with the same hash values. A simple hashing mechanism can be modulo sum of all characters. With modulo sum, two non-anagram words may have the same hash value. This can be handled by matching individual characters

Try solving now
04
Round
Easy
HR Round
Duration30 minutes
Interview date21 Sep 2021
Coding problem1

1. Basic HR Question

It was a leadership round they will touch up on some tech discussion and they will ask your interview experience along with previous organisation work experience.

He asked me about previous work experience in the internships.What kind of people I don’t like to work with? Biggest challenges faced by you and how you overcame them?

05
Round
Easy
HR Round
Duration30 minutes
Interview date21 Sep 2021
Coding problem1

It was culture round where they ask your views about specific problem in society/company and how you can help to solve it and make society/company culture more inclusive

1. Basic HR Question

How comfortable do we feel working with LGBT+ community?

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

How do you remove whitespace from the start of a string?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
2 rounds | 4 problems
Interviewed by Thought Works
0 views
0 comments
0 upvotes
company logo
Software Developer
5 rounds | 8 problems
Interviewed by Thought Works
0 views
0 comments
0 upvotes
company logo
Application Developer
3 rounds | 5 problems
Interviewed by Thought Works
1332 views
0 comments
0 upvotes
company logo
Grad Consultant
4 rounds | 5 problems
Interviewed by Thought Works
359 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Full Stack Engineer
2 rounds | 5 problems
Interviewed by HashedIn
0 views
0 comments
0 upvotes