Tip 1: Practice problems on percentages, profit and loss, time and work, permutations, and probability.
Tip 2: Solve problems on coding platforms.
Tip 3: Revise the fundamental concepts of Java.
Tip 1: Include relevant projects on your resume.
Tip 2: Don't list skills you're not confident in on your resume.
The link for the exam was active for 24 hours on February 22. We were allowed to take the test at any time within this time frame.
Which of these is not a pillar of OOPS?
(A) Encapsulation
(B) Polymorphism
(C) Abstraction
(D) Compilation
(E) Inheritance
Ans:- D) compilation
If a number has trailing zeros, then its reverse will not include them. For e.g., the reverse of 10400 will be 401 instead of 00401.
Repeatedly extract the last digit of n using the modulus operator (n % 10) and append it to the reverse number (revNum). After extracting the digit, the number n is reduced by dividing it by 10 (n = n / 10). This process continues until n becomes 0. Finally, the reversed number (revNum) is returned.
If the array is 2,5 and 6
2 XOR 5 is 7
2 XOR 6 is 4
5 XOR 6 is 3
Hence the answer is 7.
The idea is to generate all possible pairs of elements of the array arr[] and find the maximum among them. To do so, use two nested loops to generate all the pairs and compute the XOR of them. The maximum of all the pairs is the result.
The interview was scheduled to be held online, with the timing from 3:30 PM to 4:00 PM. I was asked to join the call via SHL at 3:25 PM sharp. The interviewer was supportive and very professional.
An array ‘B’ is a subarray of an array ‘A’ if ‘B’ that can be obtained by deletion of, several elements(possibly none) from the start of ‘A’ and several elements(possibly none) from the end of ‘A’.
When I encountered this question during my LTIMindtree interview, I initially thought of using brute force (checking all subarrays), but it would result in O(N²) time complexity, which is inefficient for large inputs. Then, I quickly realized that the Sliding Window technique could optimize the solution.
If the given array is: [0, 0, 1, 0, 1] The largest subarray would be: [0, 1, 0, 1] (last 4 elements) having length 4.
I realized that by treating 0 as -1, the problem transforms into finding the longest subarray with a sum of 0—which is a classic prefix sum with a hash map problem.
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
Which traversal uses a queue as its primary data structure?