Tip 1: Solve DSA problems from any sheet eg. striver fraz etc.
Tip 2: Regularly participate in contests.
Tip 1:You should have a project related to the role you are applying for.
Tip 2: For a frontend role, you should have at least one ReactJS project.



You're given an array where every element appears twice, except for one element which appears three times. All occurrences of the same element are adjacent to each other. You need to find the element that appears three times. For example, if the array is [2, 2, 3, 3, 5, 5, 5, 4, 4], the element that appears three times is 5. Your solution should have a time complexity of O(log n).
Started with linear search approach. After one hint from the interviewer, I came up with a writing approach using binary search.
Start with the entire array.
At each step of the binary search:
a. Calculate the middle index of the current search space.
b. Check if the element at the middle index is equal to both its adjacent elements.
c. If it is equal to both adjacent elements, then that element is the one that appears three times, so return it.
d. If it's not equal to both adjacent elements:
i. Determine which side of the array has an odd number of elements.
ii. If the left side has an odd number of elements, update the search space to the left half of the array.
iii. If the right side has an odd number of elements, update the search space to the right half of the array.
Repeat the process until the element that appears three times is found.



You're given two numbers, A and B. Your task is to find the minimum number of operations needed to transform A into B using the following operations: Multiply the current number by 2. Append the digit 1 to the right of the current number. (i.e. replace the number X by 10X+1). If it's not possible to transform A into B using these operations, print -1.
First, I came up with the basic recursive solution. Then, upon considering the problem from a different angle, instead of transforming A to B, I devised a greedy approach to solve it by transforming B to A.
In the final round with the manager, he asked me questions based on my resume and inquired about my previous internship experiences. Additionally, he focused on JavaScript topics, particularly delving into topics such as
-> setTimeout
-> promises
-> difference between session storage and local storage.
Make a 5X5 grid using HTML and CSS. The follow-up question was to center this grid on the page(both horizontally centered and vertically centered)
-> Create a grid using nested elements for rows and cells.
-> Apply CSS to define grid layout, cell size, and any desired styling.
->Use margin: 0 auto; on the grid container to horizontally center it.
-> Wrap the grid container in a flexbox wrapper and use justify-content: center; align-items: center; to vertically center it.
-> Apply both horizontal and vertical centering techniques to the grid container and its wrapper to center it both horizontally and vertically on the page.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?