JPMorgan Chase & Co.
400+ Interview Questions and Answers
Chintu has a long binary string ‘str’. A binary string is a string that contains only 0 and 1. He considers a string ‘beautiful’ if and only if the number of 0's and 1's in the string are equ...read more
Q2. A rat has 3000 gm of rice, he has to travel a distance of 3000m, he eats 1gm rice/m, his maximum carrying capcity is 1000 gm,how should he travel the distance to reach with maximum rice left
A rat with 3000gm rice, 3000m distance, 1gm rice/m, 1000gm capacity. How to reach with max rice left?
The rat should carry maximum rice possible in the beginning
The rat should eat rice only when necessary
The rat should carry rice in intervals to avoid exhaustion
The rat should calculate the amount of rice needed for the journey
The rat should prioritize reaching the destination over carrying excess rice
Rahul is a programming enthusiast. He is currently learning about arrays/lists. One day his teacher asked him to solve a very difficult problem. The problem was to find the length of ...read more
Q4. There are 8 bottles of milk out of which one bottle is poisoned. What will be the minimum number of persons required to find the poisoned bottle if the person dies within 24 hours of drinking the poison. You ha...
read moreMinimum number of persons required to find the poisoned milk bottle out of 8 bottles within 24 hours.
Divide the bottles into groups of 3 and label them A, B, C.
Give each person a different combination of groups to taste.
If someone dies, the poisoned bottle is in that group.
If no one dies, the poisoned bottle is in group D.
Repeat the process with the bottles in the identified group.
You are given a string of length N. You need to reverse the string word by word. There can be multiple spaces between two words and there can be leading or trailing spaces but in the ou...read more
Given 'N' number of intervals, where each interval contains two integers denoting the boundaries of the interval. The task is to merge all the overlapping intervals and return the lis...read more
Ninjaland is a country having 'N' states numbered from 1 to 'N'. These 'N' states are connected by 'M' bidirectional roads. Each road connects to different states and has some cost to travel ...read more
Given a binary tree. Print the Left View of the Tree.
Example :
If the input tree is as depicted in the picture:
The Left View of the tree will be: 2 35 2
Input format :
Elements in t...read more
You have been given a column title as appears in an Excel sheet, return its corresponding column number.
For example:
A -> 1 B -> 2 C -> 3 ... Z -> 26 AA -> 27 AB -> 28 ...
Input Format
The ...read more
Design and implement a data structure for Least Recently Used (LRU) cache to support the following operations:
1. get(key) - Return the value of the key if the key exists in the cache, o...read more
You are given an array arr of length N. You have to return a list of integers containing the NGE(next greater element) of each element of the given array. The NGE for an element X is the fir...read more
Given an array ‘ARR’ and an integer ‘K’, your task is to find all the count of all sub-arrays whose sum is divisible by the given integer ‘K’.
Note:
If there exists...read more
You are given a 2-D matrix ‘mat’, consisting of ’N’ rows and ‘M’ columns. The element at the i-th row and j-th column is ‘mat[i][j]’.
From mat[i][j], you can move to mat[i+1][j] if mat[...read more
Q14. How will you perform pre-fix and post-fix operation for the given string expression?
Pre-fix and post-fix operations can be performed on a string expression using appropriate operators.
Pre-fix operation involves placing the operator before the operand in the expression.
Post-fix operation involves placing the operator after the operand in the expression.
Examples of pre-fix operators include ++, --, !, and ~.
Examples of post-fix operators include ++ and --.
You are given an array/list ‘ARR’ of ‘N’ positive integers and an integer ‘K’. Your task is to check if there exists a subset in ‘ARR’ with a sum equal to ‘K’.
Note: Return true if there ex...read more
You are given an array of integers of size ‘N’. You have to make the elements of the array equal, and the cost of changing the element ‘x’ to ‘y’ is abs(x -y). Your task is to find the ...read more
You are given a Binary Tree of integers. You are supposed to return the top view of the given binary tree. The Top view of the binary tree is the set of nodes that are visible when we see th...read more
You are given an array of N elements. This array represents the digits of a number. In an operation, you can swap the value at any two indices. Your task is to f...read more
Q19. A new software has 3 functions SelectSum(), log() and exp(). You have a table of 1000 data points, how will you find product of all points using only the above mentioned functions
To find the product of all data points using SelectSum(), log(), and exp() functions.
Use the log() function to convert the product into a sum of logarithms
Apply the SelectSum() function to calculate the sum of logarithms
Finally, use the exp() function to convert the sum back into the product
You are given two Singly Linked List of integers, which are merging at some node of a third linked list.
Your task is to find the data of the node at which merging starts. If there is...read more
You have been given a binary matrix of size 'N' * 'M' where each element is either 0 or 1. You are also given a source and a destination cell, both of them lie within the matrix....read more
You are given an integer ‘N’. You need to find an array of size 2*N that satisfies the following two conditions.
1. All numbers from 1 to N should appear exactly twice in the array.
2. The dista...read more
You are given a N x M matrix of integers, return the spiral path of the matrix
Example Of Spiral Path
Input Format:
The first line contains an integer 'T' which denotes the number of test cases or...read more
Q24. How will you find loop in the circular linked list?
Loop in a circular linked list can be found using Floyd's cycle-finding algorithm.
Initialize two pointers, slow and fast, both pointing to the head of the linked list.
Move slow pointer by one node and fast pointer by two nodes in each iteration.
If there is a loop, both pointers will eventually meet at some point.
If there is no loop, fast pointer will reach the end of the linked list.
Time complexity of this algorithm is O(n) and space complexity is O(1).
You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to return the list of all pairs of elements such that each sum of elements of each pair equals 'S'.
Note:
Each pair shou...read more
You are given a pattern in the form of a string and a collection of words. Your task is to determine if the pattern string and the collection of words have the same order.
Note :
The strings are...read more
You have been given a singly Linked List of integers. Your task is to divide this list into two smaller singly-linked lists in which the nodes appear in alternating fashion from the ori...read more
Q28. Write an algorithm to select the number between min and maximum from a number series and that number shouldn't be a multiple of 10
Algorithm to select a non-multiple of 10 from a number series between min and max
Loop through the number series from min to max
Check if the current number is a multiple of 10
If not, select the number and exit the loop
If all numbers are multiples of 10, return an error message
You are given a positive integer N. Your task is to find the number of possible rectangles, excluding squares, in a N x N chessboard.
Example:
Let’s assume that we have a chessboard of di...read more
You are given a sentence 'TEXT'. Each word of 'TEXT' is separated by a single space and the first letter of 'TEXT' is capital. You need to rearrange the words of Text in increasing ...read more
You and your friend Ninjax are playing a game of coins. Ninjax place the 'N' number of coins in a straight line.
The rule of the game is as follows:
1. Each coin has a value associate...read more
You have been given a 9x9 2d integer matrix 'MAT' representing a Sudoku puzzle. The empty cells of the Sudoku are filled with zeros, and the rest of the cells are filled with integers from 1 to 9. ...read more
You have been given a 9 X 9 2D matrix 'MATRIX' with some cells filled with digits(1 - 9), and some empty cells (denoted by 0).
You need to find whether there exists a way to fill all the empty cells wit...read more
You are given a chocolate bar in the form of a grid consisting of N x M pieces of chocolate. Your task is to take out exactly ‘K’ pieces of chocolate by cutting the chocolate bar either horizontall...read more
You are given an ‘M*N’ Matrix, You need to print all possible paths from its top left corner to the bottom right corner if giv...read more
Q36. What are the different types of risks associated with a bond?
Different types of risks associated with a bond
Interest rate risk - changes in interest rates affect bond prices
Credit risk - risk of default by the issuer
Inflation risk - risk of loss of purchasing power due to inflation
Liquidity risk - risk of not being able to sell the bond when needed
Call risk - risk of the issuer calling back the bond before maturity
Reinvestment risk - risk of not being able to reinvest the coupon payments at the same rate
Currency risk - risk of changes ...read more
What is the lambda expression in Java and How does a lambda expression relate to a functional interface?
You are given an integer N. Your task is to return a 2-D ArrayList containing the pascal’s triangle till the row N.
A Pascal's triangle is a triangular array constructed by summing adjacent ele...read more
You have been given an array/list ARR consisting of ‘N’ elements. Each element in the array is either 0, 1 or 2.
Now, your task is to sort this array/list in increasing order. For ...read more
You will be given a stream of numbers, and you need to find the kth largest number in the stream at any given time.
As the stream of numbers can not be given during compile time, so you need t...read more
Implement a Stack Data Structure specifically to store integer data using two Queues.
There should be two data members, both being Queues to store the data internally. You may use the inbuilt Q...read more
probability of car accident in one hour is 1/4. What is the probability of accident in half hour?
There is 10 Black socks in drawer, 10 white socks. What is the minimum number of socks we need to pick out such that we get a pair?
A 5 digit number is formed by using digits 1, 2, 3, 4 and 5 with no two digits same. What is the probability that the formed number is divisible by 4?
There are ‘N’ horses running in ‘N’ different lanes numbered from 1 to ‘N’. You are given an array “FINISHTIME” containing ‘N’ integers where “FINISHTIME[i]” represents the time taken by the ith ho...read more
Given an integer array(ARR) of size N, the following operations need to be performed:
update(l, r, val) : Add (val + i) to arr[l + i] where, 0 <= i <= r - l. rangeSum(l, r): return...read more
What is the probability of getting a sum of 22 or more when four dice are thrown?
You are given a string S which represents a number. You have to find the smallest number strictly greater than the given number which contains the same set of digits as of the original number...read more
You are given two sorted linked lists. You have to merge them to produce a combined sorted linked list. You need to return the head of the final linked list.
Note:
The given linked ...read more
In how many ways can we position an HTML element? Or what are the permissible values of the position attribute?
There are 5 permissible values for the position attribute in HTML.
The permissible values for the position attribute are static, relative, fixed, absolute, and sticky.
The default value is static, which means the element is positioned according to the normal flow of the document.
Relative positioning allows an element to be positioned relative to its normal position.
Fixed positioning positions the element relative to the browser window, so it stays in the same place even if the ...read more
Given a binary tree and the value of two nodes, find the distance between the given two nodes of the Binary Tree.
Distance between two nodes is defined as the minimum number ...read more
You have been given a Binary Tree of integers, find the minimum depth of this Binary Tree. The minimum depth of a Binary Tree is the number of nodes along the shortest path from the ...read more
The city of Ninjaland is analogous to the unweighted graph. The city has ‘N’ houses numbered from 1 to ‘N’ respectively and are connected by M bidirectional roads. If a road ...read more
You are given a string (STR) of length N.
Your task is to find the longest palindromic substring. If there is more than one palindromic substring with the maximum length, return the...read more
Given a string 'S', you are supposed to return the number of distinct substrings(including empty substring) of the given string. You should implement the program using a trie.
Note :
A ...read more
You are given a positive integer N and an equation 1/X + 1/Y = 1/N
You need to determine the count of all possible positive integral solutions (X, Y) for the above equation.
Note:
1. X and Y shoul...read more
Given an array of integers ‘ARR’ and an integer ‘X’, you are supposed to find the number of subarrays of 'ARR' which have bitwise XOR of the elements equal to 'X'.
Note:
An array ‘...read more
You are given a paragraph that may have letters both in lowercase and uppercase, spaces, and punctuation. You have also given a list of banned words. Now your task is to find the most frequent...read more
Q59. Write the algorithm for reversing the string
The algorithm reverses a given string.
Iterate through the string from the last character to the first character.
Append each character to a new string or an array in reverse order.
Return the reversed string or array.
You have been given a complete binary tree of ‘N’ nodes. The nodes are numbered 1 to ‘N’.
You need to find the ‘next’ node that is immediately right in the level order...read more
You have been given a singly Linked List of 'N' nodes with integer data and an integer 'K'. Your task is to remove the Kth node from the end of the given Linked List.
For example:
The gi...read more
You are given N number of intervals, where each interval contains two integers denoting the start time and the end time for the interval.
The task is to merge all the overlapping intervals and re...read more
Q63. How do you handle custom exceptions in your current project ?
I handle custom exceptions by creating my own exception classes and throwing them when necessary.
I create custom exception classes that extend the built-in Exception class
I throw these exceptions when specific errors occur in my code
I catch these exceptions in a try-catch block and handle them appropriately
I include helpful error messages in my custom exceptions to aid in debugging
Q64. If I buy a piece of equipment, walk me through the impact on the 3 financial statements
Buying equipment affects all 3 financial statements
On the income statement, the purchase will be recorded as an expense, reducing net income
On the balance sheet, the equipment will be recorded as an asset, increasing total assets
On the cash flow statement, the purchase will be recorded as a cash outflow from investing activities
You are given a list of a repeated set of integers. Your task for the problem is to return a list of the given elements in decreasing sorted order of their frequency of repetition in t...read more
What do you understand by auto wiring and name the different modes of it?
What is the start() and run() method of Thread class?
Q68. Explain endpoints in your microservice. What request they send and why?
Endpoints in microservices are responsible for handling incoming requests and sending responses.
Endpoints are the entry points for a microservice
They handle incoming requests and send responses
Endpoints can be HTTP endpoints, message queue endpoints, or event-driven endpoints
Examples of endpoints include RESTful APIs, SOAP APIs, and GraphQL APIs
Q69. what is 'Big data'? Why is it called 'Big'
Big data refers to large and complex data sets that cannot be processed using traditional data processing methods.
Big data is characterized by its volume, velocity, and variety
It is used in various industries such as healthcare, finance, and retail
Examples of big data include social media data, sensor data, and transactional data
It is called 'big' because it involves processing massive amounts of data
Big data requires specialized tools and technologies for processing and anal...read more
15 people sit around a circular table. What are odds against two particular people sitting together?
What is the main difference between UNION and UNION ALL?
There are 25 horses among which you need to find out the fastest 3 horses. You can conduct race among at most 5 to find out their relative speed. At no point you can find out the actual speed of the horse...read more
What is a package in Java? List down various advantages of packages.
A package in Java is a way to organize related classes and interfaces. It helps in modularizing code and provides access control.
Packages help in avoiding naming conflicts by providing a unique namespace.
They provide access control by using access modifiers like public, private, and protected.
Packages allow for better code organization and maintainability.
They enable code reusability by allowing classes to be easily imported and used in other projects.
Packages facilitate the ...read more
Q74. With O(1) time complexity, find out if the given number is missing, from the given numbers between 1 to 100 where more than 2 numbers are missing.
To find a missing number from 1 to 100 with O(1) time complexity.
Use the formula n(n+1)/2 to find the sum of numbers from 1 to 100.
Subtract the sum of given numbers from the sum of all numbers to find the missing number.
Use a hash table to keep track of the given numbers and check for missing numbers in O(1) time.
Q75. What is compliance and different compliance measures maintained
Compliance refers to adhering to laws, regulations, and standards set by governing bodies.
Compliance measures ensure that organizations operate within legal and ethical boundaries
Examples of compliance measures include HIPAA, GDPR, PCI DSS, and SOX
Compliance can be achieved through policies, procedures, training, audits, and assessments
Non-compliance can result in legal and financial penalties, damage to reputation, and loss of business
What does the @SpringBootApplication annotation do internally?
What Are the Basic Annotations that Spring Boot Offers?
Differentiate between the Thread class and Runnable interface for creating a Thread?
Q79. What is the most complex algorithm you've ever written?
I am an AI language model and do not have the ability to write algorithms.
As an AI language model, I am not capable of writing algorithms.
However, I can assist in generating code snippets or providing guidance on algorithmic concepts.
Feel free to ask me any questions related to algorithms or programming in general.
What do you mean by virtual functions in C++?
Q81. What is the difference between multi tasking, multi processing and multi programming operating systems with examples ?
Multi tasking, multi processing, and multi programming are different approaches to managing tasks in an operating system.
Multi tasking allows multiple tasks to run concurrently on a single processor.
Multi processing involves multiple processors running tasks simultaneously.
Multi programming allows multiple programs to be loaded into memory and executed concurrently.
Examples of multi tasking operating systems include Windows, macOS, and Linux.
Examples of multi processing opera...read more
What are the difference between Clustered and a Non-clustered index?
Clustered index determines the physical order of data in a table, while non-clustered index has a separate structure.
Clustered index determines the physical order of data in a table
Non-clustered index has a separate structure that includes a copy of the indexed columns and a pointer to the actual data
A table can have only one clustered index, but multiple non-clustered indexes
Clustered index is faster for retrieving large ranges of data, while non-clustered index is faster fo...read more
What is the Difference Between “Git Pull” and “Git Fetch”?
Git pull combines git fetch and git merge, while git fetch only downloads new data from a remote repository.
Git pull is used to update the local branch with the latest changes from the remote repository.
Git fetch only downloads new data from the remote repository, but does not integrate it into the local branch.
Git pull is a combination of git fetch and git merge commands.
Git fetch is useful to see what changes have been made in the remote repository before merging them into ...read more
Five questions on OOPS were asked :-
1. What is Smart Pointer?
2. Some basic questions involving bit manipulation.
3. What is Virtual function?
4. What is Abstract Class?
5. Other standard simple questions of OO...read more
There are 2 ants sitting on diagonally opposite vertices of the same face of a cube. They can move in any direction and reach another vertex in one unit of time. They'll move indefinitely until they ...read more
Design Data structure like Queue in which you have to get the middle element in O(1), then update that value and do some modification and add back to the Queue in O(1) and the rearrangement...read more
What is the probability of getting a sum of 22 or more when four dice are thrown?
Fifteen people sit around a circular table. What are odds against two particular people sitting together?
What is Garbage collector in JAVA?
What is meant by Inheritance?
If there is a frog which can go one step forward with probability 3/4. and one step backward with 1/4. What is expectancy to reach 7 steps forward.
What are the different methods of session management in Servlet?
Different methods of session management in Servlet
Cookies
URL Rewriting
Hidden Form Fields
Session Tracking API
HTTP Session
Throw a dice, your score will the number that appears on the topmost face of the dice. Find the expected score. Then the question was extended to two throws, either you can keep the numbe...read more
How to optimize website assets loading?
Optimize website assets loading by minimizing file sizes, leveraging caching, and using asynchronous loading.
Minimize file sizes by compressing images, minifying CSS and JavaScript files
Leverage caching by setting appropriate cache headers and using a content delivery network (CDN)
Use asynchronous loading techniques such as lazy loading, deferred loading, and async/defer attributes
Combine and bundle multiple files to reduce the number of requests
Optimize the order of loading ...read more
Q94. Any coding done in curriculum, explain the most complex one
Yes, I have coded in curriculum. The most complex one was a project on building a web application using React and Node.js.
Built a full-stack web application using React and Node.js
Implemented user authentication and authorization using JSON Web Tokens (JWT)
Used MongoDB as the database and Mongoose as the ODM
Implemented real-time updates using Socket.IO
Deployed the application on Heroku
Handled errors and implemented logging using Winston
Difference between reset vs normalize CSS?. How do they differ?
Reset CSS removes all default styles from elements, while Normalize CSS makes styles consistent across different browsers.
Reset CSS sets all CSS properties to their default values, ensuring a clean slate for styling.
Normalize CSS aims to make styles consistent across different browsers by applying a set of default styles.
Reset CSS is more aggressive in removing default styles, while Normalize CSS is more subtle and preserves useful defaults.
Reset CSS is often used when starti...read more
What are the New tags in Media Elements in HTML5?
The new tags in Media Elements in HTML5 are
The
The
Both tags support various attributes and can be styled using CSS.
Example:
Example:
Q97. Will duration be greater for a fixed rate bond or a floating rate bond?
Duration will be greater for a fixed rate bond.
Fixed rate bonds have a longer duration than floating rate bonds.
Duration is the measure of a bond's sensitivity to interest rate changes.
Fixed rate bonds have a fixed interest rate, so their duration is longer as they are more sensitive to interest rate changes.
Q98. Explain how the balance sheet works for banking sector
The balance sheet for banking sector shows the assets, liabilities and equity of the bank at a specific point in time.
Assets include cash, loans, investments, and property
Liabilities include deposits, loans from other banks, and bonds
Equity includes the bank's capital and reserves
The balance sheet must balance, with assets equaling liabilities plus equity
The balance sheet is used to analyze the financial health of the bank
How does Spring Boot works?
Spring Boot is a framework that simplifies the development of Java applications by providing default configurations and dependencies.
Spring Boot eliminates the need for manual configuration by providing sensible defaults.
It uses an embedded server, such as Tomcat or Jetty, to run the application.
Spring Boot automatically configures the application based on the dependencies added to the project.
It promotes convention over configuration, reducing boilerplate code.
Spring Boot su...read more
What is CORS in MVC and how it works?
CORS in MVC is Cross-Origin Resource Sharing, a mechanism that allows restricted resources on a web page to be requested from another domain.
CORS is a security feature implemented in web browsers to prevent cross-origin requests by default.
It works by adding specific HTTP headers to the server's response, indicating which origins are allowed to access the resources.
In MVC, CORS can be configured using the 'EnableCors' attribute on controllers or by configuring it in the 'Web....read more
More about working at JPMorgan Chase & Co.
Top HR Questions asked in null
Interview Process at null
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month