JP Morgan计算机科学面试真题

职位分类
全部
数据相关
计算机科学
人工智能
产品经理
BQ
面试题
全部(59)
OOD(10)
Algorithm(35)
System Design(10)
高频题(0)
Math(0)
全部(59)
OOD(10)
Algorithm(35)
System Design(10)
高频题(0)
Math(0)
1.Cardinality Sorting
2.Longest Even Length Word
3.Subarray Sum
4.Rearranging a Word
5.Break a Palindrome
6.Object-Oriented Programming (OOP) Concepts
7.Arithmetic Progression Validation
8.How many flips?
9.Ascending Binary Sorting
10.System Design Analysis and Improvement
11.Code Review Improvement
12.Find the Minimum Absolute Difference in an Array
13.Discuss Java Memory Management
14.Explain OOP Concepts
15.Set Conversion Cost
16.Python For Loop Performance
17.Dictionary Key-Value Relationship
18.Algorithm Problem Solving
19.Understanding of Third-Party Library APIs
20.Differences in Coding Approaches
21.Explain the projects listed on your resume
22.Python Data Structures
23.Algorithm Complexity
24.Coordinate Transformation
25.Sum of All Subarrays
26.Fun with Anagrams
27.LeetCode Algorithm Problem
28.Python OOP Concepts
29.Monolithic to Microservices Architecture
30.Find the Pair with the Smallest Difference
31.Design a Flash Sale System
32.Print Fibonacci
33.Understanding React's useEffect Hook
34.Displaying Data with React
35.Minimum Total Cost to Reduce Array by Pair Removals
36.Unique Digits Count
37.Factors of 3 and 5
38.Longest Even Length Word
39.Design an Instagram-like Photo Sharing Service
40.Rearranging a Word to the Next Alphabetically Greater String
41.Is It Possible to Convert a Pair of Integers
42.Longest Even Length Word
43.Minimum Number of Flips to Achieve Target Binary String
44.Is Possible
45.Minimum Number of Flips to Convert Binary String to Target
46.Experience with Generics in Java
47.Experience with Threads in Java
48.Sorting a List of Users by Default
49.LLM Chatbot System Design
50.Balanced Or Not?
51.Is Possible
52.Maximum Sum with Fixed Jump Interval
53.Largest Number by Swapping Digits
54.Array Reduction Algorithm
55.Maximum Number of Pairs Selection
56.Handling Distributed System Issues
57.Distributed Lock Implementation
58.Discuss the complexity of operations in a linked list, including variants like cycles and arbitrary loops, and methods to detect them.
59.Identify three major differences between C++ and Python.
1. Cardinality Sorting
The binary cardinality of a number is the total number of 1's it contains in its binary representation. For example, the decimal integer 20 corresponds to the binary number 10100, and there are 2 1's in the binary representation so its binary cardinality is 2. Given an array of decimal integers, sort it in ascending order first by binary cardinality, then by decimal value if there is a tie in cardinality. Return the resulting array. For instance, given the array [1, 2, 3, 4], the sorted array by binary cardinality would be [2, 4, 1, 3]. Write a function to implement this sorting method.
2. Longest Even Length Word
Consider a string, sentence, of words separated by spaces where each word is a substring consisting of English alphabetic letters only. Find the first word in the sentence that has a length which is both an even number and greater than or equal to the length of any other word of even length in the sentence. If there are multiple words meeting the criteria, return the one which occurs first in the sentence. For example, for the sentence 'Time to write great code', the longest even length words are 'Time' and 'code'. The one that occurs first is 'Time', which is the answer to return. Write a function to implement this logic and return the first longest even length word or the string '00' if there are no even length words.
3. Subarray Sum
Given an array of integers, find the sum of all elements of all subarrays of that array. For example, a three-element array [4, 5, 6] can be made into the following subarrays: [4], [5], [6], [4, 5], [5, 6], and [4, 5, 6]. The sum of all elements of these subarrays is 4+5+6+(4+5)+(5+6)+(4+5+6).
4. Rearranging a Word
Given a word, return the next alphabetically greater permutation of that word. If there is no greater permutation available, return the string 'no answer'. The word contains characters in the set ascii[a-z], and its length is between 2 and 10^4 characters.
5. Break a Palindrome
Given a palindrome, you are required to change exactly one character of the string to another character in the range ascii[a-z] so that the resulting string is lower alphabetically than the initial string, is the lowest value string alphabetically that can be created from the original palindrome after making only one change, and is not a palindrome itself. If it's not possible to meet the criteria, return the string 'IMPOSSIBLE'.