Freecharge
30+ Welspun Interview Questions and Answers
Q1. Name your favorite app and what are its pros and cons?
My favorite app is Spotify.
Pros: Wide variety of music genres and artists available, personalized recommendations, user-friendly interface.
Cons: Limited offline listening for free users, occasional ads interrupting music playback.
Q2. implement stack in a way so that I will get min at any step in 0(1)
Use an additional stack to keep track of the minimum value at each step.
Create a stack to store the actual values.
Create another stack to store the minimum value at each step.
When pushing a new value, compare it with the top of the minimum stack and push the smaller value.
When popping a value, also pop from the minimum stack.
To get the minimum value at any step, simply peek at the top of the minimum stack.
Q3. Linked list Median of 2 sorted array Print left view of tree
The interviewee was asked about linked lists, finding the median of two sorted arrays, and printing the left view of a tree.
For linked lists, the interviewee should be familiar with the basic operations such as insertion, deletion, and traversal.
To find the median of two sorted arrays, the interviewee should know how to merge the arrays and find the middle element(s).
Printing the left view of a tree involves traversing the tree and printing the leftmost node at each level.
Q4. Design a pament device and what other features will you add to it.
The payment device will be a compact and secure device that accepts multiple payment methods.
The device will have a touch screen display for easy navigation.
It will accept payments through NFC, EMV, and QR codes.
The device will have a built-in camera for scanning QR codes.
It will have a biometric authentication feature for added security.
The device will have a rechargeable battery for portability.
It will have a receipt printer for generating receipts.
The device will have a sl...read more
Q5. How will you handle communication between cross functional teams
I will establish clear communication channels and facilitate regular meetings to ensure alignment and collaboration.
Establish clear communication channels
Facilitate regular meetings
Encourage open communication and active listening
Ensure alignment and collaboration
Address any conflicts or misunderstandings promptly
Q6. How can you design a high scale Multithreaded system?
Designing a high scale Multithreaded system requires careful consideration of thread synchronization, load balancing, and resource management.
Identify the critical sections of code that need to be synchronized
Choose an appropriate synchronization mechanism such as locks or semaphores
Implement load balancing to distribute work evenly across threads
Use thread pools to manage resources and limit the number of threads created
Consider using asynchronous programming techniques to r...read more
Q7. find first non-repeating character in a string
Find the first non-repeating character in a string
Create a hashmap to store the frequency of each character in the string
Iterate through the string and check the frequency of each character
Return the first character with frequency 1
Q8. Follow up question : Remove nth node from last from the linked list
To remove the nth node from the end of a linked list, we can use a two-pointer approach.
Use two pointers, one moving n steps ahead of the other
When the first pointer reaches the end, the second pointer will be at the nth node from the end
Adjust the pointers to remove the nth node
Q9. 1. stock price with max profit.
Finding the stock price with maximum profit.
Calculate the difference between each day's stock price and the minimum stock price seen so far.
Find the maximum difference calculated in the previous step.
The maximum difference is the maximum profit that can be made.
Add the maximum difference to the minimum stock price to get the stock price with maximum profit.
Q10. print even odd with different threads
Print even and odd numbers using different threads
Create two threads, one for printing even numbers and one for printing odd numbers
Use synchronization mechanisms like mutex or semaphore to ensure proper ordering of output
Example: Thread 1 prints even numbers (2, 4, 6, ...) and Thread 2 prints odd numbers (1, 3, 5, ...)
Q11. how would you increase engagement in social media handles?
To increase engagement in social media handles, focus on creating valuable content, using interactive features, and engaging with your audience.
Create valuable and relevant content that resonates with your audience
Use interactive features like polls, quizzes, and live videos to encourage participation
Engage with your audience by responding to comments and messages, and asking for feedback
Collaborate with other brands or influencers to reach new audiences
Post consistently and ...read more
Q12. Whatsapp low level design
Whatsapp low level design involves messaging, encryption, media sharing, and user authentication.
Use end-to-end encryption to secure messages
Implement message queues for real-time message delivery
Allow media sharing through file transfer protocols
Use OAuth for user authentication and authorization
Q13. 2.all zeroes at the end of the array.
To count the number of zeroes at the end of an array.
Loop through the array from the end and count the number of zeroes until a non-zero element is encountered.
Use a while loop to keep dividing the last element by 10 until it is not divisible by 10 to count the number of zeroes.
If the array is sorted in non-increasing order, use binary search to find the last non-zero element and subtract its index from the length of the array.
Q14. Array - Pair Sum - Return pair of the sum from arrays
Find pairs in array that sum up to a given target value.
Iterate through the array and store each element in a hash set.
For each element, check if the target value minus the current element exists in the hash set.
Return the pair of elements that sum up to the target value.
Q15. Longest Consecutive Sequence
Find the length of the longest consecutive elements sequence in an array.
Sort the array to ensure consecutive elements are adjacent
Iterate through the array and keep track of the current consecutive sequence length
Update the longest consecutive sequence length as you iterate
Q16. Executor Service and it's code
Executor Service is a framework provided by Java for managing and executing asynchronous tasks.
Executor Service allows you to easily create and manage threads for executing tasks.
It provides a way to control the number of threads used for executing tasks, which can help prevent resource exhaustion.
You can submit tasks to an Executor Service using methods like execute() or submit().
Executor Service can be used to execute tasks in parallel, improving performance in multi-thread...read more
Q17. How would you go about designing an uber app
Designing an Uber app involves creating a user-friendly interface, integrating GPS tracking, payment processing, and driver management.
Research user needs and preferences
Create a simple and intuitive interface
Integrate GPS tracking for accurate location-based services
Implement secure payment processing
Develop a driver management system
Test and refine the app based on user feedback
Q18. Code to move 0's to extreme right position
Code to move 0's to extreme right position in an array of strings
Iterate through the array and move all 0's to the end of the array
Use two pointers approach to swap elements
Example: Input array ['1', '0', '3', '0', '5'], Output array ['1', '3', '5', '0', '0']
Q19. Design flight booking system
Design a flight booking system for easy and efficient booking process.
Allow users to search for flights based on destination, date, and number of passengers.
Provide options for users to select preferred flight times, airlines, and seating preferences.
Include secure payment processing for booking confirmation.
Implement a user-friendly interface with clear instructions and easy navigation.
Offer features like flight status updates, booking management, and customer support.
Integr...read more
Q20. Explain High Order Components using the example
High Order Components are functions that take a component and return a new component with additional functionality.
HOCs are used to share code between components.
They can be used for adding authentication, logging, or other functionalities to components.
Example: a HOC that adds a loading spinner while data is being fetched.
Q21. Explain the reducer method in js using the example
Reducer method in JavaScript is used to manage state changes in applications by taking the current state and an action as input and returning a new state.
Reducer function takes two parameters - the current state and an action
It then determines how the state should change based on the action type
The reducer function returns a new state based on the action type
Q22. Remove kth node from end
Remove the kth node from the end of a linked list.
Use two pointers, one to traverse the list and another to keep track of the kth node from the end.
Once the first pointer reaches the end, the second pointer will be at the kth node from the end.
Adjust the pointers to remove the kth node.
Q23. How to write docker file
A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image.
Start with a base image using the FROM keyword
Use the RUN keyword to execute commands in the container
Use the COPY keyword to add files from the host machine to the container
Use the CMD keyword to specify the command to run when the container starts
Q24. sort array of cards in color red , blue,green
Sort array of cards in red, blue, green colors.
Use a custom sorting function to sort the array based on color order.
Assign a numerical value to each color (e.g. red: 0, blue: 1, green: 2) and sort based on these values.
Implement a sorting algorithm like bubble sort or quicksort to rearrange the array based on color order.
Q25. Convert an Array to a LinkedList
Convert an array of strings to a LinkedList
Create a new LinkedList
Iterate through the array and add each element to the LinkedList
Q26. Design a transaction system Bank Wallet.
Design a transaction system Bank Wallet.
Implement user authentication and authorization for secure transactions
Allow users to deposit, withdraw, and transfer funds
Provide transaction history and balance updates
Implement security measures such as encryption and two-factor authentication
Q27. Design LRU cache using Java data structure
LRU cache is a data structure that stores the most recently used items, discarding the least recently used items when full.
Use a LinkedHashMap to store key-value pairs with access order
Override removeEldestEntry method to limit the size of the cache
Update the access order of items when they are accessed
Q28. Design LRU cache
LRU cache is a data structure that stores the most recently used items, discarding the least recently used items when full.
Use a doubly linked list to keep track of the order of items based on their usage.
Use a hashmap to quickly access items in the cache.
When an item is accessed, move it to the front of the linked list to mark it as the most recently used.
Q29. Check if two strings are anagram of each other
Check if two strings are anagram of each other
Create character count arrays for both strings
Compare the character count arrays to check if they are equal
Example: 'listen' and 'silent' are anagrams
Q30. Number of subset
Calculate the number of subsets of a given set
The number of subsets of a set with n elements is 2^n
Include the empty set and the set itself in the count
For example, a set with 3 elements will have 2^3 = 8 subsets
Q31. Explain file system in linux
File system in Linux organizes and manages data on storage devices.
File system controls how data is stored, accessed, and managed on storage devices.
Linux uses a hierarchical file system structure with directories and files.
Common file systems in Linux include ext4, XFS, and Btrfs.
File permissions in Linux determine who can read, write, or execute files.
Mounting and unmounting drives allows access to different file systems on Linux.
Q32. Explain New Features in ReactJS
ReactJS has introduced new features like Hooks, Context API, Suspense, and Concurrent Mode.
Introduction of Hooks allows functional components to have state and lifecycle methods.
Context API provides a way to pass data through the component tree without having to pass props down manually at every level.
Suspense enables components to suspend rendering while waiting for something to load, like data from an API.
Concurrent Mode allows React to render multiple components at the sam...read more
Q33. HOW TO HANDLE CHALLENGES
Handling challenges involves staying calm, analyzing the situation, seeking help if needed, and taking decisive action.
Stay calm and composed to think clearly
Analyze the challenge to understand its root cause
Seek advice or help from colleagues or mentors
Take decisive action to address the challenge effectively
Q34. How to convert active sale
To convert active sales, focus on building relationships, providing value, and addressing customer needs.
Build strong relationships with customers to increase trust and loyalty
Provide value through personalized solutions and excellent customer service
Address customer needs by understanding their pain points and offering tailored solutions
Follow up regularly to maintain engagement and address any concerns
Offer promotions or discounts to incentivize purchases
Q35. Concept of oops
Object-oriented programming paradigm that focuses on objects and classes for code organization and reusability.
Encapsulation: Bundling data and methods that operate on the data into a single unit (object)
Inheritance: Ability of a class to inherit properties and behavior from another class
Polymorphism: Ability to present the same interface for different data types
Q36. Explain Virtual Dom
Virtual DOM is a lightweight copy of the actual DOM, used for efficient updates and rendering in React applications.
Virtual DOM is a concept in React where a lightweight copy of the actual DOM is created and updated in memory.
When changes are made to the state of a component, React compares the virtual DOM with the actual DOM and only updates the necessary parts, minimizing performance impact.
This process of updating the virtual DOM and then applying the changes to the actual...read more
Q37. write a program to read a file
Program to read a file in backend development
Use a programming language like Python, Java, or C++ to open and read the file
Use file handling functions to read the contents of the file
Handle exceptions for file not found or permission issues
Close the file after reading to free up system resources
More about working at Freecharge
Top HR Questions asked in Welspun
Interview Process at Welspun
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month