Palantir Technology Interview Question for Software Engineers


Country: United States
Interview Type: Phone Interview




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

I guess I asked him many times If my understanding is correct as the problem looked really simple . And even after solving , I asked for feedback and he said he was fine with the solution. , he asked me to design another class for multiplication and I did using abstract class.
Overall I felt I did well , but got a rejection mail in an hour .

- akii March 03, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

This is a horrible interview question.
evaluate what exactly? There is nothing to evaluate.
And if the example is what was given by the interviewer then the question itself has flaws.

The example implies that W = 6
ONE+TWO = THREE
How can ('O' = 2) + ('T' = 4) = 'T'? In this case 2+4 = 6 which would be 'W'

How can
FOUR +FOUR = EIGHT?

Again you have ('O' = 2) + ('O' = 2) = 4 which equals to 'T' and not 'I' or 'G'

- Alex March 03, 2015 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

//The complete code
public interface Expression { 
	public Set<Character> getChars(String in); 
	public boolean eval(Map <Character, Integer> c); 
}

public class ExpressVerify implements Expression{
	
	Map<Character, Integer> maps=new HashMap<Character,Integer>();
	String operand1;
	String operand2;
	String result;
	public Set<Character> getChars(String in)
	{
		Set<Character> vs=new LinkedHashSet<Character>();
		for(int i=0;i<in.length();i++)
			vs.add(in.charAt(i));		
		return vs;
	}
	
	int get_addition(int val1,int val2)
	{
		return val1+val2;
	}
	int getValue(String in1, Map<Character,Integer> maps)
	{
		Set<Character> v= new LinkedHashSet<Character>();
		v= getChars(in1);
		Iterator<Character> it=v.iterator();
		int j=v.size()-1;
		int sum=0;
		while(it.hasNext())
		{
			Character a=it.next();
			System.out.print(a);
			if (maps.containsKey(a)){
				int val= maps.get(a);
				sum+=val*Math.pow(10.0, (double)j);
			}
			else
				sum+=0;
			j--;
		}
		System.out.println(sum);
		return sum;
	}
	public boolean eval(Map <Character, Integer> c)
	{
		int res=get_addition(getValue(operand1,c),getValue(operand2,c));
		
		if (res==getValue(result,c))
			return true;
		else 
			return false;
	}
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		ExpressVerify ev= new ExpressVerify(); 
		
		ev.maps.put('O', 2);
		ev.maps.put('N', 3);
		ev.maps.put('E', 1);
		ev.maps.put('T', 4);
		ev.maps.put('W', 6);
		ev.operand1="ONE";
		ev.operand2="ONE";
		ev.result="TWO";
		System.out.println(ev.eval(ev.maps));
		System.out.println(ev.maps.values());
	}

}

- Ratul_FIU March 14, 2015 | 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