Search Interview Questions | More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know. |
|
| ||||
Interview Questions and Answers for 'Booking.com' - 7 question(s) found - Order By Newest | ||||
Very frequently asked. Favorite question in Walk in Drive of many Indian service companies. | ||||
| ||||
Ans. They are different the way their elements are stored in memory. TreeMap stores the Keys in order whereas HashMap stores the key value pairs randomly. | ||||
Sample Code for treemap Sample Code for hashmap | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   collections   map   treemap   hashmap   treemap vs hashmap Asked in 31 Companies basic   frequent | ||||
Try 1 Question(s) Test | ||||
Frequently asked question for intermediate developers. Frequently asked in HCL Technologies and EPAM. | ||||
| ||||
Ans. Volatile is a declaration that a variable can be accessed by multiple threads and hence shouldnt be cached. | ||||
Sample Code for volatile | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   oops   synchronization   volatile   java keywords Asked in 42 Companies intermediate   frequent | ||||
Try 1 Question(s) Test | ||||
| ||||
Ans. This is the exception that is thrown when we try to modify the non concurrent collection class while iterating through it. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   collections   concurrentmodificationexception   exception  concurrency Asked in 14 Companies intermediate | ||||
| ||||
Ans. public void checkIfAnagram(String str1,String str2){ boolean anagram = true; for(char c:str1.toCharArray()){ if(!str2.contains(String.valueOf(c))){ System.out.println("Strings are Anagrams"); anagram = false; } if(anagram == true){ System.out.println("Strings are not Anagrams"); } } } | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   check if 2 strings are Anagrams Asked in 30 Companies basic   frequent | ||||
| ||||
This question was recently asked at 'Booking.com,InterContinental Hotels,Caissa,Workday'.This question is still unanswered. Can you please provide an answer. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 4 Companies | ||||
| ||||
Ans. https://www.geeksforgeeks.org/check-for-balanced-parentheses-in-an-expression/ | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  string  code  coding Asked in 14 Companies | ||||
| ||||
Ans. package snippet; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; public class Pascal { public static void main(String[] args) { System.out.println(generatePascalTriangle(5)); } static Map> generatePascalTriangle(int size) { Map> triangle = new HashMap<>(); triangle.put(0, Arrays.asList(1)); triangle.put(1, Arrays.asList(1, 1)); for (int i = 2; i <= size; i ) { List coeffListForI = new ArrayList<>(); List coeffListForI_1 = triangle.get(i - 1); coeffListForI.add(1); for (int j = 0; j <= coeffListForI_1.size() - 2; j ) { coeffListForI.add(coeffListForI_1.get(j) coeffListForI_1.get(j 1)); } coeffListForI.add(1); triangle.put(i, coeffListForI); } return triangle; } } | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 8 Companies | ||||