Topic — Add New » Posts Last Poster Freshness
Adobe Interview Question for Software Engineer/Developer (Fresher) about Strings 4 Abhimanyu Vohra 2 months

Remove Repeated Characters in a string in a language of 2^40 characters

Adobe
Repetition of occurences 2 laddoo 2 months

Print each character and no. of consecutive repetitions of that character in a string
for eg. input: aabbcbaeeez
ouput : a2b2cbae3z

GIve a regular Expression 1 dbpradeep 3 months

Give a regular expression to validate the input in a textarea (in javascript) such that:
1. there should be minimum 3 characters
2. the first character is always /
3. the entire string shouldnot match the exact string '/abc' and '/xyz' but it can be anyother like /abce or /abcmn etc...

A puzzle from Interview Street 2 geek4u 3 months

Anyone can give a hint? Thanks.

Given a string consisting of a,b and c's, we can perform the following operation: Take any two adjacent distinct characters and replace it with the third character. For example, if 'a' and 'c' are adjacent, they can replaced with 'b'. What is the smallest string which can result by applying this operation repeatedly?

Input:
The first line contains the number of test cases T. T test cases follow. Each case contains the string you start with.<...

Given two strings print whether they are anagrams 2 geek4u 3 months

The basic idea is to sort both the strings and then to compare each letter in the character array.

int IsAnagram(char *a, char *b)
{
    int len1=strlen(a);
    int len2=strlen(b);
    if (len1 != len2)
    {
        return false;
    }
    int *array_a = malloc(sizeof(int)*(len1+1));
    int *array_b = malloc(sizeof(int)*(len2+1));
    for (int i = 0; i < len1; i++)
    {
        array_a[i] = a[i] - '0';
        array_b[i] = b[i] - '0';
    }

    m_sort(array_a, 0,len1);
    m_s...
[closed] Google Interview Question for Software Engineer/Developer about Strings 10 geeksforgeeks 3 months

Three strings say A,B,C are given to you. Check weather 3rd string is interleaved from string A and B.

Ex: A="abcd" B="xyz" C="axybczd". answer is yes.

Google
[closed] amazon Interview Question for Software Engineer/Developer (Fresher) about Strings 9 PsychoCoder 3 months

Given two strings find the combination of strings which can be interleave
i/p: if "AB" and "CD" are two strings
o/p:
ABCD
ACBD
ACDB
ACBD
CABD
CDAB

how to implement it in C..

Amazon
Amazon Interview Question for Software Engineer/Developer about Strings 4 PsychoCoder 3 months

Print all the substrings of a given string. Is there any solution better than O(2^n).

Eg: abc the possible substrings are {"a","b","c","ab","bc","abc}

Amazon
[closed] Printing all repeated combination of given lengthof a string 4 geeksforgeeks 3 months

This is a Question asked by Amazon during Written test....

The Question is like you have to print all possible combination of a given length let's say 'k' of a string in lexicographic order.
for Example:- input String=az k=2;
output
aa

az

za

zz..

thanks to vivek providing this solution
char op[k];
void printllex(char *s, int k,int n)
{

  int i;
  for(i=0;i<strlen(s);i++)
  {
        op[n]=s[i]
        if(n==k)
...
Amazon Interview Question for Software Engineer/Developer (0 - 2 Years) 3 PsychoCoder 3 months

You are given a function printMostFrequentWords which takes in an array of strings. You are required to print a list of all the letters that occurred with the highest frequency in each line of the array, followed by the frequency.
The list of letters should be an alphabetical list of upper case letters followed by an alphabetical list of lower case letters.
Sample Test Cases:

Input #00:
When riding your bicycle backwards down a one-way street, if the
wheel fall...

Amazon
Permutations of a string without repeatition 9 agrawal25 3 months

How to find all the permutations of a string such that two equal permutations appear only once.
That is all permutations should be unique

Microsoft Interview Question for Software Engineer/Developer (Fresher) about Strings 4 agrawal25 3 months

Given a string in hex, convert it into int. Write test cases for the same.

Microsoft
Google Interview Question for Software Engineer/Developer about Algorithms, Strings 8 4 months

Given a string containing multiple words such that spaces between words is missing. Also, you have a dictionary containing valid words.

Ex. "Thatwouldbefantastic"

Output a string with proper spaces inserted.

Output - "That would be fantastic"

The case of words like bandwidth present can be discounted.

Google
Microsoft Interview Question for Software Engineer/Developer (Fresher) about Strings 3 guru raj 4 months

Write a function to check if the two passed strings are anagrams of each other.

Microsoft
Amazon Interview Question for Software Engineer/Developer about Strings 10 gaurav 4 months

Given a string consisting of a, b and c's, we can perform the following operation: Take any two adjacent distinct characters and replace it with the third character. For example, if 'a' and 'c' are adjacent, they can replaced with 'b'.

What is the smallest string which can result by applying this operation repeatedly?

Amazon
Microsoft Interview Question for Software Engineer/Developer (Fresher) about Strings 1 jyoti 4 months

We want to implement the functions allocstring, freestring, concatestring, and stringlength. We need to optimize the functions in this order : stringlength, allocstring, freestring, concatestring, with stringlength requiring the most optimizations. We are also given that the memory consists of a buffer of fixed size. We have to design and describe a data structure which would enable the above operations to be performed in an efficient manner.

Microsoft
string reverse 6 aks 4 months

c program for sting statement reversing order to display.

ex.
input:
have a nice day.
output:
day nice a have.