String Manipulation Interview Questions
- 2of 2 votes
AnswersRound 1 :
- sonesh January 03, 2013 in India
Q 2 : longest palindrome in a string ? (Need to tell in O(n) time complexity + O(1) space complexity)| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm Coding Dynamic Programming String Manipulation - 1of 1 vote
AnswersReverse words in a string
- Muqthi December 02, 2012 in India
Ex:
Input : "This is a String"
Output: "String a is This"| Report Duplicate | Flag | PURGE
Groupon Software Engineer / Developer String Manipulation - 0of 0 votes
Answersgive a string as a input(string should be one word)if the input string is multiple by 3 then print only the multiple of 3rd letter in the string, otherwise print the input. For eg: if input is Elephant, then print Elephant .
- dineshsuvendiran October 19, 2012 in India for 1
if input is Elephants then print eas.| Report Duplicate | Flag | PURGE
SynCfusion Applications Developer String Manipulation - 0of 0 votes
AnswersWrite a C function to remove all spaces from a string.
- CodeSpace October 03, 2012 in United States
Follow-up question: Explain the space and time efficiency of your solution.| Report Duplicate | Flag | PURGE
Apple Software Engineer / Developer String Manipulation - 0of 0 votes
AnswersWrite a function called reverseReplace that takes three arguments. The first will be a string of many words, the second will be a single word that we are going to search for, and the third and final will be the string we want to replace the second word with. Example output:
reverseReplace("I like cats", "cats", "dogs") -> "dogs like I" reverseReplace("I like cats", "mice", "dogs") -> "cats like I"
You should test it against the examples above as well as a larger test suite.
- anonymouse September 18, 2012 in United States| Report Duplicate | Flag | PURGE
SignPost Software Engineer / Developer String Manipulation - 0of 0 votes
Answersgiven s string "1010101010" in base2 convert it into string with base4.not use extra space....
- abhishek September 09, 2012 in India for idc| Report Duplicate | Flag | PURGE
Microsoft Intern String Manipulation - 0of 0 votes
AnswersGiven a stream of text eg you can read 1 char at a time, write fn that will return true if you can find a string str is in the stream before the stream runs out.Do not store the stream.
- grave August 05, 2012 in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm String Manipulation - 0of 0 votes
AnswersTokenize the given string.
- grave July 16, 2012 in India for kindle
node* strtok(char* input ,char* delims)
Put the words seperated into the linked list and return the linked list.delims can be a single character or group of characters like "abc".
Dictate the code as you write.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm Coding String Manipulation - 5of 5 votes
AnswersGiven two strings .Print all the interleavings of the two strings.
- grave July 10, 2012 in India
Interleaving means that the if B comes after A .It should also come after A in the interleaved string.
ex-
AB and CD
ABCD
ACBD
ACDB
CABD
CADB
CDAB| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm String Manipulation - 0of 0 votes
AnswersGiven some string lexical order and you don't know which language these characters. How to find find the order of the characters.
- Praveen June 18, 2012 in India| Report Duplicate | Flag | PURGE
String Manipulation - 0of 0 votes
Answersregular expression matching: given a regular expression just composed with letters and *, whether a string str can be generated by the regular expression? for example, regular expression a*b*c , the string aabaabc cann't be generated by the regular expression.
- Red Lv April 09, 2012 in China for STC| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer String Manipulation - 0of 0 votes
AnswersGiven a string, find the substring with minimum length from it which contains exactly equal no of characters given in a hashmap which contains key as character and values as count of character needed in substring.
- Code_It April 01, 2012 in India
For example:
String str ="abcrefbda";
map = {{"b"=1},{"d"=1"},{"a"=1}};
Output = "bda";| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer String Manipulation - 0of 0 votes
AnswersMS written test:
- vikdp01 March 25, 2012 in India
Given a list of words and a dictionary with many words. The dictionary may or may not include the the given list of words.
From the given list of words,you need to print only those words which are present in dictionary.
Mention time complexity.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer String Manipulation - -2of 2 votes
AnswersMS written test:
- vikdp01 March 25, 2012 in India
STRINGZ = STRINGX + STRINGY.charAt(index) ,
How can it be done using C language.
Also, I want to add a character in each function call.
e.g.
FUNC(mainstr,"");
FUNC(char *mainstr, char *current)
{
if(index==strlen(mainstr))
print("%s",current);
else
for(int i=0; i<strlen(mainstr) ; i++)
{
FUNC(mainstr, current+mainstr.charAt(i))
}
}
//replace current+mainstr.charAt(i) with C functions and code ..| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer String Manipulation - -1of 1 vote
AnswersGiven a list of strings, Print all possible letter strings in sorted order.
- vikdp01 March 23, 2012 in India
Remember that the characters in each string are sorted.
Sample I/P:
YZ
ABCD
DEF
O/P:
ADY
ADZ
AEY
AEZ
AFY
AFZ
BDY
BDZ
BEY
BEZ
BFY
BFZ
CDY
CDZ
CEY
CEZ
CFY
CFZ| Report Duplicate | Flag | PURGE
String Manipulation - 0of 0 votes
AnswersWrite function compress(char* strSource)
- Interviews January 29, 2012 in India
it should do the following .
repeating chars in sequence should be replaced with char & count, in case count is 1 no need to add any integer.
Example - AAAABBBCXYZEEEEPPPPPKKABC
should be A4B3CXYZE4P5K2ABC.
you are supposed to iterate the array only once, and modify the same input parameter, do not create any new string.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer String Manipulation - 0of 0 votes
Answerswrite a function strRemove(char *source, char *remove )
- Interviews January 29, 2012 in India
This function will delete all the chars that exist in string remove from array source, number of iteration should be only 1. Make the searching efficient.
Example
("amazon development center", "aenr")
"mzo dvlpmt ct".
Criteria - First parameter should be modified , no need to create an extra string.
(Answer - Put the second array in a hash table, like array of 256 chars, to search which are the chars needed to be removed with complexity o(1) )| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer String Manipulation - 0of 0 votes
AnswersYou have n strings with their lengths. You are given an add(string s1,string s2) which would concatenate the string s2 with s1 and return s3. Optimize the cost of concatenation of all these strings into one big string.
- manjunath426jc December 26, 2011 in India
Ex: 1,3,2 are the lengths of given strings.
1+3=4
4+2=6
total cost=10
Optimize this total cost?| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer String Manipulation - 0of 0 votes
AnswersRemove duplicates from string given " bananas " Return "bans"
- rams December 17, 2011 in India
Write code for both O(n) and O(n2) solutions| Report Duplicate | Flag | PURGE
Amazon String Manipulation - 0of 0 votes
AnswersThe string "PAYPAL IS HIRING" is written in a zigzag pattern on a given
- vin543 December 05, 2011 in United States
number of rows like this: (you may want to display this pattern in a
fixed font for better legibility)
P A H N
A P L S I I G
Y I R
And then read line by line: PAHNAPLSIIGYIR
Write the code that will take a string and make this conversion given a
number of rows:
String convert(String text, int nRows);
convert("paypalishiring", 3) should return "pahnaplsiigyir"| Report Duplicate | Flag | PURGE
String Manipulation - 1of 1 vote
AnswersFind the substring of length 3 which is present in the reverse order from the string.
- swethas17 November 22, 2011 in United States
Ex: if the string is abcdcba (cba is the reverse of abc) so we should return cba.
And was asked to improve upon the complexity.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer String Manipulation - 0of 0 votes
AnswersWrite a function that takes in two arguments, a string and a list of delimiters and gives the output as a list of string seperated by the delimiters where each word takes one space in the list. For example: if string is "How are you, Mr. X?" and list of delimiters is {space, comma, dot} the output would be:
- varuntheknight November 12, 2011 in United States
How|are|you|Mr|X?| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer String Manipulation - 0of 0 votes
AnswersQuestion on printing the string equivalent of an integer number
- ashishdaga1 November 08, 2011 in United States for General| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer String Manipulation - 0of 0 votes
Answerscheck if two strings are anagrams or not
- Avinash October 15, 2011 in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer String Manipulation - 0of 0 votes
AnswersFind if the given string is palindrome. Eg. palindrome string "..AB ,, CD, ED. CB...A...". No extra buffer available.
- takiisc October 08, 2011 in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer String Manipulation - 0of 0 votes
AnswersHow to replace the space in the string with "ABC" without using extra memory.. string may contain some extra memory.
- sekhar740 September 23, 2011 in India
str = "i am chandu" -- str contation more memory...
str = "iABCamABCchandu"| Report Duplicate | Flag | PURGE
Salesforce Developer Program Engineer String Manipulation - 0of 0 votes
AnswersImplement a function that performs binary addition. Input to the function is two const strings. The function returns a string that holds the result of addition.
- Jobseeker August 24, 2011
char* binaryadd(const char* a, const char* b) { }
Eg. "1001"+"101"="1110"| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm Bit Manipulation C Coding String Manipulation - 0of 0 votes
AnswersGiven a large string . then you have to find out largest string such that all its character are consecutive . Asked me to write a neat C code for this problem.
- dheeraj2311 August 06, 2011| Report Duplicate | Flag | PURGE
Adobe Software Engineer / Developer String Manipulation - 0of 0 votes
AnswersAd Center SDET interview always asks
- masak July 26, 2011
Regular expression problems
Implement a lexical analyzer
Input string - a C program with Comments
Output- the input C program string without comments| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test String Manipulation - 1of 1 vote
Answersfind if 2 strings are anagrams of each other
- Abhi April 15, 2011| Report Duplicate | Flag | PURGE
NVIDIA Software Engineer / Developer String Manipulation