Tip 1: Solve easy and medium level coding questions.
Tip 2: Basics of computer should be clear.
Tip 1: Mention at least two latest tech projects.
Tip 2: Learn and highlight a unique technology to differentiate yourself from the competition..
Around 50 MCQs on aptitude and English communication and 2 coding problems came in the online assessment.
You are given a positive integer N, return the sum of all prime numbers between 1 and N(inclusive).
step1 -Define a function that takes an integer N as input.
step 2-Create a helper function to check if a number is prime.
step 3- A prime number is only divisible by 1 and itself.
step 4-Check divisibility from 2 to sqrt(n).
step 5-Iterate through numbers from 1 to N, check if they are prime.
step 6-Sum up all prime numbers found in the range.
step7 -Return the sum as output
Given an integer array arr[] and an integer ele the task is to the remove all occurrences of ele from arr[] in-place and return the number of elements which are not equal to ele. If there are k number of elements which are not equal to ele then the input array arr[] should be modified such that the first k elements should contain the elements which are not equal to ele and then the remaining elements.
1)Initialize j to 0. This will track the count of the elements not equal to ele.
2)Iterate over each element in the array using the loop with the index i.
3)f arr[i] is not equal to the ele, set arr[j] = arr[i] and increment j.
4)Return j.
Two trains are on same track and they are coming toward each other. The speed of the first train is 50 km/h and the speed of the second train is 70 km/h. A bee starts flying between the trains when the distance between two trains is 100 km. The bee first flies from first train to second train. Once it reaches the second train, it immediately flies back to the first train … and so on until trains collide. Calculate the total distance travelled by the bee. Speed of bee is 80 km/h.
Given a string s, find the length of the longest substring with all distinct characters.
1)Initialize: Set left = 0, max_length = 0, and an empty set.
2)Expand right pointer: If s[right] is in set, remove s[left] and move left.
3)Update max: Store the max substring length.
4)Repeat until the end of s.
5)Return max_length
Given an array arr[] and an integer target, determine if there exists a triplet in the array whose sum equals the given target.
Return true if such a triplet exists, otherwise, return false.
1)Sort the array arr[].
2)Loop through each element arr[i] (fix one element).
3)Use Two Pointers: Set left = i + 1, right = n - 1.
4)Check Sum:
If arr[i] + arr[left] + arr[right] == target, return true.
If sum < target, move left right.
If sum > target, move right left.
5)Repeat until left < right.
6)Return false if no triplet is found.
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?