Amdocs
100+ Muthoot Finance Interview Questions and Answers
Q1. First Unique Character in a Stream Problem Statement
Given a string A
consisting of lowercase English letters, determine the first non-repeating character at each point in the stream of characters.
Example:
Inp...read more
Given a string of lowercase English letters, find the first non-repeating character at each point in the stream.
Create a hashmap to store the frequency of each character as it appears in the stream.
Iterate through the stream and check the frequency of each character to find the first non-repeating character.
Output the first non-repeating character at each point in the stream.
Q2. Find the Third Greatest Element
Given an array 'ARR' of 'N' distinct integers, determine the third largest element in the array.
Input:
The first line contains a single integer 'T' representing the number of te...read more
Find the third largest element in an array of distinct integers.
Sort the array in descending order and return the element at index 2.
Handle cases where there are less than 3 elements in the array separately.
Make sure to handle duplicates properly.
Q3. Palindromic Substrings Problem Statement
Given a string S
, your task is to return all distinct palindromic substrings of the given string in alphabetical order.
Explanation:
A string is considered a palindrome ...read more
Return all distinct palindromic substrings of a given string in alphabetical order.
Iterate through all possible substrings of the given string.
Check if each substring is a palindrome.
Store distinct palindromic substrings in alphabetical order.
Q4. Ways To Make Coin Change
Given an infinite supply of coins of varying denominations, determine the total number of ways to make change for a specified value using these coins. If it's not possible to make the c...read more
The task is to find the total number of ways to make change for a specified value using given denominations.
Use dynamic programming to solve this problem efficiently.
Create a 2D array to store the number of ways to make change for each value up to the specified value.
Iterate through each denomination and update the array accordingly.
The final answer will be in the last cell of the array.
Consider edge cases such as when the value to make change for is 0.
Q5. Subarray with Equal Occurrences Problem Statement
You are provided with an array/list ARR
of length N
containing only 0s and 1s. Your goal is to determine the number of non-empty subarrays where the number of 0...read more
Count the number of subarrays where the number of 0s is equal to the number of 1s in a given array of 0s and 1s.
Iterate through the array and keep track of the count of 0s and 1s encountered so far.
Use a hashmap to store the count of 0s and 1s encountered at each index.
For each index, check if the count of 0s is equal to the count of 1s encountered so far and update the total count accordingly.
Q6. Cycle Detection in a Singly Linked List
Determine if a given singly linked list of integers forms a cycle or not.
A cycle in a linked list occurs when a node's next
points back to a previous node in the list. T...read more
Detect if a singly linked list forms a cycle by checking if a node's next pointer points back to a previous node.
Use Floyd's Cycle Detection Algorithm to determine if there is a cycle in the linked list.
Maintain two pointers, one moving at twice the speed of the other, and check if they meet at any point.
If the fast pointer reaches the end of the list (null), there is no cycle.
If the fast and slow pointers meet at some point, there is a cycle in the linked list.
Q7. Merge Sort Problem Statement
You are 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.
Explanation:
The Merge Sort algorit...read more
Implement Merge Sort algorithm to sort a sequence of numbers in non-descending order.
Divide the input array into two halves recursively until each array has only one element.
Merge the sorted halves to produce a completely sorted array.
Time complexity of Merge Sort is O(n log n).
Example: Input: [3, 1, 4, 1, 5], Output: [1, 1, 3, 4, 5]
Q8. Pythagorean Triplet Problem
Determine if there exists a Pythagorean triplet within a given array of integers. A Pythagorean triplet consists of three numbers, x, y, and z, such that x^2 + y^2 = z^2.
Explanation...read more
Check if a Pythagorean triplet exists in a given array of integers.
Iterate through all possible combinations of three numbers in the array and check if they form a Pythagorean triplet.
Use a nested loop to generate all possible combinations efficiently.
Check if the sum of squares of two numbers is equal to the square of the third number.
Q9. 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
Check if two strings are anagrams of each other by comparing their sorted characters.
Sort the characters of both strings and compare them.
Use a dictionary to count the frequency of characters in each string and compare the dictionaries.
Ensure both strings have the same length before proceeding with the comparison.
Example: For input 'spar' and 'rasp', after sorting both strings, they become 'aprs' which are equal, so return True.
Q10. Pythagorean Triplets Detection
Determine if an array contains a Pythagorean triplet by checking whether there are three integers x, y, and z such that x2 + y2 = z2 within the array.
Input:
The first line contai...read more
Detect if an array contains a Pythagorean triplet by checking if there are three integers x, y, and z such that x^2 + y^2 = z^2.
Iterate through all possible triplets of numbers in the array and check if they form a Pythagorean triplet.
Use a nested loop to generate all possible combinations of three numbers from the array.
Check if the sum of squares of two numbers is equal to the square of the third number for each triplet.
Return 'yes' if a Pythagorean triplet is found, otherw...read more
Q11. Intersection of Linked List Problem
You are provided with two singly linked lists containing integers, where both lists converge at some node belonging to a third linked list.
Your task is to determine the data...read more
Find the node where two linked lists merge.
Traverse both lists to find the lengths and the last nodes.
Align the starting points of the longer list with the shorter list.
Traverse both lists simultaneously until the nodes match.
Return the data of the matching node or -1 if no merging occurs.
Q12. Nth Fibonacci Number Problem Statement
Calculate the Nth term in the Fibonacci sequence, where the sequence is defined as follows: F(n) = F(n-1) + F(n-2)
, with initial conditions F(1) = F(2) = 1
.
Input:
The inp...read more
Calculate the Nth Fibonacci number efficiently using dynamic programming.
Use dynamic programming to store and reuse previously calculated Fibonacci numbers.
Start with base cases F(1) and F(2) as 1, then calculate subsequent Fibonacci numbers.
Optimize the solution to avoid redundant calculations and improve efficiency.
Q13. 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 - prev, current, and next to reverse the linked list in O(N) time and O(1) space complexity.
Update the head of the reversed linked list as the last node encountered during the reversal process.
Q14. Swap Two Numbers Problem Statement
Given two integers a
and b
, your task is to swap these numbers and output the swapped values.
Input:
The first line contains a single integer 't', representing the number of t...read more
Swap two integers 'a' and 'b' and output the swapped values.
Create a temporary variable to store one of the integers before swapping.
Swap the values of 'a' and 'b' using the temporary variable.
Output the swapped values of 'a' and 'b'.
Q15. Find First Unique Character in a String
You are given a string S
of length N
. Your task is to find the index (considering 1-based indexing) of the first unique character in the string. If there are no unique ch...read more
Find the index of the first unique character in a given string, return -1 if no unique characters are found.
Create a hashmap to store the frequency of each character in the string.
Iterate through the string and find the first character with frequency 1.
Return the index of the first unique character or -1 if no unique characters are found.
Q16. First Unique Character in a String Problem Statement
Given a string STR
consisting of lowercase English letters, identify the first non-repeating character in the string and return it. If no such character exis...read more
Identify the first non-repeating character in a string and return it, or '#' if none exists.
Iterate through the string to count the frequency of each character
Iterate through the string again to find the first character with frequency 1
Return the first non-repeating character or '#' if none exists
Q17. Palindrome String Validation
Determine if a given string 'S' is a palindrome, considering only alphanumeric characters and ignoring spaces and symbols.
Note:
The string 'S' should be evaluated in a case-insensi...read more
Check if a given string is a palindrome after removing special characters, spaces, and converting to lowercase.
Remove special characters and spaces from the string
Convert the string to lowercase
Check if the modified string is a palindrome by comparing characters from start and end
Q18. Puzzle:- you have two jars 3L and 5L and unlimited supply of water. How will you calculate 4L of water.
To measure 4L of water using 3L and 5L jars, fill the 5L jar, pour 3L into the 3L jar, empty the 3L jar, and pour the remaining 2L from the 5L jar into the 3L jar. Finally, fill the 5L jar again and pour 1L into the 3L jar. Now, the 5L jar contains 4L of water.
Fill the 5L jar completely
Pour 3L from the 5L jar into the 3L jar
Empty the 3L jar
Pour the remaining 2L from the 5L jar into the 3L jar
Fill the 5L jar again
Pour 1L from the 5L jar into the 3L jar
Q19. Minimum Spanning Tree Problem Statement
You are provided with an undirected, connected, and weighted graph G(V, E). The graph comprises V vertices (numbered from 0 to V-1) and E edges.
Determine and return the ...read more
Find the total weight of the Minimum Spanning Tree in a graph using Kruskal's algorithm.
Implement Kruskal's algorithm to find the Minimum Spanning Tree.
Sort the edges based on their weights and add them to the MST if they don't form a cycle.
Keep track of the total weight of the MST and return it as the output.
Q20. Maximum Points On Straight Line Problem Statement
You are provided with a 2-D plane and a set of integer coordinates. Your task is to determine the maximum number of these coordinates that can be aligned in a s...read more
Find the maximum number of points that can be aligned in a straight line on a 2-D plane.
Iterate through each pair of points and calculate the slope between them.
Store the slope in a hashmap and keep track of the frequency of each slope.
The maximum frequency of slopes + 1 gives the maximum number of points on a straight line.
Q21. 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 duplicates.
To check for integer overflow when multiplying two integers, use the properties of integer overflow and check if the result is within the valid range of the integer type.
Check if the signs of the two integers are the same to avoid overflow in case of multiplication.
Use the properties of integer overflow to detect if the result exceeds the maximum or minimum value of the integer type.
Consider using a larger data type or a library that supports arbitrary-precision arithmetic if...read more
Use SQL query with GROUP BY and HAVING clause to delete duplicate emails from a database.
Use GROUP BY clause to group emails together
Use HAVING clause to filter out groups with more than one email
Use DELETE statement to remove duplicate emails
Constructor is a special method used to initialize objects, while a method is a regular function that performs a specific task.
Constructor is called automatically when an object is created, while a method needs to be called explicitly.
Constructors have the same name as the class, while methods have unique names.
Constructors do not have a return type, while methods have a return type.
Example: Constructor - public ClassName() { // initialization code }, Method - public void met...read more
Use three threads to print numbers from 1 to 100 in sequence.
Create three threads, each responsible for printing numbers in a specific range (e.g. 1-33, 34-66, 67-100).
Use synchronization mechanisms like mutex or semaphore to ensure proper sequencing of numbers.
Thread 1 prints numbers 1-33, Thread 2 prints numbers 34-66, Thread 3 prints numbers 67-100.
DELETE removes specific rows from a table, while TRUNCATE removes all rows and resets auto-increment values.
DELETE is a DML command, while TRUNCATE is a DDL command.
DELETE can be rolled back, while TRUNCATE cannot be rolled back.
DELETE triggers ON DELETE triggers, while TRUNCATE does not trigger any triggers.
DELETE is slower as it maintains logs, while TRUNCATE is faster as it does not maintain logs.
Example: DELETE FROM table_name WHERE condition; TRUNCATE table_name;
Use a 3-liter can and a 5-liter can to measure exactly 4 liters of water.
Fill the 3-liter can and pour it into the 5-liter can, leaving 2 liters in the 3-liter can.
Empty the 5-liter can, then pour the remaining 2 liters from the 3-liter can into the 5-liter can.
Fill the 3-liter can again and pour it into the 5-liter can, which already has 2 liters, making it 4 liters.
Overloading is having multiple methods in the same class with the same name but different parameters, while overriding is implementing a method in a subclass that is already defined in the superclass.
Overloading involves multiple methods with the same name but different parameters.
Overriding involves implementing a method in a subclass that is already defined in the superclass.
Overloading is determined at compile time based on the method signature, while overriding is determi...read more
SOLID principles are a set of five design principles that help make software designs more understandable, flexible, and maintainable.
S - Single Responsibility Principle: A class should have only one reason to change.
O - Open/Closed Principle: Objects should be open for extension but closed for modification.
L - Liskov Substitution Principle: Subtypes should be substitutable for their base types.
I - Interface Segregation Principle: Clients should not be forced to depend on inte...read more
To take a backup of a table in MySQL, you can use the mysqldump command.
Use the mysqldump command followed by the database name and table name to backup a specific table.
You can also specify the username and password for the MySQL server using the -u and -p flags.
To backup all tables in a database, use the --all-databases flag with the mysqldump command.
Q31. What is singleton calss?Write a program to make a class singleton?
Singleton class is a class that can only have one instance at a time.
It is used to control access to a shared resource or limit the instantiation of a class to one object.
To make a class singleton, make the constructor private and provide a static method to get the instance.
Example: public class Singleton { private static Singleton instance = new Singleton(); private Singleton() {} public static Singleton getInstance() { return instance; } }
Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity, while denormalization is the process of intentionally adding redundancy to improve query performance.
Normalization involves breaking down a table into smaller tables and defining relationships between them to reduce redundancy and dependency.
Denormalization involves combining tables or adding redundant data to improve query performance by reducing the number of joins...read more
Q33. Challenges faced in your RPA experience and how you resolved it?
Challenges faced in RPA experience and how resolved
One challenge was automating a process with multiple decision points, resolved by creating a decision tree
Another challenge was handling exceptions, resolved by implementing exception handling mechanisms
Integration with legacy systems was a challenge, resolved by creating custom connectors
Lack of standardization in input data was a challenge, resolved by implementing data validation and cleansing mechanisms
Serialization is the process of converting an object into a byte stream, while deserialization is the reverse process.
Serialization is used to persist object state or transmit objects over a network.
Deserialization reconstructs the object from the byte stream.
Java provides Serializable interface for serialization and ObjectInputStream/ObjectOutputStream classes for deserialization.
Example: Serializing an object to a file or sending it over a network.
Singleton class in Java ensures that a class has only one instance and provides a global point of access to it.
Singleton class restricts the instantiation of a class to one object.
It provides a way to access its unique instance globally.
Commonly implemented using a private constructor, static method, and a static instance variable.
Example: Logger class in Java can be implemented as a Singleton to ensure only one instance is used for logging.
Q36. What is vptr and vptr table? how many instances of them are created and when?
vptr stands for virtual pointer and vptr table is a table of function pointers used in polymorphism in C++.
vptr is a hidden member variable in C++ objects that points to the vptr table.
vptr table is a table of function pointers that maps virtual functions to their addresses.
Each object of a class with virtual functions has its own vptr and shares the same vptr table with other objects of the same class.
vptr and vptr table are created when an object of a class with virtual fun...read more
Q37. What is serialization and Deserialization?write a program
Serialization is the process of converting an object into a stream of bytes, while deserialization is the reverse process.
Serialization is used for data storage, transmission, and object persistence.
Deserialization is used to recreate the original object from the serialized data.
Examples of serialization formats include JSON, XML, and binary formats like Protocol Buffers and Apache Avro.
Serialization can also be used for deep copying objects.
Deserialization can be vulnerable ...read more
Piping in Unix/Linux allows the output of one command to be used as the input for another command.
Piping is done using the | symbol
It helps in chaining multiple commands together
Example: ls -l | grep .txt
Q39. Write a program to find duplicate elements in arraylist by min number of iterations?
Program to find duplicate elements in arraylist with minimum iterations
Use HashSet to store unique elements and ArrayList to store duplicates
Iterate through the ArrayList only once
Use contains() method to check if element is already in HashSet
Garbage collector in Java is a part of JVM responsible for automatic memory management by reclaiming unused memory.
Garbage collector is responsible for identifying and deleting objects that are no longer needed in memory.
It helps in preventing memory leaks and optimizing memory usage.
Examples of garbage collectors in Java include Serial, Parallel, CMS, G1, and ZGC.
Q41. You have been given 9 balsa of same shape and size by using weighing scale you need to determine the heavy weight ball by weighing 3 times.
Weigh 3 groups of 3 balls each, then weigh 2 heaviest balls from the heaviest group to find the heaviest ball.
Divide the 9 balls into 3 groups of 3 balls each.
Weigh the first 2 groups against each other.
If one group is heavier, weigh 2 balls from that group against each other to find the heaviest ball.
If both groups weigh the same, weigh the third group to find the heaviest group.
Weigh 2 heaviest balls from the heaviest group to find the heaviest ball.
Check for a loop in a linked list by using two pointers moving at different speeds.
Use two pointers, one moving at double the speed of the other.
If there is a loop, the two pointers will eventually meet at the same node.
Example: 1 -> 2 -> 3 -> 4 -> 5 -> 2 (loop back to 2), the two pointers will meet at node 2.
Q43. Coding- String reversal and separation of vowel and consonants Swap two variables without using 3rd variable Pattern printing
Answering coding questions on string reversal, variable swapping, and pattern printing.
For string reversal, use a loop to iterate through the string and append each character to a new string in reverse order.
To separate vowels and consonants, use a loop to iterate through the string and check if each character is a vowel or consonant.
To swap two variables without a third variable, use arithmetic operations or XOR bitwise operator.
For pattern printing, use nested loops to prin...read more
Q44. Why we use const reference in copy constructor?
Const reference in copy constructor is used to avoid unnecessary object copying and improve performance.
Const reference allows us to pass objects by reference without modifying them.
Using const reference in copy constructor avoids creating a temporary copy of the object being passed.
It helps in preventing unnecessary memory allocation and improves performance.
Const reference ensures that the original object is not modified during the copy construction process.
Q45. write a program to display pattern. output - 1 12 123 1234
Program to display a pattern of numbers in a pyramid shape.
Use nested loops to print the numbers in the desired pattern.
The outer loop controls the number of rows and the inner loop prints the numbers in each row.
Use a variable to keep track of the number to be printed in each row.
Print a new line after each row is printed.
Q46. swaping of number using call by value , address and reference
Swapping of numbers can be done using call by value, address and reference.
Call by value: Pass the values of variables as arguments to the function. Swap the values inside the function.
Call by address: Pass the addresses of variables as arguments to the function. Swap the values using pointers inside the function.
Call by reference: Pass the references of variables as arguments to the function. Swap the values using references inside the function.
Q47. how to create Back Up table in mysql?
To create a backup table in MySQL, use the CREATE TABLE statement with SELECT INTO.
Use the CREATE TABLE statement with SELECT INTO to create a backup table.
Specify the name of the backup table and the name of the original table.
Use the SELECT INTO statement to copy the data from the original table to the backup table.
Example: CREATE TABLE backup_table SELECT * FROM original_table;
Make sure to regularly update the backup table to ensure data consistency.
Q48. Explain 4 words of OOPs. Encapsulation, Inheritance,Abstraction,Polymorphism
OOPs concepts include Encapsulation, Inheritance, Abstraction, and Polymorphism.
Encapsulation: bundling of data and methods that operate on that data
Inheritance: creating new classes from existing ones
Abstraction: hiding implementation details and showing only necessary information
Polymorphism: ability of objects to take on multiple forms or behaviors
Q49. whats are the diffrent position properties of css ?
CSS position properties are used to position elements on a web page.
The position property specifies the type of positioning method used for an element.
The top, bottom, left, and right properties are used to position the element.
The static, relative, absolute, fixed, and sticky values are used for the position property.
Static is the default value and elements are positioned according to the normal flow of the page.
Relative positions the element relative to its normal position....read more
Q50. What are the key concepts of Object-Oriented Programming (OOP)?
Key concepts of OOP include encapsulation, inheritance, polymorphism, and abstraction.
Encapsulation: Bundling data and methods that operate on the data into a single unit (object).
Inheritance: Allowing a class to inherit properties and behavior from another class.
Polymorphism: Objects of different classes can be treated as objects of a common superclass.
Abstraction: Hiding complex implementation details and showing only the necessary features to the outside world.
Q51. What is the internal working mechanism of a HashMap?
HashMap is a data structure that stores key-value pairs and uses hashing to quickly retrieve values based on keys.
HashMap internally uses an array of linked lists to store key-value pairs.
When a key-value pair is added, the key is hashed to determine the index in the array where the pair will be stored.
If multiple keys hash to the same index (collision), a linked list is used to store these pairs.
To retrieve a value, the key is hashed again to find the index and then the link...read more
Inner Join in SQL is used to combine rows from two or more tables based on a related column between them.
Inner Join returns only the rows that have matching values in both tables
It is the most common type of join used in SQL
Syntax: SELECT columns FROM table1 INNER JOIN table2 ON table1.column = table2.column
Example: SELECT orders.order_id, customers.customer_name FROM orders INNER JOIN customers ON orders.customer_id = customers.customer_id
Q53. write multi-threading program to print 1 2 1 2 using 2 thread.
A multi-threading program to print 1 2 1 2 using 2 threads.
Create two threads and pass a flag to each thread to print either 1 or 2.
Use a synchronization mechanism like mutex or semaphore to ensure alternate printing.
Join the threads to wait for their completion.
Q54. What is multithreading and POSIX thread and its synchronisation .
Multithreading is the ability of a CPU to execute multiple threads concurrently. POSIX thread is a standard for thread creation and management.
Multithreading allows multiple threads to run concurrently, improving performance and responsiveness.
POSIX thread (pthread) is a standard for creating and managing threads in Unix-based systems.
Thread synchronization is the coordination of threads to ensure that they do not interfere with each other's execution.
Mutexes, semaphores, and...read more
Views in SQL are virtual tables that are generated based on the result set of a SELECT query.
Views are used to simplify complex queries by storing them as virtual tables.
They can be used to restrict access to certain columns or rows of a table.
Views do not store data themselves, but display data from the underlying tables.
Changes made to the underlying tables are reflected in the views.
Example: CREATE VIEW vw_employee AS SELECT emp_id, emp_name FROM employees;
Q56. what is Garbage collector in java?
Garbage collector in Java is an automatic memory management system that frees up memory by removing unused objects.
Garbage collector runs in the background and identifies objects that are no longer in use
It frees up memory by removing those unused objects
It helps prevent memory leaks and improves performance
Java provides different types of garbage collectors such as Serial, Parallel, CMS, and G1
Example: If an object is created but not used anymore, the garbage collector will ...read more
Q57. What is volatile keyword and its Real time use
Volatile keyword is used to indicate that a variable's value can be changed unexpectedly.
It is used in multi-threaded programming to ensure that the value of a variable is always up-to-date and consistent across all threads.
It prevents the compiler from optimizing code that accesses the variable, ensuring that the variable is always read from memory and not from a cache.
Examples include hardware registers, shared memory, and global variables that can be accessed by multiple t...read more
Q58. write a program to reverse the string any language
Program to reverse a string in any language
Create an empty string variable to store the reversed string
Loop through the original string from the end to the beginning
Append each character to the empty string variable
Return the reversed string
Q59. Tell me about different types of joins in SQL
Different types of joins in SQL include inner join, left join, right join, and full outer join.
Inner join: Returns rows when there is a 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 outer join: Returns rows when there is a match in either table.
Q60. What is interfaces and demonstrate by example
Interfaces in software development define a contract for classes to implement certain methods or properties.
Interfaces in programming are like blueprints that define the structure of a class.
Classes that implement an interface must provide definitions for all the methods and properties specified in the interface.
Interfaces allow for polymorphism and code reusability.
Example: An interface 'Shape' may have methods like 'calculateArea' and 'calculatePerimeter', which classes lik...read more
Q61. What is views in sql?
Views in SQL are virtual tables that display data from one or more tables.
Views are created using SELECT statements.
They can be used to simplify complex queries.
They can also be used to restrict access to sensitive data.
Views do not store data themselves, but rather display data from other tables.
Example: CREATE VIEW myView AS SELECT * FROM myTable WHERE column = 'value';
Q62. Differentiate between null pointer and, dangling pointer
Null pointer points to nothing, while dangling pointer points to memory that has been deallocated.
Null pointer is a pointer that does not point to any memory location.
Dangling pointer is a pointer that points to memory that has been deallocated.
Accessing a null pointer will result in a segmentation fault.
Accessing a dangling pointer can lead to unpredictable behavior or crashes.
Example: int* nullPtr = nullptr; int* danglingPtr = new int; delete danglingPtr; danglingPtr = null...read more
Q63. What would be your Expected CTC?
My expected CTC would depend on the job role, company size, location, and benefits package.
Consider the job role and responsibilities when determining expected CTC.
Research industry standards and average salaries for similar positions.
Factor in the company size and location, as cost of living varies.
Take into account additional benefits such as healthcare, retirement plans, and bonuses.
Be prepared to negotiate based on your skills, experience, and market demand.
Q64. Difference between constructor and method?
Constructor is used to initialize an object while method is used to perform an action on an object.
Constructor is called automatically when an object is created while method is called explicitly.
Constructor has the same name as the class while method has a unique name.
Constructor does not have a return type while method has a return type.
Example of constructor: public class Car { public Car() { //initialize variables } }
Example of method: public void startEngine() { //perform...read more
Q65. Program for reverse of string in minimum iteration
Program to reverse a string in minimum iteration
Use two pointers, one at the start and one at the end of the string
Swap the characters at the two pointers and move the pointers towards each other
Repeat until the pointers meet in the middle of the string
Q66. What is process and its synchronisation
Process is a program in execution. Synchronization is the coordination of multiple processes or threads.
Process is a program in execution that has its own memory space and resources.
Synchronization is the coordination of multiple processes or threads to ensure they do not interfere with each other.
Synchronization can be achieved through various mechanisms such as locks, semaphores, and monitors.
Examples of synchronization include ensuring only one thread accesses a shared res...read more
Q67. Design class diagram for Flower shop
Design class diagram for Flower shop
Create a Flower class with attributes like name, color, price, etc.
Create a Bouquet class that has a list of Flower objects
Create a Customer class with attributes like name, address, phone number, etc.
Create an Order class that has a Customer object and a Bouquet object
Create a Payment class with attributes like payment method, amount, etc.
Create a Delivery class with attributes like delivery address, delivery date, etc.
Q68. What is the architecture of Spring MVC?
Spring MVC follows a Model-View-Controller architecture pattern for building web applications.
Spring MVC separates the application into three main components: Model, View, and Controller.
Model represents the data of the application and the business logic to manipulate the data.
View is responsible for rendering the data to the user interface.
Controller handles the user input, processes it, and interacts with the Model and View.
Spring MVC uses DispatcherServlet as the front con...read more
Q69. Write a program to reverse link list?
Program to reverse a linked list
Create a new empty linked list
Traverse the original linked list and insert each node at the beginning of the new list
Return the new reversed linked list
Q70. what are smart pointers
Smart pointers are objects that manage the lifetime of dynamically allocated memory in C++.
Smart pointers automatically deallocate memory when it is no longer needed.
They prevent memory leaks and dangling pointers.
Examples of smart pointers in C++ are unique_ptr, shared_ptr, and weak_ptr.
Q71. How redux work store, reducer and action
Redux is a state management library for JavaScript applications.
Redux uses a single source of truth called the store to manage the application state.
Reducers are pure functions that specify how the state should change based on the actions dispatched.
Actions are plain JavaScript objects that describe the type of change to be made to the state.
When an action is dispatched, the store passes the current state and the action to the reducer, which returns the new state.
Redux follow...read more
Q72. Name any 3 annotations and how they work
Annotations in Java are used to provide metadata about a program, which can be used by the compiler or at runtime.
1. @Override - Indicates that a method overrides a method in its superclass.
2. @Deprecated - Marks a method as deprecated, meaning it should no longer be used.
3. @SuppressWarnings - Suppresses compiler warnings for a given part of the code.
Q73. Write the code to find next smallest palindrome.
Code to find next smallest palindrome.
Iterate from middle to left and right, incrementing/decrementing digits to create palindrome
Handle edge cases like all 9s in number
Check if number is palindrome or not
Q74. Joins in detail with 100 line code for review
Explanation of joins in SQL with 100 line code example
Joins are used in SQL to combine rows from two or more tables based on a related column between them
Types of joins include INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN
Example: SELECT * FROM table1 INNER JOIN table2 ON table1.id = table2.id
Q75. write a code for binary search
Code for binary search algorithm
Binary search is a divide and conquer algorithm
It works by repeatedly dividing the search interval in half
If the value is found, return the index. Else, repeat on the appropriate half
The array must be sorted beforehand
Q76. Difference between stringbuffer and stringbuilder?
StringBuffer is synchronized and thread-safe, while StringBuilder is not synchronized.
StringBuffer is slower due to synchronization, while StringBuilder is faster.
StringBuffer is preferred in multithreaded environments, while StringBuilder is preferred in single-threaded environments.
Example: StringBuffer sb = new StringBuffer(); StringBuilder sb = new StringBuilder();
Q77. What is mutex and its systax
Mutex is a synchronization object used to prevent multiple threads from accessing shared resources simultaneously.
Mutex stands for mutual exclusion.
It is used to protect shared resources from race conditions.
Mutex provides exclusive access to a shared resource.
Syntax: pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
Example: pthread_mutex_lock(&mutex); // acquire lock
pthread_mutex_unlock(&mutex); // release lock
Q78. what is bug and unit testing?
A bug is an error, flaw, failure, or fault in a computer program or system. Unit testing is a software testing method where individual units or components of a software are tested in isolation.
Bug is an error, flaw, failure, or fault in a computer program or system.
Unit testing is a software testing method where individual units or components of a software are tested in isolation.
Bug testing helps identify and fix issues in the software.
Unit testing ensures that each unit of ...read more
Q79. Real time use of synchronisation
Synchronization is used to ensure consistency and avoid conflicts in real-time systems.
Real-time systems require synchronization to ensure that data is consistent and up-to-date across multiple devices or processes.
Synchronization can be achieved through various techniques such as locks, semaphores, and message passing.
Examples of real-time systems that use synchronization include stock trading platforms, online gaming, and traffic control systems.
Q80. what is SDLC AND TYPES?
SDLC stands for Software Development Life Cycle. It is a process used by software developers to design, develop, and test software.
SDLC is a systematic process for building software applications.
There are different types of SDLC models such as Waterfall, Agile, Iterative, Spiral, etc.
Each type of SDLC model has its own set of advantages and disadvantages.
SDLC involves phases like planning, analysis, design, implementation, testing, and maintenance.
Example: Waterfall model fol...read more
Q81. What is a dangling pointer
A dangling pointer is a pointer that points to a memory location that has been deallocated, leading to potential crashes or undefined behavior.
Dangling pointers can occur when memory is freed but the pointer is not set to NULL.
Accessing a dangling pointer can result in accessing invalid memory.
Example: int* ptr = new int; delete ptr; // ptr is now a dangling pointer
Q82. Design patterns examples
Design patterns are reusable solutions to common software problems.
Creational patterns: Singleton, Factory, Abstract Factory
Structural patterns: Adapter, Decorator, Facade
Behavioral patterns: Observer, Strategy, Command
Examples: MVC, Dependency Injection, Template Method
Q83. Multithreading in java, data structures
Multithreading and data structures are important concepts in Java programming.
Multithreading allows for concurrent execution of multiple threads within a single program.
Data structures are used to organize and manipulate data efficiently.
Examples of data structures include arrays, linked lists, stacks, and queues.
Java provides built-in support for multithreading through the Thread class and the Runnable interface.
Synchronization is important in multithreading to prevent race ...read more
Q84. reversal of nodes in linked list
Reversing the nodes in a linked list involves changing the direction of pointers to go from the end to the beginning.
Iterate through the linked list and reverse the pointers to point to the previous node instead of the next node.
Use three pointers - prev, current, and next - to keep track of the nodes while reversing the list.
Update the head of the linked list to point to the last node after reversing.
Q85. Explain the concepts of OOPs in a code
OOPs concepts include encapsulation, inheritance, polymorphism, and abstraction in code.
Encapsulation: Bundling data and methods that operate on the data into a single unit.
Inheritance: Allowing a new class to inherit properties and behavior from an existing class.
Polymorphism: Objects of different classes can be treated as objects of a common superclass.
Abstraction: Hiding the implementation details and showing only the necessary features of an object.
Q86. Design a singleton class
A singleton class is a class that can only be instantiated once.
Ensure the constructor is private
Provide a static method to access the instance
Lazy initialization can be used to defer object creation
Thread safety should be considered
Q87. Program to reverse a linked list
Program to reverse a linked list
Traverse the linked list and change the direction of pointers
Use three pointers to keep track of current, previous and next nodes
Handle edge cases like empty list or list with only one node
Q88. Take a json and perform CRUD operations
Perform CRUD operations on a JSON object
Use POST method to create new data
Use GET method to read data
Use PUT method to update data
Use DELETE method to delete data
Q89. reverse the string
Reverse a given string
Use a loop to iterate through the string and append each character to a new string in reverse order
Alternatively, use built-in string functions like reverse() or slice()
Remember to handle edge cases like empty strings or strings with only one character
Q90. What is springboot?
Spring Boot is a Java-based framework used for creating standalone, production-grade Spring-based Applications.
Spring Boot simplifies the process of creating Spring applications by providing a set of default configurations.
It allows developers to quickly set up and run standalone Spring applications with minimal configuration.
Spring Boot includes embedded servers like Tomcat, Jetty, or Undertow, making it easy to deploy applications.
It promotes convention over configuration, ...read more
Q91. console.log([] === []) ??
No, they are not equal because they are two separate instances of arrays.
Empty arrays are two separate instances, so they are not strictly equal.
Comparing two empty arrays with strict equality will return false.
Q92. Design linked list
Designing a linked list involves creating a data structure where each element points to the next one.
Define a Node class with a value and a next pointer
Create a LinkedList class with a head pointer
Implement methods to add, remove, and traverse nodes
Consider edge cases like adding to an empty list or removing the head node
Q93. What is inheritance
Inheritance is a concept in object-oriented programming where a class inherits properties and behaviors from another class.
Allows a class to inherit attributes and methods from another class
Promotes code reusability and reduces redundancy
Creates a parent-child relationship between classes
Derived class can override or extend the functionality of the base class
Example: Class 'Car' can inherit from class 'Vehicle' and inherit properties like 'speed' and methods like 'drive()'
Q94. Basics and features of Java 8
Java 8 introduced new features like lambda expressions, streams, and functional interfaces.
Lambda expressions allow for more concise code by enabling functional-style programming.
Streams provide a way to work with collections of objects in a functional way.
Functional interfaces are interfaces with a single abstract method, used for lambda expressions.
Default methods allow interfaces to have method implementations.
Method references provide a way to refer to methods without inv...read more
Q95. Unix commands and their use
Unix commands are used to interact with the Unix operating system through the command line interface.
ls - list directory contents
cd - change directory
pwd - print working directory
cp - copy files or directories
mv - move files or directories
rm - remove files or directories
grep - search for specific text in files
chmod - change file permissions
ps - display information about running processes
top - display system resource usage
Q96. String reverse program
A program that reverses a string input
Create a function that takes a string as input
Use a loop to iterate through the characters of the string in reverse order
Append each character to a new string to build the reversed string
Return the reversed string as output
Q97. Strings manipulations' in C
String manipulation in C involves various functions to perform operations on strings like concatenation, comparison, and copying.
Use functions like strcpy() for copying strings
Use functions like strcat() for concatenating strings
Use functions like strcmp() for comparing strings
Q98. event loop in javascript
The event loop is a mechanism in JavaScript that allows for asynchronous execution of code.
The event loop is responsible for handling and executing tasks in JavaScript.
It ensures that tasks are executed in a non-blocking manner.
Tasks are added to different queues based on their type and priority.
The event loop continuously checks the queues and executes tasks in a specific order.
Examples of tasks include setTimeout callbacks, DOM events, and AJAX requests.
Q99. mid element of linkedlist
To find the middle element of a linked list, use the slow and fast pointer technique.
Initialize two pointers, slow and fast, both pointing to the head of the linked list.
Move the slow pointer by one step and the fast pointer by two steps until the fast pointer reaches the end of the list.
The element pointed to by the slow pointer at this point will be the middle element of the linked list.
Q100. Linked List Implementation
A linked list is a data structure where each element points to the next element in the sequence.
Nodes in a linked list contain data and a reference to the next node
Linked lists can be singly linked (each node points to the next) or doubly linked (each node points to the next and previous)
Inserting and deleting elements in a linked list is efficient compared to arrays
Top HR Questions asked in Muthoot Finance
Interview Process at Muthoot Finance
Top Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month