Google Interview Question for Software Engineer / Developers






Comment hidden because of low score. Click to expand.
1
of 1 vote

Using a stack for each word and when a specific word comes like "to" "+" "-" "/" "%" "*"
or another conversion word according to the operation(for ex. if to comes pop the stack to times and use them in the conversion operation) we can handle the operation.
To give an example:

"56 F to C"

stack content

56
56 F
56 F to -> to is get and
F to C operation is known by the program
according to the conversion 56 is changed to C

- cac October 10, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

parse the string on the basis of space then each word should be parsed again...
Here one should have shortform of each unit...like F, C or km...

- Anonymous March 25, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

the algorithm involves a parser for sure, but what are the operations it should support???

- Anonymous March 28, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I think it's an open question. any operation you would like to see: +-*/^ sqrt, mod, km TO mile, etc...

- beyondfalcon April 23, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

lode k baal

- bond !!!!!! August 29, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Create a trie structure where each node can contain another trie. In the leaf node, an operation will be defined which takes in an input and returns an output.

Class TrieNode {
TrieNode nextNode;
Trie trie;
Operator op;
boolean isOperator;
}
Operator for C-F

public double CtoF(double degCelsius){
....
}

C*-[F*]
|
M*-[M-M*]

- biswajit July 17, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

trie

- Anonymous November 28, 2010 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More