is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
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.
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.
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.
<pre lang="" line="1" title="CodeMonkey59664" class="run-this">import java.util.HashMap;
- srav44 June 25, 2011import java.util.Map;
import java.util.Stack;
public class WellFormedString {
static Map<Character, Character> map = new HashMap<Character, Character>();
static {
map.put(']', '[');
map.put('}', '{');
map.put(')', '(');
}
public static void main(String[] args) {
System.out.println(isWellFormed("(}"));
}
public static boolean isWellFormed(String input) {
if (input == null)
return true;
if (input.length() == 0)
return true;
Stack<Character> stack = new Stack<Character>();
for (int i = 0; i < input.length(); ++i) {
char temp = input.charAt(i);
if ((temp == '[') || (temp == '{') || (temp == '('))
stack.push(temp);
if ((temp == ']') || (temp == '}') || (temp == ')')) {
if (stack.isEmpty())
return false;
if (map.get(temp) != stack.pop())
return false;
}
}
if (!stack.isEmpty())
return false;
return true;
}
}
</pre><pre title="CodeMonkey59664" input="yes">
</pre>