Questions related to strings

## Find the first non-repeating character from a stream of characters

Given a stream of characters, find the first non-repeating character from stream. You need to tell the first non-repeating character in O(1) time at any… Read More »

## Amazon Interview | Set 49 (On-campus for SDE-1)

Recently, I have been through the interview experience of Amazon India and I would like to share my experience with everyone. Position: SDE- 1 No.… Read More »

## Find if a string is interleaved of two other strings | DP-33

Given three strings A, B and C. Write a function that checks whether C is an interleaving of A and B. C is said to… Read More »

## Remove “b” and “ac” from a given string

Given a string, eliminate all “b” and “ac” in the string, you have to replace them in-place, and you are only allowed to iterate over… Read More »

## Longest Common Substring | DP-29

Given two strings ‘X’ and ‘Y’, find the length of the longest common substring. Examples : Input : X = “GeeksforGeeks”, y = “GeeksQuiz” Output… Read More »

## Minimum insertions to form a palindrome | DP-28

Given a string str, the task is to find the minimum number of characters to be inserted to convert it to palindrome. Before we go… Read More »

## Karatsuba algorithm for fast multiplication using Divide and Conquer algorithm

Given two binary strings that represent value of two integers, find the product of two strings. For example, if the first bit string is “1100”… Read More »

The atoi() function in C takes a string (which represents an integer) as an argument and returns its value of type int. So basically the… Read More »

## String matching where one string contains wildcard characters

Given two strings where first string may contain wild card characters and second string is a normal string. Write a function that returns true if… Read More »

## Counting Sort

Counting sort is a sorting technique based on keys between a specific range. It works by counting the number of objects having distinct key values… Read More »

## Generate n-bit Gray Codes

Given a number n, generate bit patterns from 0 to 2^n-1 such that successive patterns differ by one bit. Examples: Following is 2-bit sequence (n… Read More »

## Count words in a given string

Given a string, count number of words in it. The words are separated by following characters: space (‘ ‘) or new line (‘\n’) or tab… Read More »

## Write your own strcmp that ignores cases

Write a modified strcmp function which ignores cases and returns -1 if s1 < s2, 0 if s1 = s2, else returns 1. For example,… Read More »

## Program to validate an IP address

Write a program to Validate an IPv4 Address. According to Wikipedia, IPv4 addresses are canonically represented in dot-decimal notation, which consists of four decimal numbers,… Read More »

## Facebook Interview | Set 1

I am a final year student of IIT Guwahati and the first phase of placements has just finished at our college. I was recruited by… Read More »