Add office photos
Grey Orange logo
Employer?
Claim Account for FREE

Grey Orange

3.2
based on 330 Reviews
Video summary
Filter interviews by
Software Engineer
Fresher
Clear (1)

Grey Orange Software Engineer Interview Questions and Answers

Updated 5 Feb 2024

Q1. Print All Permutations of a String

Given an input string STR, generate and print all possible permutations of the string.

Input:

str

Output:

All permutations of the input string, each on a new line.

Example:

In...read more
Ans.

Generate and print all possible permutations of a given input string.

  • Use recursion to generate all permutations by swapping characters in the string.

  • Maintain a visited array to keep track of characters already used in a particular permutation.

  • Print each permutation as it is generated.

  • Handle duplicate characters by skipping swapping if the character is already in the current position.

Add your answer
right arrow

Q2. Longest Consecutive Sequence Problem Statement

You are provided with an unsorted array/list ARR of N integers. Your task is to determine the length of the longest consecutive sequence present in the array.

Expl...read more

Ans.

The task is to find the length of the longest consecutive sequence in an unsorted array of integers.

  • Sort the array to bring consecutive numbers together

  • Iterate through the sorted array and keep track of the current consecutive sequence length

  • Update the maximum length if a longer sequence is found

Add your answer
right arrow
Grey Orange Software Engineer Interview Questions and Answers for Freshers
illustration image

Q3. Nth Fibonacci Number Problem Statement

Calculate the Nth term in the Fibonacci sequence, where the sequence is defined as follows: F(n) = F(n-1) + F(n-2), with initial conditions F(1) = F(2) = 1.

Input:

The inp...read more
Ans.

The program calculates the Nth Fibonacci number using a recursive formula.

  • The Fibonacci series starts with 1, 1, and each subsequent number is the sum of the two preceding numbers.

  • The program uses a recursive function to calculate the Nth Fibonacci number.

  • The time complexity of the program is O(2^N), which can be optimized using memoization or dynamic programming.

Add your answer
right arrow

Q4. Reverse the String Problem Statement

You are given a string STR which contains alphabets, numbers, and special characters. Your task is to reverse the string.

Example:

Input:
STR = "abcde"
Output:
"edcba"

Input...read more

Ans.

The task is to reverse a given string containing lowercase letters, uppercase letters, digits, and special characters.

  • Iterate through the string from the last character to the first character and append each character to a new string.

  • Alternatively, you can use built-in string reversal functions or methods available in your programming language.

  • To solve the follow-up question with O(1) space complexity, you can use a two-pointer approach. Initialize two pointers, one at the be...read more

Add your answer
right arrow
Discover Grey Orange interview dos and don'ts from real experiences

Q5. Rectangle Area Calculation

Given a list of rectangles, where each rectangle is represented by an array of four integers indicating its bottom-left and top-right corners, calculate the total area covered by all ...read more

Ans.

Calculate total area covered by a list of rectangles on a plane.

  • Iterate through each rectangle and calculate its area

  • Check for overlapping areas between rectangles

  • Sum up the total area covered by all rectangles

Add your answer
right arrow

Q6. Bit Set Problem Statement

You are provided with a string, termed as DIGIT_PATTERN, which consists solely of digits. The objective is to identify the first digit that repeats in the sequence. If there's no repea...read more

Ans.

Identify the first repeating digit in a given string of digits.

  • Iterate through the string and keep track of seen digits using a set.

  • Return the first digit that repeats, or -1 if no digit repeats.

  • Time complexity: O(n), where n is the length of the input string.

Add your answer
right arrow
Contribute & help others!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos

Interview Process at Grey Orange Software Engineer

based on 1 interviews
Interview experience
5.0
Excellent
View more
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Engineer Interview Questions from Similar Companies

PayPal Logo
3.9
 • 41 Interview Questions
ACS Group Logo
3.4
 • 17 Interview Questions
Treez Logo
3.3
 • 10 Interview Questions
View all
Recently Viewed
INTERVIEWS
mthree
No Interviews
INTERVIEWS
Smart Energy Water
No Interviews
INTERVIEWS
Larsen & Toubro Limited
No Interviews
INTERVIEWS
Shapoorji Pallonji Group
No Interviews
INTERVIEWS
Texas Instruments
No Interviews
INTERVIEWS
Varite
10 top interview questions
INTERVIEWS
Maruti Suzuki
No Interviews
SALARIES
JPMorgan Chase & Co.
INTERVIEWS
Reliance Retail
No Interviews
REVIEWS
JPMorgan Chase & Co.
No Reviews
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter