Barclays
20+ Shri Padhmam Industries Interview Questions and Answers
Q1. Shopping Spree Problem Statement
Preeti plans to shop for her father's birthday at a store with unlimited quantities of N different items. She has a budget that allows her to buy a maximum of K items. Help Pree...read more
Q2. Words Magic with Prefix Replacement Problem
Ninja is provided with a dictionary of words, WORDS
, and a sentence, SENTENCE
, which consists of words separated by spaces. The goal is to minimize the size of the SE...read more
Q3. How you will find the smallest of 4 numbers without using >.< and min function using java
Finding smallest of 4 numbers without using >.< and min function in Java.
Initialize a variable with the first number
Compare it with the remaining numbers using if-else statements
If a smaller number is found, update the variable
Repeat until all numbers are compared
The final value of the variable will be the smallest number
Q4. Longest Increasing Subsequence Problem Statement
Given an array of integers with 'N' elements, determine the length of the longest subsequence where each element is greater than the previous element. This subse...read more
Q5. Swap two number without using temperory variable
Swap two numbers without using a temporary variable.
Use addition and subtraction to swap the values
Use XOR operator to swap the values
Use multiplication and division to swap the values
Q6. How you will add 2 table
To add 2 tables, we need to use a join operation on a common column.
Identify the common column between the tables
Choose the appropriate join type (inner, outer, left, right)
Write the SQL query to join the tables
Example: SELECT * FROM table1 INNER JOIN table2 ON table1.column = table2.column
Q7. Sum of Two Elements Equals the Third
Determine if a given array contains a valid triplet of integers where two elements sum up to the third. Specifically, find indices i, j, and k such that i != j
, j != k
, and ...read more
Q8. First Missing Positive Problem Statement
You are provided with an integer array ARR
of length 'N'. Your objective is to determine the first missing positive integer using linear time and constant space. This me...read more
Q9. Difference between union and union all
Union combines and removes duplicates, Union All combines all rows including duplicates.
Union is used to combine the result sets of two or more SELECT statements and remove duplicates.
Union All is used to combine the result sets of two or more SELECT statements and includes all rows, including duplicates.
Union is slower than Union All as it has to remove duplicates.
Union requires the same number of columns in all SELECT statements, while Union All does not.
Example: SELECT col...read more
Q10. Write a code for palindrome
Code for palindrome checking
Convert the input to lowercase to ignore case sensitivity
Use two pointers, one at the start and one at the end of the string
Compare the characters at both pointers and move them towards each other
If all characters match, it's a palindrome
Q11. Reverse String Word Wise
You are tasked with reversing the given string word-wise. This means that the last word in the input string should appear first, the second-last word second, and so on. Importantly, eac...read more
Q12. Write any javascript code
Javascript code to display 'Hello World!' on the webpage
Create a new HTML file
Add a script tag with 'type' attribute set to 'text/javascript'
Inside the script tag, use document.write() to display 'Hello World!'
Q13. Z Algorithm Problem Statement
You are provided with a string S
of length N
and a string P
of length M
. Your objective is to determine the number of times P
appears in S
in linear time.
Example:
Input:
S = "abab...read more
Q14. Print Name and Age Task
The goal is to output the name and age provided by the user.
Input:
Line 1: A String
Line 2: An Integer
Output:
Display the entered String and Integer.
Example:
Input:
John
25
Output:
John ...read more
Q15. How many barbers are required for a hypothetical town with 10000 people?
The number of barbers required depends on the average number of haircuts per day and the time it takes to complete a haircut.
The average number of haircuts per day per barber is typically around 10-15.
The time it takes to complete a haircut is usually around 30 minutes.
Assuming each person gets a haircut once every month, the number of haircuts per day would be 10000 / 30 = 333.33.
To accommodate this, around 333.33 / 10 = 33.33 barbers would be required.
Q16. How do you explain classes and objects to a 1st standard kid?
Classes are like blueprints and objects are like things made using those blueprints.
Classes are like instructions or rules that tell us how to make something.
Objects are the actual things that we make using those instructions.
For example, a class 'Car' tells us how to make a car, and an object 'myCar' is the actual car that we make using those instructions.
Q17. Explain me some of the Object Oriented Programming Concepts?
Object Oriented Programming (OOP) concepts include encapsulation, inheritance, polymorphism, and abstraction.
Encapsulation: Bundling data and methods together in a class to hide implementation details.
Inheritance: Creating new classes from existing ones, inheriting their properties and behaviors.
Polymorphism: The ability of objects of different classes to respond to the same method in different ways.
Abstraction: Simplifying complex systems by breaking them down into smaller, ...read more
Q18. Explain the time complexity of different sorting algorithms.
Sorting algorithms have different time complexities based on their implementation and efficiency.
Bubble Sort: O(n^2) - compares adjacent elements and swaps them if they are in the wrong order.
Merge Sort: O(n log n) - divides the array into two halves, sorts them, and then merges them.
Quick Sort: O(n log n) - picks a pivot element and partitions the array around the pivot.
Heap Sort: O(n log n) - builds a max heap and repeatedly extracts the maximum element.
Insertion Sort: O(n^...read more
Q19. Explain 4 pillars of OOPs (Abstraction, Encapsulation, Inheritance and polymorphism)
OOPs pillars are Abstraction, Encapsulation, Inheritance, and Polymorphism.
Abstraction: Hides complex implementation details and only shows necessary features. Example: Car dashboard displaying speed without showing internal engine details.
Encapsulation: Bundling data and methods that operate on the data into a single unit. Example: Class in Java encapsulates data members and member functions.
Inheritance: Allows a new class to inherit properties and behavior of an existing cl...read more
Q20. Explain JOINS(Inner join, LEFT Join etc)
JOINS are used in SQL to combine rows from two or more tables based on a related column between them.
Inner Join: Returns rows when there is at least one match in both tables.
LEFT Join: Returns all rows from the left table, and the matched rows from the right table.
RIGHT Join: Returns all rows from the right table, and the matched rows from the left table.
FULL Join: Returns rows when there is a match in one of the tables.
Self Join: Joining a table with itself.
Q21. What do you know about internal audit?
Internal audit is an independent, objective assurance and consulting activity designed to add value and improve an organization's operations.
Internal audit evaluates the effectiveness of an organization's risk management, control, and governance processes.
It provides recommendations for improvement and helps organizations achieve their objectives.
Internal auditors are responsible for assessing the accuracy of financial statements and ensuring compliance with laws and regulati...read more
Q22. Usage of Hashmaps and Dictionaries
Hashmaps and dictionaries are data structures used to store key-value pairs for efficient retrieval and storage.
Hashmaps and dictionaries are commonly used in programming to store and retrieve data based on a unique key.
They offer fast lookup times, typically O(1) on average, making them ideal for scenarios where quick access to data is required.
Examples of using hashmaps include storing user information with a unique user ID as the key, or mapping words to their frequencies ...read more
Top HR Questions asked in Shri Padhmam Industries
Interview Process at Shri Padhmam Industries
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month