IBM Interview Questions

Review this list of 5 IBM interview questions and answers verified by hiring managers and candidates.
  • IBM logoAsked at IBM 

    "Use a representative of each, e.g. sort the string and add it to the value of a hashmap> where we put all the words that belong to the same anagram together."

    Gaston B. - "Use a representative of each, e.g. sort the string and add it to the value of a hashmap> where we put all the words that belong to the same anagram together."See full answer

    Software Engineer
    Data Structures & Algorithms
    +4 more
  • IBM logoAsked at IBM 
    Video answer for 'Merge Intervals'
    +33

    "const mergeIntervals = (intervals) => { const compare = (a, b) => { if(a[0] b[0]) return 1 else if(a[0] === b[0]) { return a[1] - b[1] } } let current = [] const result = [] const sorted = intervals.sort(compare) for(let i = 0; i = b[0]) current[1] = b[1] els"

    Kofi N. - "const mergeIntervals = (intervals) => { const compare = (a, b) => { if(a[0] b[0]) return 1 else if(a[0] === b[0]) { return a[1] - b[1] } } let current = [] const result = [] const sorted = intervals.sort(compare) for(let i = 0; i = b[0]) current[1] = b[1] els"See full answer

    Software Engineer
    Data Structures & Algorithms
    +6 more
  • IBM logoAsked at IBM 
    Video answer for 'Move all zeros to the end of an array.'
    +39

    "Initialize left pointer: Set a left pointer left to 0. Iterate through the array: Iterate through the array from left to right. If the current element is not 0, swap it with the element at the left pointer and increment left. Time complexity: O(n). The loop iterates through the entire array once, making it linear time. Space complexity: O(1). The algorithm operates in-place, modifying the input array directly without using additional data structures. "

    Avon T. - "Initialize left pointer: Set a left pointer left to 0. Iterate through the array: Iterate through the array from left to right. If the current element is not 0, swap it with the element at the left pointer and increment left. Time complexity: O(n). The loop iterates through the entire array once, making it linear time. Space complexity: O(1). The algorithm operates in-place, modifying the input array directly without using additional data structures. "See full answer

    Software Engineer
    Data Structures & Algorithms
    +4 more
  • IBM logoAsked at IBM 
    +37

    "a. Sort the array elements. b. take two pointers at index 0 and index Len-1; c. if the sum at the two pointers is target; break and return the pair d. if the sum is smaller, then move left pointer by 1 e. else move right pointer by 1; run the logic till the target is met or right pointer crosses the left pointer."

    Komal S. - "a. Sort the array elements. b. take two pointers at index 0 and index Len-1; c. if the sum at the two pointers is target; break and return the pair d. if the sum is smaller, then move left pointer by 1 e. else move right pointer by 1; run the logic till the target is met or right pointer crosses the left pointer."See full answer

    Software Engineer
    Data Structures & Algorithms
    +5 more
  • IBM logoAsked at IBM 

    "My answer followed the framework: Users -> Goals -> Main Tasks -> Requirements -> Design -> Implementation -> Launch"

    Alessandra L. - "My answer followed the framework: Users -> Goals -> Main Tasks -> Requirements -> Design -> Implementation -> Launch"See full answer

    Product Manager
    Product Design
  • 🧠 Want an expert answer to a question? Saving questions lets us know what content to make next.

Showing 1-5 of 5