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

Application Engineer

Thought Works
upvote
share-icon
2 rounds | 4 Coding problems

Interview preparation journey

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

Tip 1 - Practice Atleast 250 Questions
Tip 2 - Ex- Do atleast 2 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
Easy
Online Coding Interview
Duration90 minutes
Interview date4 Oct 2021
Coding problem3

1. 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

2. Rearrange Array

Easy
15m average time
70% success
0/40
Asked in companies
Thought WorksUnthinkable Solutions

You are given a 0-indexed array ‘NUMS’ consisting of ‘N’ integers. You need to rearrange the array ‘NUMS’ so that numbers at even positions are greater than or equal to those at odd positions.

E.g. ‘NUMS[ i ]’ >= ‘NUMS[ i - 1 ]’ if ‘i’ is even and ‘NUMS[ i ]’ <= ‘NUMS[ i - 1 ]’ if ‘i’ is odd.

If there are multiple ways to rearrange the array, you can choose any.

Example:
Input: ‘N’ = 4,  ‘NUMS’ = [2, 3, 6, 5] 

Output: [3, 2, 6, 5]

At ‘i’ = 0, ‘NUMS[ i ]’ = 3
At ‘i’ = 1, ‘NUMS[ i ]’ = 2, it satisfies the condition ‘NUMS[ i ]’ <= ‘NUMS[ i - 1 ]’ if ‘i’ is odd.
At ‘i’ = 2, ‘NUMS[ i ]’ = 6, it satisfies the condition ‘NUMS[ i ]’ >= ‘NUMS[ i - 1 ]’ if ‘i’ is even.
At ‘i’ = 3, ‘NUMS[ i ]’ = 5, it satisfies the condition ‘NUMS[ i ]’ <= ‘NUMS[ i - 1 ]’ if ‘i’ is odd.
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

3. Top View of the Binary Tree

Easy
0/40
Asked in companies
Thought WorksWalmartSAP Labs

You have been given a Binary Tree of integers. You are supposed to return the top view of the given binary tree.

Top view of the binary tree is the set of nodes which are visible when we see the tree from the top.

For example:
For the given binary tree

Example

The top view of the tree will be {10, 4, 2, 1, 3, 6}.
Problem approach

This approach does not require a queue. Here we use the two variables, one for the vertical distance of the current node from the root and another for the depth of the current node from the root. We use the vertical distance for indexing. If one node with the same vertical distance comes again, we check if the depth of the new node is lower or higher with respect to the current node with the same vertical distance in the map. If depth of new node is lower, then we replace it.

Try solving now
02
Round
Hard
Online Coding Test
Duration120 minutes
Interview date6 Oct 2021
Coding problem1

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

1. System Design Question

Rent a Ride” As a customer to Rent a Ride you book a cab. We charge you as per the distance covered. We charge 8rs/km. The moment you click the button to RIDE, we search for the nearby drivers who will accept your ride. Suppose there are 15 drivers near your location, then we send the request to the first driver who is closest to you, then the second, and so on. There are a few conditions though, based on which we can not send the request to the nearby driver.

Condition 1: If the driver rating is lower than 4. (out of 5)

Condition 2: If you selected a specific car, and that car driver is not the closest one.


In case there is no driver present as per your request for the car, we will ask you to select some other car. A table was given having drivers, cars model, their ratings, and distance from the customer, and using this data we have to provide the most appropriate car to the customer, with the calculated fare. I was able to solve the problem in the given time, interviewers kept on asking questions about my code, and I answered every question. This round lasted 2 hours.

Problem approach

Always write a neat and clean code containing all the conditions. Use the variable names appropriately, the focus on them a lot. Make sure to use “Access modifiers wherever necessary”. Don’t forget to use a camel case

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 - 2
2 rounds | 4 problems
Interviewed by Thought Works
1094 views
0 comments
0 upvotes
company logo
Software Developer
4 rounds | 4 problems
Interviewed by Thought Works
1368 views
0 comments
0 upvotes
company logo
Senior Consultant
5 rounds | 3 problems
Interviewed by Thought Works
1235 views
0 comments
0 upvotes
company logo
Application Developer
5 rounds | 7 problems
Interviewed by Thought Works
1036 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Application Engineer
3 rounds | 5 problems
Interviewed by Newgen Software
700 views
0 comments
0 upvotes
company logo
Application Engineer
4 rounds | 5 problems
Interviewed by Newgen Software
728 views
0 comments
0 upvotes
company logo
Application Engineer
3 rounds | 3 problems
Interviewed by Newgen Software
0 views
0 comments
0 upvotes