Add office photos
Engaged Employer

Expedia Group

3.8
based on 296 Reviews
Filter interviews by

20+ McDermott International Interview Questions and Answers

Updated 5 Feb 2024
Popular Designations

Q1. Problem Statement: Largest Subarray with Equal Number of 0s and 1s

Given an array containing only 0s and 1s, determine the length of the longest contiguous subarray that has an equal number of 0s and 1s.

Input:...read more

Add your answer

Q2. Maximum Sum of Two Non-Overlapping Subarrays

Given an integer array ARR and a positive integer K, your objective is to find two non-overlapping subarrays (contiguous) of length K each, such that their summed to...read more

Add your answer

Q3. Gas Tank Problem Statement

You have a car with a gas tank of infinite capacity. There are 'N' gas stations located along a circular route, numbered from 0 to N-1. You begin your journey with an empty tank from ...read more

Add your answer

Q4. Knight Probability in Chessboard

Calculate the probability that a knight remains on an N x N chessboard after making K moves. Initially, the knight is placed at a given position on the board. It can move in any...read more

Ans.

Calculate the probability that a knight remains on an N x N chessboard after making K moves.

  • Use dynamic programming to calculate the probability of the knight staying on the board after each move.

  • Consider all possible moves the knight can make from its current position.

  • Keep track of the probabilities at each position on the board after each move.

  • Normalize the probabilities at the end to get the final result.

  • Example: For a 3x3 board and 2 moves, the probability of the knight s...read more

Add your answer
Discover McDermott International interview dos and don'ts from real experiences

Q5. Anagram Difference Problem Statement

Given two strings, 'STR1' and 'STR2', of equal lengths, determine the minimum number of manipulations required to make the two strings anagrams of each other.

Input:

The fir...read more
Add your answer

Q6. Count Nodes within K-Distance Problem Statement

Given a connected, undirected, and acyclic graph where some nodes are marked and a positive integer 'K'. Your task is to return the count of nodes such that the d...read more

Add your answer
Are these interview questions helpful?

Q7. String Rearrangement Problem Statement

You are given a string of lowercase characters. The objective is to rearrange (reorder) the string so that no two adjacent characters are identical.

Return the rearranged ...read more

Ans.

The objective is to rearrange a string so that no two adjacent characters are identical. Return the rearranged string or 'NO SOLUTION'.

  • Iterate through the string and count the frequency of each character.

  • Create two lists, one for characters with odd frequency and one for characters with even frequency.

  • If the count of characters with odd frequency is greater than 1, return 'NO SOLUTION'.

  • Alternate between characters with even and odd frequency to create the rearranged string.

Add your answer

Q8. Boundary Traversal of Binary Tree

Given a binary tree of integers, your task is to print the boundary nodes of this binary tree in an anti-clockwise direction starting from the root node.

Input:

The first line ...read more
Add your answer
Share interview questions and help millions of jobseekers 🌟

Q9. Binary Tree to Doubly Linked List

Transform a given Binary Tree into a Doubly Linked List.

Ensure that the nodes in the Doubly Linked List follow the Inorder Traversal of the Binary Tree.

Input:

The first line ...read more
Ans.

Convert a Binary Tree into a Doubly Linked List following Inorder Traversal.

  • Perform Inorder Traversal of the Binary Tree to get the nodes in order.

  • Create a Doubly Linked List by connecting the nodes in the order obtained from Inorder Traversal.

  • Return the head of the Doubly Linked List as the output.

Add your answer

Q10. Remove Character from String Problem Statement

Given a string str and a character 'X', develop a function to eliminate all instances of 'X' from str and return the resulting string.

Input:

The first line contai...read more
Ans.

Develop a function to remove all instances of a given character from a string.

  • Iterate through the string character by character and skip the character to be removed.

  • Build a new string by appending characters that are not equal to the given character.

  • Return the final modified string.

  • Handle edge cases like empty string or character not found in the string.

Add your answer

Q11. LRU Cache Design Question

Design a data structure for a Least Recently Used (LRU) cache that supports the following operations:

1. get(key) - Return the value of the key if it exists in the cache; otherwise, re...read more

