Premium Employer

Info Edge

3.9
based on 2k Reviews
Filter interviews by

10+ AccorHotels Interview Questions and Answers

Updated 2 Jul 2024
Popular Designations

Q1. Buy and Sell Stock Problem Statement

Imagine you are Harshad Mehta's friend, and you have been given the stock prices of a particular company for the next 'N' days. You can perform up to two buy-and-sell transa...read more

Ans.

The task is to determine the maximum profit that can be achieved by performing up to two buy-and-sell transactions on a given set of stock prices.

  • Iterate through the array of stock prices to find the maximum profit that can be achieved by buying and selling stocks at different points.

  • Keep track of the maximum profit that can be achieved by considering all possible combinations of buy and sell transactions.

  • Ensure that you sell the stock before you can buy again to adhere to th...read more

View 1 answer

Q2. Boundary Traversal of a Binary Tree

Given a binary tree of integers, your task is to return the boundary nodes of the tree in Anti-Clockwise direction starting from the root node.

Input:

The first line contains...read more
Ans.

Return the boundary nodes of a binary tree in Anti-Clockwise direction starting from the root node.

  • Traverse the left boundary nodes in top-down order

  • Traverse the leaf nodes in left-right order

  • Traverse the right boundary nodes in bottom-up order

  • Handle cases where duplicates occur in boundary nodes

Add your answer

Q3. Number of Bit Flips Problem Statement

Ninja is practicing binary representations and stumbled upon an interesting problem. Given two numbers 'A' and 'B', you are required to determine how many bits need to be f...read more

Ans.

Calculate the number of bit flips required to convert one number to another in binary representation.

  • Convert both numbers to binary representation

  • Count the number of differing bits between the two numbers

  • Output the count of differing bits as the number of bit flips required

  • Example: A = 13 (1101), B = 7 (0111) -> 2 bit flips required

Add your answer

Q4. Reverse Linked List in Groups of K

You are provided with a linked list containing 'N' nodes and an integer 'K'. The task is to reverse the linked list in groups of size K, which means reversing the nodes in eac...read more

Ans.

Reverse a linked list in groups of size K by reversing nodes in each group.

  • Iterate through the linked list in groups of size K

  • Reverse each group of nodes

  • Handle cases where the number of elements in the last group is less than K

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

Q5. 2. From an array of integers which contains values for a particular stock . Find the value at which a person should buy and sell such that the profit is maximum.

Ans.

Find the maximum profit from buying and selling a stock given an array of its values.

  • Iterate through the array and keep track of the minimum value seen so far.

  • Calculate the profit at each index and update the maximum profit seen.

  • Return the maximum profit.

Add your answer

Q6. 1. Count the number of flips require to convert a binary string of 0 and 1 such that resultant string has alternate 0 and 1

Ans.

Count the number of flips required to convert a binary string to alternate 0 and 1.

  • Iterate through the string and count the number of flips required to make it alternate.

  • Keep track of the current character and the expected character.

  • Example: 001101 -> 010101 requires 2 flips.

  • Example: 101010 -> 010101 requires 3 flips.

Add your answer

Q7. 4. Reverse a linked list in groups of k nodes.

Ans.

Reverse a linked list in groups of k nodes.

  • Divide the linked list into groups of k nodes

  • Reverse each group of k nodes

  • Connect the reversed groups to form the final linked list

  • Use recursion or iteration to implement the solution

Add your answer

Q8. 3. Boundary traversal of a tree.

Ans.

Boundary traversal of a tree

  • Boundary traversal involves visiting the nodes on the boundary of a tree in a specific order

  • Start with the root node and traverse the left boundary, then the leaf nodes from left to right, and finally the right boundary

  • Use recursion to traverse the left and right subtrees

  • Exclude the leaf nodes that are also part of the left or right boundary

Add your answer

Q9. coding assignment for binary search

Ans.

Implement binary search algorithm to find a target string in a sorted array of strings.

  • Ensure the array of strings is sorted before performing binary search.

  • Compare the target string with the middle element of the array and adjust the search range accordingly.

  • Repeat the process until the target string is found or the search range is exhausted.

Add your answer

Q10. Build an MVC architecture

Ans.

MVC architecture separates an application into Model, View, and Controller components for better organization and scalability.

  • Model represents the data and business logic

  • View displays the data to the user

  • Controller handles user input and updates the model

  • Example: Model - User class with properties like name, email; View - HTML template to display user info; Controller - User controller to handle user actions

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at AccorHotels

based on 7 interviews
2 Interview rounds
Resume Shortlist Round
Technical Round
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Senior Software Engineer Interview Questions from Similar Companies

3.7
 • 33 Interview Questions
3.8
 • 28 Interview Questions
4.1
 • 22 Interview Questions
4.4
 • 16 Interview Questions
3.6
 • 12 Interview Questions
3.6
 • 11 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