ThoughtWorks
70+ Future Pipe Industries Interview Questions and Answers
Q1. 2. How will you design a database to manage the songs playlist on Spotify?
A database for managing songs on Spotify playlists.
Create a table for playlists with columns for name, description, and user ID
Create a table for songs with columns for title, artist, album, and duration
Create a table for playlist-songs with columns for playlist ID and song ID
Use foreign keys to link tables together
Allow for CRUD operations on playlists and songs
Q2. 4. Design a list to show songs in the year in which they were published.
Create an array of song titles sorted by year of publication.
Create an array of song objects with properties for title and year of publication.
Sort the array by year of publication.
Extract the titles of the songs into a separate array.
Return the array of song titles.
Q3. Maximum Sum Subarray Problem Statement
Given an array of integers, find the maximum sum of any contiguous subarray within the array.
Example:
Input:
array = [34, -50, 42, 14, -5, 86]
Output:
137
Explanation:
Th...read more
Q4. Remove Character from String Problem Statement
Given a string str
and a character 'X', develop a function to eliminate all instances of 'X' from str
and return the resulting string.
Input:
The first line contai...read more
Q5. add a new feature using SOLID principles and explain your thought process
Adding a new feature using SOLID principles
Identify the new feature and its requirements
Analyze the existing codebase and identify areas that need modification
Apply SOLID principles to design the new feature
Implement the feature using clean code practices
Test the feature thoroughly to ensure it meets the requirements
Q6. 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
Q7. 3. Middle element of linked list in a single traversal
To find the middle element of a linked list in a single traversal.
Use two pointers, one moving at twice the speed of the other.
When the faster pointer reaches the end, the slower pointer will be at the middle.
If the linked list has even number of elements, the middle will be the second of the two middle elements.
Q8. 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
Q9. Complete String Problem Statement
Given an array of strings A
of size N
, determine the longest complete string. A string is deemed complete if every prefix of the string also appears in the array. If multiple s...read more
Q10. Boundary Sum Problem Statement
Given a Binary Tree with 'N' nodes, compute and return the sum of all its boundary nodes. The boundary nodes include the root node, leftmost external nodes, rightmost external nod...read more
Q11. Anagram Pairs Verification Problem
Your task is to determine if two given strings are anagrams of each other. Two strings are considered anagrams if you can rearrange the letters of one string to form the other...read more
Q12. 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
Q13. Left View of a Binary Tree
Given a binary tree, your task is to print the left view of the tree. The left view of a binary tree contains the nodes visible when the tree is viewed from the left side.
Input:
The ...read more
Q14. 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
Q15. explain the HTTP status code for your tests
HTTP status codes indicate the status of a web request.
1xx - Informational
2xx - Success
3xx - Redirection
4xx - Client Error
5xx - Server Error
Examples: 200 OK, 404 Not Found, 500 Internal Server Error
Q16. Segregate Odd-Even Problem Statement
In a wedding ceremony at NinjaLand, attendees are divided into two groups: bride’s side and groom’s side. Attendees from the bride’s side hold odd numbers, while those from ...read more
Q17. 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
Q18. Pair Sum Problem Statement
Given an integer array ARR
of size N
and an integer S
, your goal is to return a list of all pairs of elements such that the sum of elements of each pair equals S
.
Example:
Input:
N = ...read more
Q19. Minimum Number of Platforms Needed Problem Statement
You are given the arrival and departure times of N trains at a railway station for a particular day. Your task is to determine the minimum number of platform...read more
Q20. 1. Permutations of the string.
Permutations of a string can be generated using recursion and swapping characters.
Use recursion to generate all possible permutations
Swap characters to create new permutations
Store permutations in an array of strings
Handle duplicate characters to avoid repetition
Q21. N Queens Problem Statement
You are provided with an integer 'N'. For an 'N' x 'N' chessboard, determine how to position 'N' queens such that no queen can attack another queen on the chessboard.
Explanation:
A q...read more
Q22. Add 20% discount code, Implement cashback
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.
Q24. Why python is used for data science
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
Q25. What is better java or c?
Both Java and C have their own strengths and weaknesses, and the choice depends on the specific requirements of the project.
Java is better for developing enterprise-level applications due to its platform independence and robustness.
C is better for developing system-level software and applications that require high performance and low-level access to hardware.
Java has a larger community and more libraries and frameworks available, making it easier to find solutions to common p...read more
Q27. Advice clean coding practices on the shared project. Implement a new feature on the shared joyo of energy project, which was to calculate total cost of energy consumption.
Implement clean coding practices for calculating total cost of energy consumption on shared project.
Follow naming conventions for variables and functions to make the code more readable (e.g. use descriptive names like 'calculateTotalCost' instead of 'calc')
Break down the feature into smaller functions to improve code reusability and maintainability
Use comments to explain complex logic or algorithms for better understanding by other team members
Write unit tests to ensure the a...read more
Q28. How does multithreading work
Multithreading allows multiple threads to execute concurrently within a single process.
Multithreading allows for parallel execution of tasks within a single process.
Each thread has its own stack and runs independently of other threads.
Threads share the same memory space, allowing for communication and data sharing.
Multithreading can improve performance by utilizing multiple CPU cores efficiently.
Examples of multithreading include web servers handling multiple client requests ...read more
Q30. Fav sorting algorithm and explanation
Quick Sort - efficient, divide and conquer approach
Efficient sorting algorithm with average time complexity of O(n log n)
Uses divide and conquer approach by selecting a 'pivot' element and partitioning the array around the pivot
Example: Sorting an array of integers in ascending order
Q31. How does HTTP work?
HTTP is a protocol used for transferring data over the internet.
HTTP stands for Hypertext Transfer Protocol.
It is the foundation of data communication on the World Wide Web.
HTTP works by establishing a connection between a client and a server, where the client sends a request and the server responds with the requested data.
HTTP uses methods like GET, POST, PUT, DELETE to specify the action to be performed on a resource.
HTTP messages consist of a header and an optional body, w...read more
Q32. BookMyShow system design and project
BookMyShow is an online platform for booking movie tickets and event tickets.
BookMyShow allows users to browse and book tickets for movies, plays, concerts, and other events.
The system should have a user-friendly interface for easy navigation and booking.
It should also have a secure payment gateway for online transactions.
The system should be scalable to handle a large number of users and transactions.
It should also have features like seat selection, cancellation, and refund....read more
Q34. Hasmap working on the backend
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");
Q35. Coding with any language 1. Count the no of occurrence of each character in string( ignore case)(ignore wild card characters)
The question asks to count the number of occurrences of each character in a given string, ignoring case and wild card characters.
Convert the string to lowercase to ignore case.
Remove any wild card characters from the string.
Create an array of size 26 to store the count of each character.
Iterate through each character in the string and increment the count in the array accordingly.
Return the array of counts as the result.
Q36. what is TDD and writing of testcases
TDD stands for Test-Driven Development, which involves writing test cases before writing the actual code.
TDD is a software development process where tests are written before the code implementation.
Test cases are written based on the expected behavior of the code.
Developers write just enough code to pass the tests, ensuring code quality and functionality.
TDD helps in identifying bugs early in the development process.
Examples: JUnit, NUnit, and pytest are popular testing frame...read more
Q37. Why you write code like this. What is advantage . Why used hashmap why not any other collection
HashMap is used for efficient key-value pair storage and retrieval.
HashMap provides constant time complexity for basic operations like get and put.
It allows storing unique keys and their corresponding values.
HashMap is suitable for scenarios where fast lookup is required.
Other collections like ArrayList or LinkedList have different use cases and performance characteristics.
Q38. Current project overview & it's architecture
Current project involves developing a cloud-based CRM system for a multinational corporation.
Utilizing microservices architecture for scalability and flexibility
Implementing RESTful APIs for seamless integration with other systems
Leveraging cloud services like AWS for hosting and data storage
Using Docker containers for easy deployment and management
Q39. Design a HashMap
A HashMap is a data structure that stores key-value pairs and allows for fast retrieval of values based on keys.
Use an array of linked lists to handle collisions
Implement methods for adding, removing, and retrieving key-value pairs
Use a hash function to determine the index of the array where each key-value pair should be stored
Q40. Tell me about OOPS - Explain modular code
OOPS is a programming paradigm that uses objects to represent real-world entities. Modular code is code that is divided into separate, independent parts.
OOPS stands for Object-Oriented Programming System
It focuses on creating reusable code and reducing complexity
Modular code is easier to maintain, test, and debug
It involves breaking down code into smaller, self-contained modules
Each module performs a specific task and can be easily replaced or updated
For example, a modular co...read more
Q41. performance improvement techniques in reactjs
Performance improvement techniques in ReactJS involve code splitting, lazy loading, optimizing render methods, and using memoization.
Implement code splitting to load only necessary code for each route or component
Utilize lazy loading to defer loading of non-essential components until they are needed
Optimize render methods by avoiding unnecessary re-renders and using PureComponent or shouldComponentUpdate
Use memoization techniques like useMemo or useCallback to prevent unneces...read more
Q42. Tell which tech stack you’d use for which case
For web development, I'd use MERN stack. For mobile development, I'd use React Native. For data analysis, I'd use Python stack.
MERN stack (MongoDB, Express.js, React.js, Node.js) for web development
React Native for mobile development
Python stack (NumPy, Pandas, Matplotlib) for data analysis
Consider the project requirements and scalability before choosing a tech stack
Q43. What do you think about affirmative action
Affirmative action is a complex issue with both pros and cons.
Affirmative action can help promote diversity and equal opportunities for underrepresented groups.
However, it can also lead to reverse discrimination and undermine merit-based hiring practices.
Ultimately, the effectiveness of affirmative action depends on how it is implemented and monitored.
For example, some companies may set quotas for hiring certain groups, while others may focus on outreach and training programs...read more
Q44. In which programming language you are good at?
I am proficient in Java and Python.
Strong understanding of object-oriented programming concepts
Experience with Java frameworks such as Spring and Hibernate
Proficient in Python libraries such as NumPy and Pandas
Q45. Why certain design
Certain designs are chosen for their functionality, aesthetics, and user experience.
Certain designs are chosen based on the specific needs and requirements of the project or product.
Designs are often selected for their ability to enhance usability and user experience.
Aesthetics play a key role in design choices, as visually appealing designs can attract and engage users.
Some designs are preferred for their efficiency and effectiveness in achieving the desired goals.
Considerat...read more
Q46. LLD system.design for restaurant
LLD system design for a restaurant involves designing the software architecture for managing orders, inventory, reservations, and customer data.
Consider designing separate modules for order management, inventory tracking, reservation system, and customer database.
Implement features like menu management, table allocation, payment processing, and reporting functionalities.
Ensure scalability and performance by optimizing database queries, using caching mechanisms, and implementi...read more
Q47. System design. Design a 2-player virtual reality game hosted in 2 different geographic location.
Design a 2-player virtual reality game hosted in 2 different geographic locations.
Utilize a network connection to enable real-time communication between players
Implement a shared virtual environment where players can interact and compete
Include features like voice chat, hand gestures, and avatar customization
Ensure low latency and high bandwidth to provide a seamless gaming experience
Q48. What are the different kind of diversity?
Diversity can be of various types such as cultural, gender, age, religious, linguistic, and more.
Cultural diversity refers to differences in customs, traditions, and beliefs of people from different backgrounds.
Gender diversity refers to differences in gender identity and expression.
Age diversity refers to differences in age groups, such as millennials, baby boomers, and Gen X.
Religious diversity refers to differences in religious beliefs and practices.
Linguistic diversity re...read more
Q49. Virtual Dom in reactjs
Virtual DOM is a lightweight copy of the actual DOM in React, used for efficient updates.
Virtual DOM is a concept where a lightweight copy of the actual DOM is created in memory.
React uses Virtual DOM to improve performance by minimizing actual DOM updates.
When state or props change, React compares the Virtual DOM with the actual DOM and only updates the necessary parts.
This helps in reducing the number of DOM manipulations and improves overall performance.
Q50. promises and closures in JS
Promises and closures are important concepts in JavaScript for handling asynchronous operations and maintaining scope.
Promises are objects representing the eventual completion or failure of an asynchronous operation.
Closures are functions that have access to variables from their containing scope even after the parent function has finished executing.
Promises can be used to handle asynchronous operations like fetching data from a server.
Closures are commonly used in event handl...read more
Q51. Design test plan for problem
Designing a test plan for a problem
Identify the problem statement and objectives
Define test scope and criteria
Create test cases based on requirements
Assign resources and timelines for testing
Execute test cases and document results
Q52. Current working model
Currently using agile methodology with daily stand-ups, bi-weekly sprints, and regular client check-ins.
Agile methodology
Daily stand-ups
Bi-weekly sprints
Regular client check-ins
Q53. Best coding practises
Best coding practices involve writing clean, efficient, and maintainable code.
Use meaningful variable and function names
Follow consistent coding style and formatting
Write comments to explain complex logic
Avoid duplicate code by using functions and classes
Test code thoroughly before deployment
Q54. Design online automobile service center website
Design an online automobile service center website
Include a user-friendly interface for booking appointments and services
Provide detailed information about the services offered and their pricing
Incorporate a feature for customers to track the progress of their service
Include a section for customer reviews and ratings
Ensure the website is mobile-responsive for easy access on-the-go
Q55. Write a program to print HCF of numbers as output
Program to print HCF of numbers as output
Take input of two numbers from user
Find the smaller number between the two
Run a loop from 1 to the smaller number
Check if both numbers are divisible by the current loop variable
If yes, update the HCF variable
Print the HCF as output
Q56. What is Dependency Inversion in SOLID principle?
Dependency Inversion principle states that high-level modules should not depend on low-level modules. Both should depend on abstractions.
High-level modules should not depend on low-level modules. Both should depend on abstractions.
Abstractions should not depend on details. Details should depend on abstractions.
This principle helps in achieving decoupling and flexibility in the codebase.
Example: Instead of directly calling a specific database implementation in a high-level mod...read more
Q57. Implement switch case functionality in python without using switch case.
Q58. Add one API to the existing repository
The API allows users to retrieve weather data based on location.
Create a new endpoint that accepts a location parameter
Use a weather API service to fetch weather data based on the location
Return the weather data in a standardized format, such as JSON
Q59. Add some feature to the project
The feature added to the project is a user authentication system.
Implement a login page with username and password fields.
Create a database table to store user credentials.
Hash and salt passwords for secure storage.
Implement password reset functionality.
Add user roles and permissions for access control.
Q60. System design and breadth in tech
System design in tech involves creating scalable and efficient solutions to complex problems.
Understanding the requirements and constraints of the system
Breaking down the system into smaller components
Choosing the appropriate technologies and architecture
Considering scalability, reliability, and performance
Collaborating with stakeholders to ensure alignment
Q61. Creating test strategy for an entire application.
Creating a test strategy for an entire application involves identifying testing objectives, selecting appropriate testing techniques, and defining test deliverables.
Identify testing objectives and prioritize them based on criticality
Select appropriate testing techniques such as functional, performance, security, and usability testing
Define test deliverables such as test plans, test cases, and test reports
Ensure test coverage across all application components and user scenario...read more
Q62. Denouncing code in jsfiddle
To denounce code in jsfiddle, click on the 'Share' button and select 'Embed' to get the code.
Click on the 'Share' button in the top menu bar.
Select 'Embed' from the dropdown menu.
Copy the code provided in the 'Embed' section and paste it where needed.
Q63. what is oops ? What is inheritance?
OOPs stands for Object-Oriented Programming. Inheritance is a feature of OOPs where a class can inherit properties and behaviors from another class.
OOPs is a programming paradigm that uses objects to design applications.
Inheritance allows a class to inherit attributes and methods from another class.
It promotes code reusability and helps in creating a hierarchical structure of classes.
Example: Class 'Car' can inherit properties like 'color' and methods like 'drive' from class ...read more
Q64. Interface in golang
Interfaces in Golang define a set of methods that a type must implement.
Interfaces are a way to specify behavior of an object.
A type satisfies an interface if it implements all the methods of that interface.
Interfaces allow for polymorphism in Golang.
Example: type Writer interface { Write([]byte) (int, error) }
Example: type MyWriter struct {} func (mw MyWriter) Write(data []byte) (int, error) { return len(data), nil }
Q65. explain cloud concepts
Cloud concepts refer to the delivery of computing services over the internet, including storage, databases, networking, and more.
Cloud computing allows users to access and use resources on-demand over the internet.
It provides scalability, flexibility, and cost-efficiency compared to traditional on-premises solutions.
Examples include Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform.
Q66. DESIGN ARCHITECUTRE OF A MICRO SERVICE
A microservice architecture is a design approach where a single application is composed of small, independent services that communicate over well-defined APIs.
Break down the application into smaller, loosely coupled services
Each service should have a specific function or capability
Services communicate through APIs, often using lightweight protocols like HTTP or messaging queues
Each service should be independently deployable and scalable
Use containers like Docker for packaging...read more
Q67. Employee centric policies of TW.
TW has employee centric policies that prioritize the well-being and growth of its employees.
TW offers flexible work arrangements to promote work-life balance.
The company provides comprehensive health and wellness benefits.
TW invests in employee training and development programs.
The company has a culture of open communication and feedback.
TW recognizes and rewards employee contributions and achievements.
Q68. Design Library Management System.
A Library Management System to track books, users, and transactions.
Create database tables for books, users, transactions
Implement functions for adding, updating, and deleting books
Allow users to check out and return books
Generate reports on book availability and user activity
Q69. Explain different unsupervised algo
Unsupervised algorithms are used to find patterns in data without labeled outcomes.
K-means clustering: partitions data into K clusters based on similarity
Hierarchical clustering: creates a tree of clusters based on similarity
Principal Component Analysis (PCA): reduces dimensionality by finding orthogonal components
Association rule mining: discovers interesting relationships between variables in large datasets
Q70. Design a system
Design a system for managing customer orders in a retail store.
Create a database to store customer information, order details, and inventory.
Develop a user-friendly interface for employees to input and track orders.
Implement a notification system for customers to receive updates on their orders.
Integrate a payment processing system for seamless transactions.
Include reporting features to analyze sales data and trends.
Q71. Design stock exchange
Q72. Sort 0,1 in ascending order
Sort an array of 0s and 1s in ascending order
Use a sorting algorithm like bubble sort or counting sort
Count the number of 0s and 1s and then reconstruct the array
Alternatively, use two pointers approach to swap 0s and 1s
More about working at ThoughtWorks
Interview Process at Future Pipe Industries
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month