String Manipulation Interview Questions
- 0of 0 votes
AnswersImplement anagram. Eg: eitx is anagram to xite.
- Krish March 09, 2011
ie - Same letters, order changed.| Report Duplicate | Flag | PURGE
NetApp Software Engineer / Developer C String Manipulation - 0of 0 votes
AnswersImplement strcpy function.
- Krish March 09, 2011| Report Duplicate | Flag | PURGE
NetApp Software Engineer / Developer C String Manipulation - 0of 0 votes
AnswersCheck if two given strings are anagrams?
- CGB (2nd Telephone Interview) February 14, 2011| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer String Manipulation - 0of 0 votes
AnswersReverse a string as per the words, not the entire reverse. eg; "I am Sam" --> "Sam am I"
- GBC February 04, 2011| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer String Manipulation - 0of 0 votes
AnswersBar Raiser : Determine all non concentric palindromes in a String.
- GP January 15, 2011| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer String Manipulation - 0of 0 votes
AnswersI was asked this question in a recent interview...could somebody tell me how to solve this one...
- Vercetti December 31, 2010
write a function which sorts an array of strings based on their reversed representation.
(Reversed representation means a string in reverse order: foobar => raboof)
Example: ["xxxB", "yyyC", "zzzA"] => ["zzzA", "xxxB", "yyyC"]
Note: The strings are not reversed in the result. They're just sorted based on their reversed representation.| Report Duplicate | Flag | PURGE
String Manipulation - 0of 0 votes
AnswersWrite a function which determines whether provided string matches specified pattern. Signature:
- Max December 25, 2010
bool is_match(char* text, char* pattern)
Pattern can contain any characters + '*' character which means zero or more characters. For example: is_match("hello", "h*o") returns true; is_match("hello", "hel*lo") also returns true.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer String Manipulation - 0of 0 votes
AnswersConvert an ASCII representation of a positive integer to it's numeric value
- JL December 14, 2010| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer String Manipulation - 0of 0 votes
AnswersReplace all single occurrences of "a" with "the" (See question posted by Troy on Oct 7 2010)
- Guest December 06, 2010| Report Duplicate | Flag | PURGE
Epic Systems Software Engineer / Developer String Manipulation - 0of 0 votes
AnswersSuppose one string is "hello everyone" and another string is "everyone is good", then resultant string should return "hello everyone is good".. One "everyone" should be omitted in resultant string.
- Anshuman November 19, 2010| Report Duplicate | Flag | PURGE
String Manipulation - 0of 0 votes
AnswerWrite an algorithm to convert string "1234.56" to its float equivalent.
Solution:
- Rahul Telang November 02, 2010using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace MSIntervewPreparation { class ConvertStringToFloat { static void Main(string[] args) { string str = "1234.56"; float num = 0.0F; float multiplier = 0.1F; bool isDecimalReached = false; for (int i = 0; i < str.Length; i++) { if (str[i] == '.') { isDecimalReached = true; continue; } if (!isDecimalReached) { num = (num * 10) + (str[i] - '0'); } else { num += (str[i] - '0') * multiplier; multiplier *= 0.1F; } } Console.WriteLine("Input String: " + str); Console.WriteLine("Float Number: {0} ", num); } } }
| Report Duplicate | Flag | PURGE
HCL America Solutions Architect String Manipulation - 0of 0 votes
AnswersWrite a function to convert "1234.56" into its float equivalent.
Solution:
- Rahul Telang November 02, 2010using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace MSIntervewPreparation { class ConvertStringToFloat { static void Main1(string[] args) { string str = "1234.56"; float num = 0.0F; float multiplier = 0.1F; bool isDecimalReached = false; for (int i = 0; i < str.Length; i++) { if (str[i] == '.') { isDecimalReached = true; continue; } if (!isDecimalReached) { num = (num * 10) + (str[i] - '0'); } else { num += (str[i] - '0') * multiplier; multiplier *= 0.1F; } } Console.WriteLine("Input String: " + str); Console.WriteLine("Float Number: {0} ", num); } } }
| Report Duplicate | Flag | PURGE
HCL America Solutions Architect String Manipulation - 0of 0 votes
AnswersGiven a string...replace all occurances of a with the.
- Troy October 07, 2010
eg. A quick brown fox jumped over a bridge on a box.
should change to
The quick brown fox jumped over the bridge on the box.
You cannot use the inbuilt replace function for string manipulation.| Report Duplicate | Flag | PURGE
Epic Systems Software Engineer / Developer String Manipulation - 0of 0 votes
AnswersHow to find the longest palindrome is a string
- Anonymous October 01, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test String Manipulation - 0of 0 votes
AnswersReverse a string using only bitwise operators and without temporary storage.
- KoolTea September 14, 2010| Report Duplicate | Flag | PURGE
Knoa Software Software Engineer / Developer String Manipulation - 0of 0 votes
AnswersWrite a program to find if a string is a palindrome e.g aabbcbbaa?
- Jig August 10, 2010| Report Duplicate | Flag | PURGE
Goldman Sachs Software Engineer / Developer String Manipulation - 0of 0 votes
AnswersGiven a book find out the number of times each word appeared. Upon clarification I was told the following things 1. punctuations should be removed 2. case sensitive 3. assume book is given as a huge string to the function prototype 4. Words need not be ordered in any way
- prolific.coder July 13, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test String Manipulation - 0of 0 votes
Answers
- Paladin June 09, 2010int CutNPaste(char* str, int start, int stop, int destination)
| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test String Manipulation - 0of 0 votes
Answerswrite a code for which input is a string and set of characters acting as delimiters. Cut the given string where ever delimiters occur and return all the set of sub strings. For eg: given string abbcdeffghujsb and delimiter set:c,g,j
- Mr. XYZ May 10, 2010
then output should be: abb, deff, u, sb| Report Duplicate | Flag | PURGE
Microsoft Program Manager String Manipulation - 0of 0 votes
AnswersGiven a unix path Eg: a/b/../c
- Karthik May 07, 2010
Write a C code to fetch the output as
a/c.
i.e a is the root directory . cd d gives a/b. and cd.. goes to parent directory a. and again cd c . so the output shld be a/c| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer String Manipulation - 0of 0 votes
AnswerWhat is a StringBuffer and why do you use it?
- Sourabh Kapoor April 12, 2010| Report Duplicate | Flag | PURGE
Research In Motion Software Engineer / Developer String Manipulation - 0of 0 votes
AnswersReverse a string in Java. Iterative and Recursive fns advs and dis advs.
- Anonymous April 07, 2010| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer String Manipulation - 0of 0 votes
AnswersYou have a string which stores a number with commas. For example, a string that has the number 345,000,000. How will you manipulate this string in-place [without using any extra memory] so that the output is the original string without any commas in O(n) ?
- Bandicoot April 02, 2010| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Algorithm Arrays C Coding String Manipulation - 0of 0 votes
Answers1st Phone screen:
- dmelloleslie March 28, 2010
Given a series A,B,C .......Z, AA, AB,AC,AD....AZ,BA,BB...BZ,CA....(Open excel sheet. The names of column represent the series). Given input as number 'n'. Output the 'n' th string of the series.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer String Manipulation - 0of 0 votes
Answersimplement atoi
- mojo dojo :) March 19, 2010| Report Duplicate | Flag | PURGE
Apple Software Engineer / Developer String Manipulation - 0of 0 votes
AnswersDesign a game: which transform a word to a target word. for example: from head to tail, each step, you just can replace one character, and the word must be valid.
- myanything February 02, 2010| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer String Manipulation