Add office photos
Employer?
Claim Account for FREE

Intuit

3.5
based on 164 Reviews
Video summary
Filter interviews by

10+ Welspun Corp Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations

Q1. Grid Satisfaction Problem

In this problem, you are given a grid of size N*M containing two types of people: type ‘A’ and type ‘B’. You are given the number of people of each type: 'countA' denotes the number of...read more

Ans.

Given a grid with type A and B people, maximize satisfaction based on neighbors.

  • Start with type A people for maximum satisfaction

  • Optimally place people to maximize satisfaction

  • Consider satisfaction levels for each type of person and their neighbors

Add your answer

Q2. Problem Statement: Find the Number of States

You are given ‘n’ cities, some of which are connected by bidirectional roads. You also have an ‘n x n’ matrix ‘roads’, where if city ‘i’ and city ‘j’ are connected b...read more

Ans.

Find the number of states of cities connected by roads in a matrix.

  • Identify connected cities using DFS or Union-Find algorithm

  • Count the number of disjoint sets to determine the number of states

  • Handle self-connections of cities by setting roads[i][i] = 1

Add your answer

Q3. Binary Tree Diameter Problem Statement

You are given a Binary Tree, and you need to determine the length of the diameter of the tree.

The diameter of a binary tree is the length of the longest path between any ...read more

Ans.

The task is to find the diameter of a binary tree, which is the longest path between any two nodes in the tree.

  • Traverse the tree to find the longest path between two nodes.

  • Keep track of the maximum diameter found during traversal.

  • The diameter may or may not pass through the root node.

  • Consider the height of the left and right subtrees to calculate the diameter.

Add your answer

Q4. Triplets with Given Sum Problem

Given an array or list ARR consisting of N integers, your task is to identify all distinct triplets within the array that sum up to a specified number K.

Explanation:

A triplet i...read more

Ans.

Identify all distinct triplets within an array that sum up to a specified number.

  • Iterate through the array and use nested loops to find all possible triplets.

  • Use a set to store unique triplets and check if the sum equals the target.

  • Handle edge cases like duplicate elements and no valid triplets.

  • Return the triplets as space-separated integers or -1 if no triplets exist.

Add your answer
Discover Welspun Corp interview dos and don'ts from real experiences

Q5. Number of Islands Problem Statement

You are provided with a 2-dimensional matrix having N rows and M columns, containing only 1s (land) and 0s (water). Your goal is to determine the number of islands in this ma...read more

Ans.

Count the number of islands in a 2D matrix of 1s and 0s.

  • Use Depth First Search (DFS) or Breadth First Search (BFS) to traverse the matrix and identify connected groups of 1s.

  • Maintain a visited array to keep track of visited cells to avoid redundant traversal.

  • Increment the island count each time a new island is encountered.

  • Consider edge cases like boundary conditions and handling of diagonals while traversing.

  • Handle the input matrix efficiently to optimize the solution.

  • Example...read more

Add your answer

Q6. Longest Palindromic Substring Problem Statement

You are provided with a string STR of length N. The goal is to identify the longest palindromic substring within this string. In cases where multiple palindromic ...read more

Ans.

Given a string, find the longest palindromic substring, prioritizing the one with the smallest start index.

  • Iterate through the string and expand around each character to find palindromes

  • Keep track of the longest palindrome found and its starting index

  • Return the longest palindromic substring with the smallest start index

Add your answer
Are these interview questions helpful?

Q7. Max Game Minimum Penalty Problem

In this game, you are given a collection of 'N' numbers. The objective is to minimize the total penalty incurred while playing by following these steps:

  1. Select any two numbers,...read more
Ans.

The objective is to minimize total penalty by selecting two numbers, summing them, and accumulating the penalty until only one number remains.

  • Iteratively select two numbers, sum them, and accumulate the penalty until only one number remains.

  • Choose the two smallest numbers to minimize the penalty.

  • Repeat the process until only one number remains to find the minimum possible penalty.

Add your answer

Q8. Stack using Two Queues Problem Statement

Develop a Stack Data Structure to store integer values using two Queues internally.

Your stack implementation should provide these public functions:

Explanation:

1. Cons...read more
Ans.

Implement a stack using two queues to store integer values.

  • Use two queues to simulate stack operations efficiently.

  • Maintain the top element in one of the queues for easy access.

  • Ensure proper handling of edge cases like empty stack.

  • Example: Push elements onto one queue, then dequeue and enqueue to the other queue for pop operation.

  • Example: Use a flag to track the top element and update it accordingly.

Add your answer
Share interview questions and help millions of jobseekers 🌟
Q9. Given an array of size n, how would you find the smallest subarray that contains k distinct values?
Ans.

Use sliding window technique to find smallest subarray with k distinct values.

  • Use a sliding window approach to keep track of the subarray with k distinct values.

  • Use a hashmap to store the frequency of each element in the window.

  • Slide the window to the right until the hashmap contains k distinct elements.

  • Shrink the window from the left while maintaining k distinct elements.

  • Update the minimum subarray length as you slide the window.

  • Return the smallest subarray length found.

  • Exam...read more

Add your answer

Q10. Kth Largest Element Problem

Given an array containing N distinct positive integers and a number K, determine the Kth largest element in the array.

Example:

Input:
N = 6, K = 3, array = [2, 1, 5, 6, 3, 8]
Output...read more
Ans.

Find the Kth largest element in an array of distinct positive integers.

  • Sort the array in non-increasing order and return the Kth element.

  • Use a priority queue or quick select algorithm for efficient solution.

  • Handle constraints like array size and element values properly.

  • Ensure all elements in the array are distinct for accurate results.

Add your answer

Q11. Rearrange Linked List Problem Statement

Given a singly linked list in the form 'L1' -> 'L2' -> 'L3' -> ... 'Ln', your task is to rearrange the nodes to the form 'L1' -> 'Ln' -> 'L2' -> 'Ln-1', etc. You must not...read more

Ans.

Rearrange the nodes of a singly linked list in a specific order without altering the data of the nodes.

  • Use two pointers to split the linked list into two halves, reverse the second half, and then merge the two halves alternately.

  • Ensure to handle cases where the number of nodes is odd or even separately.

  • Time complexity: O(N), Space complexity: O(1)

  • Example: Input: 1 -> 2 -> 3 -> 4 -> 5 -> NULL, Output: 1 -> 5 -> 2 -> 4 -> 3 -> NULL

Add your answer

Q12. What is polymorphism?

Ans.

Polymorphism is the ability of a function or method to behave differently based on the object it is acting upon.

  • Polymorphism allows objects of different classes to be treated as objects of a common superclass.

  • There are two types of polymorphism: compile-time (method overloading) and runtime (method overriding).

  • Example: Inheritance allows a child class to override a method from its parent class, exhibiting polymorphic behavior.

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at Welspun Corp

based on 3 interviews
1 Interview rounds
Coding Test Round
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Intern Interview Questions from Similar Companies

3.5
 • 50 Interview Questions
3.0
 • 35 Interview Questions
3.8
 • 21 Interview Questions
3.4
 • 12 Interview Questions
4.2
 • 12 Interview Questions
3.9
 • 10 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter