Questions related to strings

## Amazon Interview Experience | Set 213 (Off-Campus for SDE1)

Hello I have applied for Amazon after completing my 1 yr at job and got a call for a full day interview. Interview happens as… Read More »

## Shortest Superstring Problem

Given a set of n strings arr[], find the smallest string that contains each string in the given set as substring. We may assume that… Read More »

## OLA Interview Experience | Set 6 (For SDE-1)

Last month i was interviewed by Ola for SDE 1 post. Here is my experience. Round 1 a. Inorder predecessor and successor for a given… Read More »

## How to design a tiny URL or URL shortener?

How to design a system that takes big URLs like “https://www.geeksforgeeks.org/count-sum-of-digits-in-numbers-from-1-to-n/” and converts them into a short 6 character URL. It is given that URLs… Read More »

## Recursive function to do substring search

Given a text txt[] and a pattern pat[], write a recursive function “contains(char pat[], char txt[])” that returns true if pat[] is present in txt[],… Read More »

## Microsoft Interview Experience | Set 55 (For Software Engineer 2)

Skype round 1: (10 min) Print a tree in zigzag order. For Example for the given input tree:- 1 2 3 4 5 6 7… Read More »

## Remove repeated digits in a given number

Given an integer, remove consecutive repeated digits from it. Examples: Input: x = 12224 Output: 124 Input: x = 124422 Output: 1242 Input: x =… Read More »

## Remove spaces from a given string

Given a string, remove all spaces from the string and return it. Input: “g eeks for ge eeks ” Output: “geeksforgeeks” Expected time complexity is… Read More »

## Online algorithm for checking palindrome in a stream

Given a stream of characters (characters are received one by one), write a function that prints ‘Yes’ if a character makes the complete string palindrome,… Read More »

## Amazon Interview Experience | Set 188 (For SDE1)

Recently I am interviewed for Amazon SDE-1 position for Bangalore. There are 3 F2F rounds followed by a telephonic round. As it was a drive,… Read More »

## Recursively print all sentences that can be formed from list of word lists

Given a list of word lists How to print all sentences possible taking one word from a list at a time via recursion? Example: Input:… Read More »

## Build Lowest Number by Removing n digits from a given number

Given a string ‘str’ of digits and an integer ‘n’, build the lowest possible number by removing ‘n’ digits from the string and not changing… Read More »

## Check if a given sequence of moves for a robot is circular or not

Given a sequence of moves for a robot, check if the sequence is circular or not. A sequence of moves is circular if first and… Read More »

## Accolite Interview Experience | Set 3 (On-Campus)

Written MCQ There were 20 multiple choice questions to be done in 30 minutes time and most of the technical questions were from geeksquiz ,… Read More »

## Find the longest substring with k unique characters in a given string

Given a string you need to print longest possible substring that has exactly M unique characters. If there are more than one substring of longest… Read More »