Apple Machine Learning Engineer Interview Questions

Review this list of 44 Apple machine learning engineer interview questions and answers verified by hiring managers and candidates.
  • Apple logoAsked at Apple 
    +6

    "function isPalindrome(s, start, end) { while (s[start] === s[end] && end >= start) { start++; end--; } return end <= start; } function longestPalindromicSubstring(s) { let longestPalindrome = ''; for (let i=0; i < s.length; i++) { let j = s.length-1; while (s[i] !== s[j] && i <= j) { j--; } if (s[i] === s[j]) { if (isPalindrome(s, i, j)) { const validPalindrome = s.substring(i, j+1"

    Tiago R. - "function isPalindrome(s, start, end) { while (s[start] === s[end] && end >= start) { start++; end--; } return end <= start; } function longestPalindromicSubstring(s) { let longestPalindrome = ''; for (let i=0; i < s.length; i++) { let j = s.length-1; while (s[i] !== s[j] && i <= j) { j--; } if (s[i] === s[j]) { if (isPalindrome(s, i, j)) { const validPalindrome = s.substring(i, j+1"See full answer

    Machine Learning Engineer
    Data Structures & Algorithms
    +3 more
  • Apple logoAsked at Apple 
    +2

    "Make current as root. 2 while current is not null, if p and q are less than current, go left. If p and q are greater than current, go right. else return current. return null"

    Vaibhav D. - "Make current as root. 2 while current is not null, if p and q are less than current, go left. If p and q are greater than current, go right. else return current. return null"See full answer

    Machine Learning Engineer
    Data Structures & Algorithms
    +4 more
  • Apple logoAsked at Apple 

    "import java.util.Arrays; import java.util.stream.Collectors; class Main { // Recursive function to print all combinations of numbers from \i\ to \n\ // having sum \n. The index\ denotes the next free slot in the output array \out\ public static void printCombinations(int i, int n, int[] out, int index) { // if the sum becomes n, print the combination if (n == 0) { System.out.println(Arrays.stream(out).limit(index) .boxed().collect(Collectors.toList())); } // start from the previous e"

    Relynn may silver B. - "import java.util.Arrays; import java.util.stream.Collectors; class Main { // Recursive function to print all combinations of numbers from \i\ to \n\ // having sum \n. The index\ denotes the next free slot in the output array \out\ public static void printCombinations(int i, int n, int[] out, int index) { // if the sum becomes n, print the combination if (n == 0) { System.out.println(Arrays.stream(out).limit(index) .boxed().collect(Collectors.toList())); } // start from the previous e"See full answer

    Machine Learning Engineer
    Data Structures & Algorithms
    +4 more
  • Apple logoAsked at Apple 

    "The height of a binary tree is the maximum number of edges from the root node to any leaf node. To calculate the height of a binary tree, we can use a recursive approach. The basic idea is to compare the heights of the left and right subtrees of the root node, and return the maximum of them plus one."

    Prashant Y. - "The height of a binary tree is the maximum number of edges from the root node to any leaf node. To calculate the height of a binary tree, we can use a recursive approach. The basic idea is to compare the heights of the left and right subtrees of the root node, and return the maximum of them plus one."See full answer

    Machine Learning Engineer
    Data Structures & Algorithms
    +3 more
  • 🧠 Want an expert answer to a question? Saving questions lets us know what content to make next.

Showing 41-44 of 44