Ans.

Design a Least Recently Used (LRU) cache data structure that supports get and put operations with capacity constraints.

  • Use a combination of a doubly linked list and a hashmap to efficiently implement the LRU cache.

  • Keep track of the least recently used item and update it accordingly when new items are added.

  • Ensure that the cache does not exceed its capacity by evicting the least recently used item when necessary.

Add your answer

Q12. Problem: Deletion in Circular Linked List

You are provided with a Circular Linked List of integers and a specific integer, referred to as 'key'.

Your task is to implement a function that locates the specified k...read more

Ans.

Implement a function to delete a specific key from a Circular Linked List of integers.

  • Traverse the Circular Linked List to find the key to be deleted.

  • Adjust the pointers to remove the node containing the key.

  • Handle the case where the Circular Linked List becomes empty after deletion.

  • Return -1 if the Circular Linked List is empty after deletion.

Add your answer

Q13. Page Faults Identification Problem Statement

In computing, a page fault occurs when a process accesses a memory page that is not currently mapped by the memory management unit. To handle new pages being brought...read more

Ans.

The problem involves determining the number of page faults using the Least Recently Used (LRU) replacement algorithm.

  • Page faults occur when a process accesses a memory page not currently mapped by the memory management unit.

  • Page replacement algorithm like LRU is used to decide which existing page should be replaced.

  • The goal is to calculate the number of page faults based on the given input sequences and memory capacity.

  • Constraints include the number of test cases, number of p...read more

Add your answer

Q14. Closest Sum Problem Statement

Given an array of integers ARR of size N and an integer target, find three integers in ARR such that their sum is closest to the target. If there are two closest sums, return the s...read more

Ans.

Find three integers in an array whose sum is closest to a given target, return the smallest sum if there are two closest sums.

  • Iterate through all possible triplets in the array to find the sum closest to the target.

  • Keep track of the closest sum found so far and update it if a closer sum is found.

  • Return the closest sum at the end of the iteration.

Add your answer

Q15. Deletion in Circular Linked List Problem Statement

Given a Circular Singly Linked List of integers, and a specific value 'VAL', your task is to delete the first occurrence of this value in the linked list. If t...read more

Ans.

Delete the first occurrence of a specific value in a Circular Linked List.

  • Traverse the circular linked list to find the value to be deleted.

  • Update the pointers to skip the node containing the value.

  • Handle edge cases like deleting the only node in the list.

  • Return the modified circular linked list.

Add your answer

Q16. Cycle Detection in a Singly Linked List

Determine if a given singly linked list of integers forms a cycle or not.

A cycle in a linked list occurs when a node's next points back to a previous node in the list. T...read more

Ans.

Detect if a singly linked list forms a cycle by checking if a node's next points back to a previous node.

  • Traverse the linked list using two pointers, one moving one step at a time and the other moving two steps at a time.

  • If the two pointers meet at any point, it indicates the presence of a cycle in the linked list.

  • Use Floyd's Cycle Detection Algorithm for efficient detection of cycles in a linked list.

Add your answer

Q17. Find Duplicates in an Array

Given an array ARR of size 'N', where each integer is in the range from 0 to N - 1, identify all elements that appear more than once.

Return the duplicate elements in any order. If n...read more

Ans.

Find duplicates in an array of integers within a specified range.

  • Iterate through the array and keep track of the count of each element using a hashmap.

  • Return elements with count greater than 1 as duplicates.

  • Time complexity can be optimized to O(N) using a set to store duplicates.

Add your answer
Q18. Can you explain how the file system is stored on a disk and how it works?
Add your answer
Q19. Given a problem statement and a code, how would you find and correct the bugs in the code?
Add your answer
Q20. Can you distinguish between RISC and CISC architectures?
Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at McDermott International

based on 2 interviews
2 Interview rounds
Coding Test Round
HR Round
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Interview Questions from Similar Companies

3.6
 • 122 Interview Questions
4.0
 • 105 Interview Questions
4.2
 • 26 Interview Questions
3.8
 • 12 Interview Questions
3.6
 • 10 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter