## 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 »

- Find the first maximum length even word from a string
- Repeated Character Whose First Appearance is Leftmost
- Count common characters in two strings
- Find the longest string that can be made up of other strings from the array
- Count substrings that contain all vowels | SET 2
- Convert character array to string in C++
- Check whether two strings contain same characters in same order
- Check for balanced parentheses in an expression | O(1) space | O(N^2) time complexity
- Count of integers of length N and value less than K such that they contain digits only from the given set
- Program to find the kth character after decrypting a string
- Generate all permutations of a string that follow given constraints
- Minimum number of times A has to be repeated such that B is a substring of it
- Minimum length substring with exactly K distinct characters
- Rearrange characters in a string such that no two adjacent are same using hashing
- Maximize the happiness of the groups on the Trip
- Check if two strings are same ignoring their cases
- Distinct palindromic sub-strings of the given string using Dynamic Programming
- Find the number of binary strings of length N with at least 3 consecutive 1s
- Print the longest prefix of the given string which is also the suffix of the same string
- Count pairs of non-overlapping palindromic sub-strings of the given string
- Program to generate all possible valid IP addresses from given string | Set 2
- Minimum rotations required to get the same String | Set-2
- Minimum number of adjacent swaps to convert a string into its given anagram
- Minimum steps to delete a string by deleting substring comprising of same characters
- Find k-th character of decrypted string | Set - 2
- Append a digit in the end to make the number equal to the length of the remaining string
- Check if a string can be obtained by rotating another string d places
- Count of substrings which contains a given character K times
- Optimally accommodate 0s and 1s from a Binary String into K buckets
- Minimum number of bracket reversals needed to make an expression balanced | Set - 2

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 »

Given an array of words, print all anagrams together. For example, if the given array is {“cat”, “dog”, “tac”, “god”, “act”}, then output may be… Read More »

Given a string, find the longest substring which is palindrome. For example, if the given string is “forgeeksskeegfor”, the output should be “geeksskeeg”. Recommended: Please… Read More »

Given a string, move all even positioned elements to end of string. While moving elements, keep the relative order of all even positioned and odd… Read More »

Given a string, print all permutations of it in sorted order. For example, if the input string is “ABC”, then output should be “ABC, ACB,… Read More »

Given a string, find its rank among all its permutations sorted lexicographically. For example, rank of “abc” is 1, rank of “acb” is 2, and… Read More »

Given a number, find the next smallest palindrome larger than this number. For example, if the input number is “2 3 5 4 5”, the… Read More »

Given a string, a partitioning of the string is a palindrome partitioning if every substring of the partition is a palindrome. For example, “aba|b|bbabb|a|b|aba” is… Read More »

Pattern searching is an important problem in computer science. When we do search for a string in notepad/word file or browser or database, pattern searching… Read More »

Given a sequence, find the length of the longest palindromic subsequence in it. As another example, if the given sequence is “BBABCBCAB”, then the output… Read More »

Write a function to check whether two given strings are anagram of each other or not. An anagram of a string is another string that… Read More »

Given three strings A, B and C. Write a function that checks whether C is an interleaving of A and B. It may be assumed… Read More »

Given two strings str1 and str2, write a function that prints all interleavings of the given two strings. You may assume that all characters in… Read More »