JP Morgan Interview Questions
- 0of 0 votes
AnswersWe need to declare variable types in C++.
- parni November 01, 2018 in United States
How does this type declaration change the structure of the code comparing to other languages without type declaration like Python?| Report Duplicate | Flag | PURGE
JP Morgan - 8of 8 votes
AnswersFind the missing letters from a string if it doesn't create a pangram.
- lord.claxton March 08, 2018 in United States| Report Duplicate | Flag | PURGE
JP Morgan Associate Java - 0of 0 votes
Answershttps://leetcode.com/problems/word-search/description/
- lord.claxton March 08, 2018 in United States
Given a 2D board and a word, find if the word exists in the grid.
The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may not be used more than once.
For example,
Given board =
[
['A','B','C','E'],
['S','F','C','S'],
['A','D','E','E']
]
word = "ABCCED", -> returns true,
word = "SEE", -> returns true,
word = "ABCB", -> returns false.| Report Duplicate | Flag | PURGE
JP Morgan Associate Java - 0of 0 votes
AnswersCheck if the string is a panagram & print all the missing characters if the string is not a panagram in sorted order.
- whimsical1987 January 03, 2018 in United States| Report Duplicate | Flag | PURGE
JP Morgan - 0of 0 votes
AnswersFind the winning hand in Poker. I was given input for 2 hands(eg 6D 7D 8H 9H JS 5S 6C JH QD KC), of which I need to determine who won based on the cards & if there is a tie it should print none.
- whimsical1987 January 03, 2018 in United States| Report Duplicate | Flag | PURGE
JP Morgan - 0of 0 votes
AnswersInserting dashes between two odd numbers and star between two even numbers
- praveenz.poola September 15, 2017 in India| Report Duplicate | Flag | PURGE
JP Morgan Software Engineer - 0of 0 votes
AnswersWrite a custom implementation of BlockingQueue using only intrinsic locking constructs in Java
- Flash May 14, 2017 in India| Report Duplicate | Flag | PURGE
JP Morgan Java Developer Java - 0of 0 votes
AnswersWrite a program to generate the anagrams of a word
- Flash May 14, 2017 in India| Report Duplicate | Flag | PURGE
JP Morgan Java Developer Java - 0of 0 votes
AnswersWrite a program to reverse a string
- Flash May 14, 2017 in India| Report Duplicate | Flag | PURGE
JP Morgan Java Developer Java - 0of 0 votes
AnswersWhat is the output of following code snippet?
- Flash May 14, 2017 in Indiapublic static void main(String[] args){ int[][] data = {{123},{4,5,6}}; int[][] copy = data.clone(); copy[0][0] = 100; System.out.println(data[0][0]); System.out.println(copy[0][0]); copy[1] = new int[]{300,400,500}; System.out.println(data[1][1]); System.out.println(copy[1][1]); }
| Report Duplicate | Flag | PURGE
JP Morgan Java Developer Java - 0of 0 votes
AnswersWhat would be the output of below code snippet?
- Flash May 14, 2017 in Indiaclass Super { int index = 5; public void printVal(){System.out.println("Super");} } class Sub extends Super { int index = 2; public void printVal(){System.out.println("Sub");} } public class OopTest { public static void main(String[] args){ Super sup = new Sub(); System.out.println(sup.index + " "); sup.printVal(); } }
| Report Duplicate | Flag | PURGE
JP Morgan Java Developer Java - 0of 0 votes
AnswersWhat would be the result of executing the below code snippet?
- Flash May 13, 2017 in Indiapublic class CountDownLatchDemo { public static void main(String[] args)throws InterruptedException { final CountDownLatch latch = new CountDownLatch(3); latch.countDown(); latch.countDown(); new Thread(){ public void run(){ try{ Thread.sleep(3000); }catch(InterruptedException ex){ ex.printStackTrace(); } latch.countDown(); }; }.start(); System.out.println("Before"); latch.await(); System.out.println("After"); } }
| Report Duplicate | Flag | PURGE
JP Morgan Java Developer Java - 0of 0 votes
AnswersHow many elements will the set object in the below snippet will contain after the program executes to last print statement?
- Flash May 13, 2017 in Indiapublic class ShortSetTest { public static void main(String[] args){ Set shortSet = new HashSet(); for(short i = 0; i < 100; i++){ shortSet.add(i); shortSet.remove(i-1); } System.out.println(shortSet); } }
| Report Duplicate | Flag | PURGE
JP Morgan Java Developer Java - 0of 0 votes
AnswerWhat would the output of the following snippet?
- Flash May 13, 2017 in Indiapublic class TrickyNum<X extends Number> { private X x; public TrickyNum(X x){ this.x = x; } private double getDouble(){ return x.doubleValue(); } public static void main(String[] args) { TrickyNum<Integer> a = new TrickyNum<Integer>(new Integer(1)); System.out.println(a.getDouble()); } }
| Report Duplicate | Flag | PURGE
JP Morgan Java Developer Java - 0of 0 votes
AnswersWhat happens when you try to compile below class?
- Flash May 13, 2017 in Indiapublic class EnumTest { public EnumTest(){ System.out.println("Inside Constructor"); } public void printType(){ enum PrinterType {DOT,INK,LASER} } }
| Report Duplicate | Flag | PURGE
JP Morgan Java Developer Java - 0of 0 votes
AnswersGiven below code snippet, what would be the output?
- Flash May 13, 2017 in Indiapublic class DemoThread extends Thread { private int x = 2; public static void main(String[] args) throws Exception { new DemoThread().method(); } public DemoThread(){ System.out.println("test"); x = 5; start(); } public void method() throws Exception { join(); x = x - 1; System.out.println(x); } public void run(){ System.out.println("run"); x *= 2; } }
| Report Duplicate | Flag | PURGE
JP Morgan Java Developer Java - 0of 0 votes
AnswersFor code snippet given below, what would be the output?
- Flash May 13, 2017 in IndiaString s8 = "AB"; String s9 = s8.intern(); if(s9.equals(s8) && s9 == s8) System.out.println("All Equal"); if(s9.equals(s8) && s9!=s8) System.out.println("equals Equal"); if(!s9.equals(s8) && s9==s8) System.out.println("== Equal"); if(!s9.equals(s8) && s9!=s8) System.out.println("Nothing Equal");
| Report Duplicate | Flag | PURGE
JP Morgan Java Developer Java - 0of 0 votes
AnswersWrite a Java Program in which a class takes four integer arguments as input(a, b, c and d). Do addition of (a+b) on one thread, addition of (c+d) on another thread and multiplication of(a+b) * (c+d)) on main thread.
- Utsav February 06, 2017 in United States
Like: Thread1 = (a+b)
Thread2 = (c+d)
Main Thread = (Thread1 * Thread2)| Report Duplicate | Flag | PURGE
JP Morgan Senior Software Development Engineer Java - 0of 0 votes
AnswersDesign a rules engine. It should run in at least linear time and should efficiently handle repetitive attributes in different rules. E.g.,
- angshu1986 September 18, 2016 in India
Attributes:
1. Digit check
2. Character check
Rule:
1. Rule 1 - input should be digit
2. Rule 2 - input should be digit and = 3
3. Rule 3 - input should be digit and between 2 and 5
4. Rule 4 - input should be character and value should be 'A'
5. Rule 5 - input should be character and value should be 'B'
Design rule matrix and process a stream of inputs. More than one rule may be applicable for a given input.| Report Duplicate | Flag | PURGE
JP Morgan Java Developer Algorithm Object Oriented Design - 0of 0 votes
AnswersWhen do you receive error 404 on JSP?
- basav.d May 19, 2016 in India for Release Mgmt| Report Duplicate | Flag | PURGE
JP Morgan SDE-3 Debugging - 0of 0 votes
AnswersWrite algorithm to find mid element in the linked list
- basav.d May 19, 2016 in India for Release Mgmt| Report Duplicate | Flag | PURGE
JP Morgan SDE-3 Algorithm - 0of 0 votes
AnswersImplement a solution nth_largest( array, n ) that takes in an array of arbitrary size and returns the nth largest element.
- NS March 03, 2016 in United StatesEg. array = [1, 8, 4, 5, 9, 7, 2, 10, 44, 55, 67] nth_largest( array, 2) = 55 nth_largest( array, 5) = 9
| Report Duplicate | Flag | PURGE
JP Morgan Software Engineer / Developer Problem Solving - 0of 0 votes
AnswersWrite a program to identify if a given binary tree is balanced or not.
- NS March 03, 2016 in United States| Report Duplicate | Flag | PURGE
JP Morgan Software Engineer / Developer Trees and Graphs - 0of 0 votes
AnswersWrite a program to print all permutations of a given string.
- NS March 03, 2016 in United States| Report Duplicate | Flag | PURGE
JP Morgan Software Engineer / Developer Problem Solving - 0of 0 votes
AnswersIf you have the chapter of a book and you're supposed to build an index such that given a word, you can tell which pages the word occurs on, what data structure can you use? Optimize for space utilization.
- NS March 03, 2016 in United States| Report Duplicate | Flag | PURGE
JP Morgan Software Engineer / Developer Data Structures - 0of 0 votes
AnswersWrite a Python program to print numbers from 1 to 100 except for multiples of 3 for which you should print "fuzz" instead, for multiples of 5 you should print 'buzz' instead and for multiples of both 3 and 5, you should print 'fuzzbuzz' instead.
- NS March 03, 2016 in United States| Report Duplicate | Flag | PURGE
JP Morgan Software Engineer / Developer Python - 0of 0 votes
AnswersImplement a function DoIt( o,a ) such that the following code:
Object o = SomeClass() O.first = 'fizz' O.second = 'buzz' print DoIt( o, 'first) print DoIt(o, 'second')
prints
- NS March 03, 2016 in United States
fizz
buzz| Report Duplicate | Flag | PURGE
JP Morgan Software Engineer / Developer Python - 0of 0 votes
AnswersWrite a iterative Python function to print the factorial of a number n (ie, returns n!).
- NS March 03, 2016 in United States| Report Duplicate | Flag | PURGE
JP Morgan Software Engineer / Developer Python - 0of 0 votes
AnswersWrite a recursive Python function to print the factorial of a number n (ie, returns n!).
- NS March 03, 2016 in United States| Report Duplicate | Flag | PURGE
JP Morgan Software Engineer / Developer Python