Blog Archives

01: String parsing & date formatting – complete the given code

Q. Complete the method “changeDateFormat(String paragraph)” which takes a string input containing dates in mm/dd/yyyy format and converts them to …

Read more ›



02: Working with Java Collections – Complete the given code

Q. Complete the method “canAttendAll(Collection seminars)” which takes a collection of seminar objects with start and end timestamps, and the … … Read more ›...



03: Tree navigation – is a BST Tree?

Q. Complete the method “isValidBST(Node root)” which takes a “Tree node” as an input to evaluate if the input is … … Read more ›...



04: Are Anagrams – Complete the given code

Q. Complete the “areAnagrams(String a, String b)” method so that it returns if two given input strings are anagram or … … Read more ›...



05: Is a palindrome – complete the given code

Q. Complete the method “isPalindrome(String str) ” which takes a “string” as an input to evaluate if the input is … … Read more ›...



06: Change Dir Path – String parsing & working with collections

Q. Complete the method ” public DirPath cd(String newPath)” which applies the following rules: /   : starting with “/” means … … Read more ›...



07: Index of long consecutive characters in a string – flow control

Q. Complete the method “int startIndexOfLongestRun(String input)” that returns the start index of a character that has the longest consecutive … … Read more ›...



08: Jumping Frog problem in Java – Complete the given code

Q. Complete the method “int numberOfWays(int n)” where n is the distance to cover and the method should return the … … Read more ›...



09: Find all permutations of a given string – best example to understand recursion

Q. Complete the method “Set getAllCombinations(String input) ” where input is any string and the method should return all possible … … Read more ›...



10: Find all permutations of a given string – Iteration in Java

Q. Complete the method “Set getAllCombinations(String input) ” where input is any string and the method should return all possible … … Read more ›...



11: Threads performing tasks by talking to each other

Q. Given the following code

Output:

Complete the above code so that it prints a=1 and b=1 interleaved.

A. …

Read more ›



12: Complete the trades matching logic

Q. Given the following code Fill in required code in the “//********** TO BE COMPLETED *************” section within the “match(Trade … … Read more ›...



13: Atomicity, Visibility, & synchronization in Java

Q. Given the following code, Client Service interface & implementation the line “XXX expensive call to a legacy system” in … … Read more ›...



Java & Big Data Categories

Top