Add office photos
Employer?
Claim Account for FREE

Housing.com

3.8
based on 517 Reviews
Filter interviews by

10+ GSSPEC Interview Questions and Answers

Updated 3 Mar 2024
Popular Designations
Q1. Longest Substring Without Repeating Characters

Given a string 'S' of length 'L', return the length of the longest substring without repeating characters.

Example:

Suppose given input is "abacb", then the length ...read more
View 5 more answers
Q2. Maximum level sum

Given a Binary Tree with integer nodes, your task is to find the maximum level sum among all the levels in the Binary Tree. The sum of any level in a tree is the sum of all the nodes present at...read more

View 3 more answers
Q3. Maximum Sum Circular Subarray

You have been given a circular array/list ‘ARR’ containing ‘N’ integers. You have to find out the maximum possible sum of a non-empty subarray of ‘ARR’.

A circular array is an array...read more

View 3 more answers
Q4. Replace Spaces

You have been given a string 'STR' of words. You need to replace all the spaces between words with “@40”.

Input Format:
The first line contains a single integer ‘T’ representing the number of test...read more
View 3 more answers
Discover GSSPEC interview dos and don'ts from real experiences
Q5. Word Break-1

You are given a non-empty string containing no spaces (say sentence) and a dictionary of list of non-empty strings (say the list of words). You are supposed to construct and return all possible sen...read more

View 4 more answers
Q6. Painter's Partition Problem

Given an array/list of length ‘N’, where the array/list represents the boards and each element of the given array/list represents the length of each board. Some ‘K’ numbers of painter...read more

View 4 more answers
Are these interview questions helpful?
Q7. Sum of Big integers.

You have been given two integers ‘NUM1’ and ‘NUM2’ as a string. Your task is to print the sum of both the numbers.

Input Format:
The first line contains a single integer ‘T’ representing the...read more
View 2 more answers

Q8. Given an array, return true, if it can be partitioned into two subarrays whose sum of elements are same, else return false Example: Input: {5,1,5,11} Output: true (as it can be divided into {5,1,5} {11} where 5...

read more
Ans.

Check if an array can be partitioned into two subarrays with equal sum.

  • Iterate through the array and calculate the total sum of all elements.

  • If the sum is odd, return false as it cannot be divided into two equal parts.

  • If the sum is even, try to find a subset with sum equal to half of the total sum.

  • Use dynamic programming or backtracking to find the subset sum.

View 1 answer
Share interview questions and help millions of jobseekers 🌟

Q9. Add two integers which cannot be stored even in long long int?

Ans.

It is not possible to add two integers that cannot be stored even in long long int.

  • The maximum value that can be stored in long long int is 9,223,372,036,854,775,807.

  • Any two integers whose sum exceeds this value cannot be stored in long long int.

  • In such cases, a different data type or approach is required to handle the large numbers.

Add your answer

Q10. input: “kitten%20pic.jpg” output: “kitten pic.jpg” %20 -> ‘ ‘ %3A -> ‘?’ %3D -> ‘:’ modify your input in place. no string library functions. void DecodeURL(string str

Ans.

The function decodes a URL-encoded string by replacing specific characters with their corresponding symbols.

  • Iterate through each character in the input string

  • If the character is '%', check the next two characters to determine the replacement symbol

  • Replace the '%XX' sequence with the corresponding symbol

  • Continue until all occurrences of '%XX' are replaced

Add your answer

Q11. Find out the maximum contiguous circular sum in array, array may contain positive as well as negative numbers?

Ans.

The maximum contiguous circular sum in an array is the maximum sum that can be obtained by wrapping the array around in a circular manner.

  • To find the maximum contiguous circular sum, we can use Kadane's algorithm twice.

  • First, we find the maximum sum using Kadane's algorithm for the non-circular array.

  • Then, we find the maximum sum using Kadane's algorithm for the circular array by subtracting the minimum sum subarray from the total sum of the array.

  • The maximum of these two sum...read more

Add your answer

Q12. Length of longest substring with no repeating character (Full running code)?

Ans.

Find the length of the longest substring without any repeating characters.

  • Use a sliding window approach to iterate through the string.

  • Keep track of the characters seen so far using a set.

  • Update the maximum length of the substring whenever a repeating character is encountered.

Add your answer

Q13. Given a binary tree, print sum of each level ?

Ans.

Given a binary tree, print sum of each level

  • Use a breadth-first search (BFS) algorithm to traverse the tree level by level

  • Keep track of the sum of each level using a separate variable for each level

  • Print the sum of each level after traversing the entire tree

Add your answer

Q14. rotated sorted array problem

Ans.

Rotated sorted array problem involves finding a target element in a rotated sorted array.

  • Use binary search to find the pivot point where the array is rotated.

  • Divide the array into two subarrays and perform binary search on the appropriate subarray.

  • Handle cases where the target element is at the pivot point or not present in the array.

Add your answer

More about working at Housing.com

#8 Best Tech Startup - 2022
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at GSSPEC

based on 3 interviews in the last 1 year
Interview experience
3.3
Average
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Interview Questions from Similar Companies

3.3
 • 53 Interview Questions
4.4
 • 25 Interview Questions
3.8
 • 11 Interview Questions
3.8
 • 11 Interview Questions
4.0
 • 10 Interview Questions
3.7
 • 10 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

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