Technical Problems

  • Given a 2d array sorted each row and each row’s first element sorted, find the location of an element. Also, optimize the solution.

  • Write code to print Fibonacci series.

  • Write code to arrange white balls together then red balls when randomly arranged red and white balls are given.

  • You have 8 balls, 1 of which is heavy, and you have a weighing balance, find the heavier ball in minimum number of iterations.

  • Alice and Beth run the 100 meters race. Alice wins by 10 meters. In the next race, Alice starts 10 meters behind Beth, who will win if their speeds are the same as before?

  • Write a program to print prime numbers

  • Write a code in order to reserve the characters in an array/string.

  • Problems on string concatenation

  • Find the middle element of an array without using length.

  • Water-Island Problem: Given a 2D Boolean matrix, find the number of islands. A group of connected 1s (an isolated 1 is also considered a group) forms an island. For example, the below matrix contains 5 islands

Input : mat[][] = {{1, 1, 0, 0, 0},
                   {1, 1, 0, 0, 1},
                   {1, 0, 0, 1, 1},
                   {1, 0, 0, 0, 0},
                   {1, 0, 1, 1, 1}
Output : 3
  • Given two Rectangles, check if they are intersecting or not

  • Given an array A and an integer X, check if there exists a contagious subarray of A, the sum of whose elements is exact

  • Find the GCD of two given numbers

  • Reverse a string using no extra space.

  • Find the fastest of 3 vehicles, given the distance traveled and time taken by each vehicle

  • Write a program for

    3 5 7
    
    4 6 2
    
    1 4 5 
    Print this matrix in this form: 3 5 7 2 6 4 1 4 5
  • If a drone goes x km in a direction and comes back y km them calculate the time required for the drone to cover z km

  • Program for string reverse

  • Find whether a number is even or odd by using addition and subtraction only

  • The Bulb Puzzle.

  • If a plane flies 10m North, 10m East, 10m West, 10m South then where is it now? (I told him the same position, but he said it's wrong and asked me to take into consideration Earth's spherical shape and it's rotation into consideration)

  • A number of bacteria are placed in a dish. they divide into two after each second. after one minute, the dish is full. When was the dish half full?

  • What is the maximum number of runs a batsmen can score in a game of 50 overs cricket game...No illegal deliveries

  • You have 9 balls having same size and color, but only one ball is defective. How would you identify that ball?

  • Print the highest number possible using numbers from a given set only once.

  • Estimate number of traffic signals in <city_name>.

  • What will you do when a situation arises with neither right or wrong answers?

  • Estimate number of airplanes in air in India between 4 pm to 4.30 pm on any particular Monday.

  • A <company_name> wants to launch a drug that reduces fat and makes a person thin in 6 months. The company doesn't have any competitors and they want to launch the product in India. What should be the drug price in India? What will be your suggestions?

Last updated