Mobikwik
40+ Pushpinder Singh Sidhu Contractor Interview Questions and Answers
Q1. Sort 0 and 1 Problem Statement
Given an integer array ARR
of size N
containing only integers 0 and 1, implement a function to sort this array. The solution should scan the array only once without using any addi...read more
Sort an array of 0s and 1s in linear time without using additional arrays.
Iterate through the array and maintain two pointers, one for 0s and one for 1s.
Swap elements at the two pointers based on the current element being 0 or 1.
Continue this process until the entire array is sorted in place.
Q2. Maximum Frequency Number Problem Statement
Given an array of integers with numbers in random order, write a program to find and return the number which appears the most frequently in the array.
If multiple elem...read more
Find the number with the maximum frequency in an array of integers.
Iterate through the array and keep track of the frequency of each number using a hashmap.
Find the number with the maximum frequency and return it.
If multiple elements have the same maximum frequency, return the one that appears first.
Q3. Maximum Subarray Sum Problem Statement
Given an array of integers, determine the maximum possible sum of any contiguous subarray within the array.
Example:
Input:
array = [34, -50, 42, 14, -5, 86]
Output:
137
E...read more
Find the maximum sum of any contiguous subarray within an array of integers.
Iterate through the array and keep track of the maximum sum of subarrays encountered so far.
At each index, decide whether to include the current element in the subarray or start a new subarray.
Update the maximum sum if a new maximum is found.
Example: For array [34, -50, 42, 14, -5, 86], the maximum sum is 137.
Example: For array [-5, -1, -8, -9], the maximum sum is -1.
Q4. Reverse Linked List Problem Statement
Given a singly linked list of integers, return the head of the reversed linked list.
Example:
Initial linked list: 1 -> 2 -> 3 -> 4 -> NULL
Reversed linked list: 4 -> 3 -> 2...read more
Reverse a singly linked list of integers and return the head of the reversed linked list.
Iterate through the linked list and reverse the pointers to point to the previous node instead of the next node.
Use three pointers to keep track of the current, previous, and next nodes while reversing the linked list.
Update the head of the reversed linked list as the last node encountered during the reversal process.
Q5. Shortest Path in a Binary Matrix Problem Statement
Given a binary matrix of size N * M
where each element is either 0 or 1, find the shortest path from a source cell to a destination cell, consisting only of 1s...read more
Find the shortest path in a binary matrix from a source cell to a destination cell consisting only of 1s.
Use Breadth First Search (BFS) to explore all possible paths from the source cell to the destination cell.
Keep track of visited cells to avoid revisiting them.
Update the path length as you traverse through the matrix.
Return the shortest path length found or -1 if no valid path exists.
Q6. Trapping Rain Water
You are provided with an array ARR
of integers representing an elevation map, where ARR[i]
denotes the elevation of the ith
bar. Determine the maximum amount of rainwater that can be trapped...read more
Given an array representing an elevation map, find the maximum amount of rainwater that can be trapped between the bars.
Iterate through the array and calculate the maximum height on the left and right of each bar.
Calculate the trapped water by finding the minimum of the maximum heights on the left and right minus the current bar height.
Sum up the trapped water for all bars to get the total trapped rainwater.
Example: For input [0, 1, 0, 2], the trapped rainwater is 1 unit.
Exam...read more
Q7. Buy and Sell Stock Problem Statement
Imagine you are Harshad Mehta's friend, and you have been given the stock prices of a particular company for the next 'N' days. You can perform up to two buy-and-sell transa...read more
The task is to determine the maximum profit that can be achieved by performing up to two buy-and-sell transactions on a given set of stock prices.
Iterate through the array of stock prices to find the maximum profit that can be achieved by buying and selling stocks.
Keep track of the maximum profit that can be obtained by performing two transactions.
Consider all possible combinations of buying and selling stocks to maximize profit.
Ensure to sell the stock before buying again to...read more
Q8. Ninja and Bombs Problem Statement
Ninja wants to travel from his house to his best friend's house. The locations of the houses are on a 2D coordinate plane, where Ninja's house is located at the origin (0, 0). ...read more
Determine if Ninja can reach his friend's house with even x-coordinate without using modulus operator.
Check if the x-coordinate is even or odd by using bitwise AND operation with 1.
Return 1 if x-coordinate is even, else return 0.
Handle multiple test cases by iterating through each input.
Q9. Longest Substring with At Most K Distinct Characters
Given a string S
of length N
and an integer K
, find the length of the longest substring that contains at most K
distinct characters.
Input:
The first line co...read more
Find the length of the longest substring with at most K distinct characters in a given string.
Use a sliding window approach to keep track of the characters and their counts within the window.
Maintain a hashmap to store the characters and their frequencies.
Update the window size and characters count as you iterate through the string.
Return the maximum window size encountered for each test case.
Q10. Valid Perfect Square Check
An integer N
is provided, and the task is to determine if N
is a perfect square. A perfect square refers to an integer which can be expressed as the square of another integer.
Sample ...read more
Implement a function to check if a given integer is a perfect square.
Create a function that takes an integer as input and returns true if it is a perfect square, false otherwise.
Iterate through possible square roots of the input integer and check if the square of the root equals the input.
Return true if a perfect square is found, false otherwise.
Q11. Bottom View of Binary Tree Problem Statement
Given a binary tree, the task is to print its bottom view from left to right. Assume the left and the right child nodes make a 45-degree angle with their parent node...read more
The task is to print the bottom view of a binary tree from left to right.
Traverse the binary tree in level order and keep track of the horizontal distance of each node from the root.
Store the nodes at each horizontal distance in a map, updating it as you traverse the tree.
After traversal, extract the bottom-most nodes at each horizontal distance to get the bottom view sequence.
Q12. Mean, Median, and Mode Problem Statement
Given an integer array ARR
of size N
, you need to compute the following three statistical measures:
- Mean: Implement the function
mean()
to calculate the mean of the arr...read more
Implement functions to calculate mean, median, and mode of an integer array.
Calculate mean by summing all elements and dividing by total count
Calculate median by sorting array and finding middle element(s)
Calculate mode by finding element with highest frequency, return smallest if multiple
Q13. Kth Smallest Element Problem Statement
You are provided with an array of integers ARR
of size N
and an integer K
. Your task is to find and return the K
-th smallest value present in the array. All elements in th...read more
Find the K-th smallest element in an array of distinct integers.
Sort the array and return the element at index K-1.
Use a min-heap to find the K-th smallest element efficiently.
Implement quickselect algorithm for optimal performance.
Q14. 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
The task is to find all distinct triplets in an array that sum up to a specified number.
Iterate through all possible triplets using three nested loops.
Check if the sum of the triplet equals the target sum.
Print the triplet if found, else print -1.
Q15. Find Duplicates in an Array
Given an array ARR
of size 'N', where each integer is in the range from 0 to N - 1, identify all elements that appear more than once.
Return the duplicate elements in any order. If n...read more
Find duplicates in an array of integers within a specified range.
Iterate through the array and keep track of the count of each element using a hashmap.
Return elements with count greater than 1 as duplicates.
Time complexity can be optimized to O(N) using a set to store seen elements.
Q16. Merge Sort Problem Statement
Given a sequence of numbers 'ARR', your task is to return a sorted sequence of 'ARR' in non-descending order using the Merge Sort algorithm.
Example:
Input:
ARR = [5, 3, 8, 6, 2]
Ou...read more
Implement Merge Sort algorithm to sort a given sequence of numbers in non-descending order.
Merge Sort is a divide-and-conquer algorithm that splits the array into two halves, recursively sorts each half, and then merges the sorted halves back together.
Time complexity of Merge Sort is O(n log n) in the worst case scenario.
It is a stable sorting algorithm, meaning that the relative order of equal elements is preserved.
Example: Input: [5, 3, 8, 6, 2], Output: [2, 3, 5, 6, 8]
Q17. K Sum Subset Problem Statement
You are provided with an array arr
of size N
and an integer K
. Your objective is to compute the maximum sum of a subset of the array such that this sum does not exceed K
.
Example:...read more
Find the maximum sum of a subset of an array that does not exceed a given value K.
Sort the array in descending order to maximize the sum.
Iterate through the array and add elements to the sum until it exceeds K.
Return the sum obtained before exceeding K.
Q18. Diamond Pattern Grid Problem
Create a grid pattern of size R rows and C columns, where each cell contains a diamond-like shape of size S. The diamond shape is made with characters ‘/’ and ‘\’ for the borders, ‘...read more
Create a grid pattern with diamond shapes of given size in each cell.
Iterate through each cell in the grid and construct the diamond shape based on the size provided.
Use 'e' for the outer space, '/' and '' for the borders, 'o' for the inner space of the diamond.
Adjust the positioning of characters based on the size of the diamond to create the desired pattern.
Implementing cart functionality in an e-commerce application involves managing user interactions, updating quantities, handling discounts, and processing orders.
Create a data structure to store cart items, quantities, and prices.
Implement add to cart, remove from cart, and update quantity functionalities.
Handle discounts, promotions, and coupon codes.
Calculate total price, including taxes and shipping costs.
Implement checkout process to place orders and update inventory.
Consi...read more
Implement multiple RecyclerViews on a magnified screen in an Android app by adjusting item sizes and spacing.
Adjust item sizes and spacing based on screen magnification level
Use nested RecyclerViews or custom layouts to display multiple lists
Implement custom item decorators to manage spacing between RecyclerViews
Consider using a GridLayoutManager with custom span sizes for each RecyclerView
Q21. How can you collect NPA payment in case costumer contact has been missing
To collect NPA payment when customer contact is missing, utilize various methods such as skip tracing, contacting references, using social media, and legal actions if necessary.
Perform skip tracing to locate the customer's current contact information.
Contact references provided by the customer to gather any updated contact details.
Utilize social media platforms to search for the customer and attempt to establish contact.
Send written communication to the customer's last known ...read more
Q22. Design a system that can handle 10 lacs transactions per second
Design a system to handle 10 lacs transactions per second.
Use distributed systems and load balancing to handle the high volume of transactions.
Implement caching mechanisms to reduce database load.
Use high-performance hardware and optimize code for speed.
Consider using a NoSQL database for faster read/write operations.
Implement fault-tolerant mechanisms to ensure system reliability.
Use asynchronous processing to handle requests quickly.
Consider using a message queue to handle ...read more
Q23. How to exploit/test for the same
To exploit/test for vulnerabilities, use penetration testing tools and techniques to simulate attacks and identify weaknesses.
Use vulnerability scanners to identify potential vulnerabilities
Conduct penetration testing to simulate attacks and identify weaknesses
Perform social engineering tests to assess human vulnerabilities
Use fuzzing techniques to identify software vulnerabilities
Conduct code reviews to identify potential vulnerabilities
Test for security misconfigurations
Use...read more
Q24. Create an custom hashmap with all the function with oops concept
Create a custom hashmap with OOPs concepts
Create a class for the hashmap with private variables for key and value
Implement methods for adding, removing and retrieving elements
Use inheritance to create a separate class for each type of data to be stored
Use encapsulation to protect the data and ensure proper access
Use polymorphism to allow for different types of data to be stored in the same hashmap
Q25. what is the bridge between swiftui and uikit
The bridge between SwiftUI and UIKit is represented by the UIViewRepresentable and UIViewControllerRepresentable protocols.
UIViewRepresentable and UIViewControllerRepresentable protocols allow SwiftUI views to interact with UIKit views and controllers respectively.
UIViewRepresentable is used to wrap a UIKit view and make it available to SwiftUI.
UIViewControllerRepresentable is used to wrap a UIKit view controller and make it available to SwiftUI.
These protocols enable develop...read more
Q26. What you tell when customer said I don't pay this amount? ?
Explain the importance of paying the amount and address any concerns the customer may have.
Explain the reasons for the amount owed (e.g. services provided, products purchased)
Discuss the consequences of not paying the amount (e.g. late fees, credit score impact)
Offer solutions or payment plans to help the customer meet their financial obligations
Listen to the customer's concerns and try to find a mutually beneficial resolution
Q27. What are the strategies you are using to enhance your callers productivity and make them fruitful.
I implement training programs, provide resources, set clear goals, and offer regular feedback to enhance caller productivity.
Implementing training programs to improve skills and knowledge
Providing resources such as tools and technology to streamline processes
Setting clear goals and expectations for callers to work towards
Offering regular feedback and coaching to help callers improve performance
Designing a Google Search Engine involves creating a web crawler, indexing system, and ranking algorithm.
Develop a web crawler to discover and retrieve web pages.
Implement an indexing system to store and organize the content of web pages.
Design a ranking algorithm to determine the relevance of search results.
Include features like autocomplete, spell check, and personalized search results.
Optimize for speed and scalability to handle large amounts of data and user queries.
Q29. How do you increase the productivity of your callers.
Increasing caller productivity through training, motivation, and efficient tools.
Provide comprehensive training on product knowledge and communication skills
Implement performance incentives to motivate callers to meet and exceed targets
Utilize efficient call center software and tools to streamline processes and improve efficiency
Q30. types of init and their behavior
There are designated initializers in Swift that have specific behaviors, such as convenience init and required init.
Designated initializers are primary initializers for a class and must call a designated initializer from its superclass.
Convenience initializers are secondary initializers that must call another initializer in the same class.
Required initializers must be implemented by all subclasses of a class.
Q31. Difference between SSRF & CSRF
SSRF is an attack that allows an attacker to send a crafted request from a vulnerable web application. CSRF is an attack that tricks a victim into performing an action on a website without their knowledge or consent.
SSRF stands for Server-Side Request Forgery while CSRF stands for Cross-Site Request Forgery.
SSRF allows an attacker to send a request from a vulnerable server to a third-party server while CSRF tricks a victim into performing an action on a website.
SSRF can be us...read more
Q32. How do you reduce idle percentage.
To reduce idle percentage, focus on optimizing workflow, improving communication, setting clear goals, and monitoring performance.
Optimize workflow by identifying and eliminating bottlenecks or inefficiencies.
Improve communication among team members to ensure tasks are being completed efficiently.
Set clear goals and expectations for employees to keep them focused and motivated.
Monitor performance regularly to identify areas for improvement and provide feedback.
Implement time ...read more
Q33. Name Qualifications Experience How convenience a merchant
I am a highly qualified and experienced professional who can provide convenience to merchants through my expertise and skills.
Qualifications: MBA in Marketing, Certified Fintech Professional
Experience: 10+ years in sales and marketing, 5+ years in fintech industry
Convenience to merchant: By offering personalized solutions, optimizing processes, and providing excellent customer service
Example: Implementing a new POS system to streamline transactions and improve efficiency
Q34. Are you ready to loot customers?
Q35. 1. Process for projections 2. Team leading experience
Q36. implement Delegate pattern
Delegate pattern is a design pattern in which an object delegates some of its responsibilities to another object.
Create a protocol defining the methods that the delegate should implement
Declare a delegate property in the delegating class
Set the delegate property to the object that will act as the delegate
Call the delegate methods from the delegating class
Q37. Are you ready to lie 100%?
Q38. Are you ready to steal money?
Q39. Low level design of rate limiter
Rate limiter is a system that controls the rate of traffic sent or received by a network interface.
Implement a token bucket algorithm to track and limit the rate of requests
Use a sliding window algorithm to track the number of requests within a specific time frame
Consider using a distributed rate limiter for scalability and fault tolerance
Q40. LRU Cache Design framework for exception handling
Design a framework for exception handling in a LRU Cache system
Implement try-catch blocks to handle exceptions
Use specific exception classes for different types of errors
Consider using logging mechanisms to track and debug exceptions
Implement a global exception handler to catch unhandled exceptions
Q41. Tell about collection
Collection is the process of recovering outstanding debts from individuals or businesses.
Collection involves contacting debtors to remind them of their outstanding debts
Negotiating payment plans with debtors to settle the debts
Taking legal action if necessary to recover the debts
Maintaining accurate records of all collection activities
Examples: calling customers for overdue payments, sending reminder letters, negotiating settlements
Q42. Buidling products from 0 to 1 experience
Experience in developing products from ideation to launch
Identifying market needs and opportunities
Creating a product roadmap and strategy
Leading cross-functional teams in product development
Iterating on prototypes based on user feedback
Launching and scaling the product successfully
Q43. 1.Messaging queue working like Kafka
Messaging queue system similar to Kafka for real-time data processing and streaming
Kafka is a distributed streaming platform capable of handling high volumes of data in real-time
It uses topics to organize data streams and partitions for scalability
Producers publish messages to topics and consumers subscribe to topics to receive messages
Kafka provides fault tolerance, scalability, and high throughput for data processing
Example: Apache Kafka, Amazon Kinesis, Google Cloud Pub/Su...read more
Q44. How to improve chrome browser
Improve Chrome browser by optimizing performance, enhancing security, and adding new features.
Optimize memory usage to improve performance
Enhance security by regularly updating security protocols
Add new features like built-in ad blocker or improved tab management
Improve compatibility with web standards and technologies
Q45. 1. Design notification system
Design a notification system for timely alerts and updates.
Identify the target audience and their preferred communication channels (email, SMS, push notifications, etc.)
Define the types of notifications to be sent (urgent alerts, reminders, updates, etc.)
Implement a user-friendly interface for users to manage their notification preferences
Include features like scheduling notifications, customizing notification settings, and tracking delivery status
Ensure the system is scalabl...read more
Top HR Questions asked in Pushpinder Singh Sidhu Contractor
Interview Process at Pushpinder Singh Sidhu Contractor
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month