<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Palantir Technologies</title>
	<atom:link href="http:///feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>Articles from the Engineering Group at Palantir Technologies</description>
	<lastBuildDate>Wed, 14 Dec 2011 17:48:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Introducing Palantir&#8217;s first open source releases</title>
		<link>http://blog.palantirtech.com/2011/12/14/introducing-palantirs-first-open-source-releases/</link>
		<comments>http://blog.palantirtech.com/2011/12/14/introducing-palantirs-first-open-source-releases/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 17:28:31 +0000</pubDate>
		<dc:creator>Ari Gesher</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[Java Links]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[palantir]]></category>
		<category><![CDATA[software engineering]]></category>
		<category><![CDATA[swing]]></category>

		<guid isPermaLink="false">https://wp-admin-techblog.yojoe.local/?p=1956</guid>
		<description><![CDATA[We&#8217;re big fans of open source. Libraries from Apache, Google, and various projects hosted on SourceForge.net make up a significant fraction of the third-party code we use to build our products. We&#8217;re proud to be making our first set of open source releases with these two projects: Cinch and Sysmon. We think it&#8217;s the right [...]]]></description>
			<content:encoded><![CDATA[<div style='float: left; text-align:right; margin-left:15px; margin-right: 20px; margin-bottom: 10px; margin-top: 10px;'><img src="/wp-content/uploads/2011/12/palantir-ptoss.png" alt="Palantir Technologies Open Source" title="Palantir Technologies Open Source" width='85px'/></div>
<p>We&#8217;re big fans of <a href="http://www.opensource.org/">open source</a>. Libraries from <a href="http://apache.org/">Apache</a>, <a href="https://code.google.com/p/guava-libraries/">Google</a>, and various projects hosted on <a href="http://sourceforge.net/">SourceForge.net</a> make up a significant fraction of the third-party code we use to build our products.</p>
<p>We&#8217;re proud to be making our first set of open source releases with these two projects: <a href="http://github.com/palantir/Cinch">Cinch</a> and <a href="http://github.com/palantir/Sysmon">Sysmon</a>.</p>
<p>We think it&#8217;s the right thing to do, to add our voice to the chorus of developers making software available to freely use, modify, and distribute. These two projects represent our first dip into the open source water &#8211; we&#8217;re just getting started.  As time and other interests allow, we&#8217;ll be making other projects available to the dev community.</p>
<p>We&#8217;ve chosen the <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a> to make our contributions as free from encumberance as possible &#8211; our hope is that many people will find them useful and build on top of them just as we have with our own software.</p>
<h2>The Projects</h2>
<div style='float: right; text-align:right; margin-left:15px; width: 253px;margin-bottom: 10px; margin-top: 10px'><img src="/wp-content/uploads/2011/12/cinch-screenshot.png" alt="code editor showing Cinch annotations" title="code editor showing Cinch annotations" width='233'/></div>
<h3><a href="http://github.com/palantir/Cinch">Cinch</a> &#8211; Cinch makes <a href="https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller">MVC</a> in Swing easy</h3>
<p>Cinch is a Java library for simplifying certain types of GUI code. When developing Swing applications it&#8217;s easy to fall into the trap of not separating out <a href="https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller">Models and Controllers</a>. It&#8217;s all too easy to just store the state of that boolean in the checkbox itself, or that String in the JTextField. The design goal behind Cinch was to make it easier to apply MVC than to not by reducing much of the typical Swing friction and boilerplate. Cinch uses Java annotations to reflectively wire up Models, Views, and Controllers.</p>
<p>Already in heavy use inside the Palantir Government product, Cinch changes GUI development in Java to be similar to iOS and OS X&#8217;s <a href="https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CocoaBindings/Concepts/WhatAreBindings.html#//apple_ref/doc/uid/20002372-CJBEJBHH">Cocoa, where annotations are used to bind controls to fields</a>.</p>
<div style='float: right; text-align:right; margin-left:15px; width: 253px'><img src="http://blog.palantir.com/wp-content/uploads/2009/02/monitoringserverscreenshot-badge.png" alt="Graph of CPU usage over time" title="Graph of CPU usage over time" width="233" height="188"/></div>
<h3><a href="http://github.com/palantir/Sysmon">Sysmon</a> &#8211; A lightweight platform monitoring tool for Java VMs</h3>
<p>Sysmon is a lightweight platform monitoring tool. It was designed to gather performance data (CPU, disks, network, etc.) from the host running the Java VM. This data is gathered, packaged, and published via Java Management Extensions (<a href="http://www.oracle.com/technetwork/java/javase/tech/javamanagement-140525.html">JMX</a>) for access using the JMX APIs and standard tools (such as <a href="http://download.oracle.com/javase/6/docs/technotes/guides/management/jconsole.html">jconsole</a>). Sysmon can be run as a standalone daemon or as a library to add platform monitoring to any application.   </p>
<p>Originally built as component in our <a href="http://blog.palantir.com/2009/02/23/palantir-monitoring-server-where-build-beats-buy/">Palantir cluster monitoring server</a>, this project should be helpful in scenarios where you need to get data off a host platform and into a VM.</p>
<h2>Let us know how we&#8217;re doing</h2>
<p>We&#8217;d love to hear from you on how we&#8217;re doing.  Aside from the normal outlets to communicate about the projects themselves (see the mailing lists and issue trackers for each project), please feel free to email me directly, <a href='mailto:agesher@palantir.com'>Ari Gesher</a>, as the curator of these projects.  </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.palantirtech.com/2011/12/14/introducing-palantirs-first-open-source-releases/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The UI Design Interview</title>
		<link>http://blog.palantirtech.com/2011/12/01/the-ui-design-interview/</link>
		<comments>http://blog.palantirtech.com/2011/12/01/the-ui-design-interview/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 17:24:37 +0000</pubDate>
		<dc:creator>bdwyer</dc:creator>
				<category><![CDATA[interviewing]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[user interface]]></category>

		<guid isPermaLink="false">https://wp-admin-techblog.yojoe.local/?p=1946</guid>
		<description><![CDATA[Comic courtesy of XKCD, via Creative Commons License Our frontend engineering candidates go through many of the same types of interviews as our backend candidates, i.e., algo and coding. But because they&#8217;ll be building the user-facing parts of our system, we want to make sure candidates have some design chops as well. Hence the UI [...]]]></description>
			<content:encoded><![CDATA[<div style='text-align: center'><a href='https://www.xkcd.com/722/'><img style='width: 100%' src='http://imgs.xkcd.com/comics/computer_problems.png' alt='Compiler design dependency comic, originally from http://www.xkcd.com/722/' title='Comic originally from http://www.xkcd.com/722/' /></a>
<div style='text-align: right; font-size: 0.6em; margin-bottom: 1em;'>Comic courtesy of <a href='http://www.xkcd.com/722/'>XKCD</a>, via Creative Commons License</div>
</div>
<p>Our frontend engineering <a href="http://www.palantir.com/careers/culture">candidates</a> go through many of the same types of interviews as our backend candidates, i.e., <a href="http://blog.palantir.com/2011/09/26/how-to-rock-an-algorithms-interview/">algo</a> and <a href="http://blog.palantir.com/2011/10/03/the-coding-interview/">coding</a>. But because they&#8217;ll be building the user-facing parts of our system, we want to make sure candidates have some design chops as well. Hence the UI design interview.</p>
<h2>Why have a design interview for an engineer?</h2>
<p>Perhaps my favorite part of being on the frontend team at Palantir is that we get to work on both the design and the implementation of our own UIs, from inception to finished product. Engineers collaborate on the design of the product with other engineers as well as with designers, and we openly debate the merits of all our decisions. The UI interview simulates this kind of cooperative design and debate. Typically, this means you&#8217;ll be asked to design and/or evaluate one or two pieces of UI during the interview, while your interviewer plays both collaborator and critic.</p>
<p>Read on for some helpful points to keep in mind as you work on a design problem with your interviewer.<br />
<span id="more-1946"></span></p>
<h2>It&#8217;s all about the user</h2>
<p>The user is the ultimate arbiter of success for any interface. If users can accomplish their tasks in a simple, efficient, intuitive way, then we&#8217;re doing our job right. Therefore, we must <strong>keep the user in mind</strong> at every stage of interface design.</p>
<p>One common mistake that you can make up front is to assume YOU are the user. Because working on a computer is a solitary activity, it&#8217;s easy to forget that everyone experiences an interface in a different way. Depending on what you&#8217;re designing, the user may be a complete novice or a seasoned sysadmin.</p>
<p>It&#8217;s important to <strong>imagine what your users are like</strong>. If it helps, give the user a name, age, and occupation. Ask yourself these questions:</p>
<ul>
<li>In what context will they use this feature? At work? At home? On a TV from 10 feet away?</li>
<li>Have they used a similar interface before?</li>
<li>How savvy are they with computers in general? Do they know how to copy and paste, drag and drop, or open a context menu?</li>
</ul>
<p>When designing a feature for the interface, walk the user through the feature. <strong>Make a rough sketch</strong> of the main components (buttons, lists, text blocks) on a whiteboard or sheet of paper. Then simulate how your user might interact with the feature, by drawing in their input and selections.</p>
<p>While sketching your proposed interface, <strong>put yourself in the user&#8217;s shoes.</strong> Ask yourself these questions:</p>
<ul>
<li>What will they be doing when they want to start doing X?</li>
<li>How do they discover the feature?</li>
<li>What will they want to do after?</li>
<li>How frequently will the user do X?</li>
<li>What if X fails to complete properly?</li>
</ul>
<p>and so on. Once you&#8217;ve asked yourself those questions, consider how the answers should impact your design and modify it accordingly.</p>
<p><strong>tl;dr: The user is paramount. Each of your decisions should be justified by its impact on the user.</strong></p>
<h2>The interview is highly interactive</h2>
<p>Some candidates are reluctant to contradict the interviewer or provide alternative ideas. We want the opposite. If you have a good idea, <strong>advocate for your position.</strong> I prefer candidates who will contradict me, as long as they back up their ideas with arguments, stories, or examples. The more you can articulate the reason for your beliefs, the better.</p>
<p>Go ahead and keep throwing ideas out there. I&#8217;ll shoot down some of them, but don&#8217;t be daunted. It may take 10 ideas before we discover a gem. (This is how all design works, not just in an interview setting.)</p>
<h2>Be creative, but don&#8217;t re-invent the wheel</h2>
<p>I&#8217;ve seen many candidates jump through incredibly awkward (albeit fancy) hoops just to display some very simple data. If you have a list of data, display it as a list. In general, being familiar with UI conventions is helpful because they encode a lot of hard-earned wisdom.</p>
<p>If you&#8217;ve created an interface that will enable the user to do their task as quickly and painlessly as possible, then stop. Don&#8217;t weigh down the interface with unnecessary features. As Deiter Rams famously said, <strong>&#8220;Good design is as little as possible.&#8221;</strong> This holds true for user interface design just as well as product design. Consider Alan Cooper&#8217;s rule of thumb, &#8220;A user will take as much time to make a choice as there are choices.&#8221; If a user is inundated with options and features, they find the interface more difficult to use. A simple, direct approach is frequently the best one.</p>
<p>If you want a quick and easy measure of the simplicity of a feature, just count the number of clicks to complete the task using your interface. If the user has to switch from mouse to keyboard, count that twice. </p>
<h2>How to prepare</h2>
<p>If you&#8217;ve done some design in the past, especially in a collaborative setting, just come and be yourself &mdash; you&#8217;ll do fine. But if you&#8217;re relatively inexperienced, here are some ways you can improve your design skills:</p>
<ol>
<li>If you&#8217;re still in school, <strong>take an HCI or infoviz course,</strong> especially a project-based course. This will give you some actual design experience, as well as a rich vocabulary and set of concepts for thinking about user interfaces.</li>
<li><strong>The design mindset is a muscle, so exercise it every chance you get.</strong> Constantly ask yourself, &#8220;How could this be different? How could it be better?&#8221; The more you ask yourself these questions, the more they&#8217;ll become unconscious and automatic. Soon you&#8217;ll be wondering about <a href="http://www.amazon.com/Design-Everyday-Things-Donald-Norman/dp/0385267746">the design of everyday things</a> &mdash; in the shower, on the train, and hopefully every time you interact with a piece of software. If you develop the skills to analyze other people&#8217;s designs, you&#8217;ll be able to apply those skills to your own own.</li>
<li><strong>Actually build something</strong> and pay attention to the UI. Go through more than one design before (tentatively) settling on the one you&#8217;re going to build. Draw wireframes and/or mockups. Iterate constantly, even after you think you&#8217;re done.</li>
<li><strong>Ask someone to critique your work.</strong> If you can find someone with an HCI background (or other design skills), she&#8217;ll show you things you couldn&#8217;t see yourself. Once this has happened a few times, you&#8217;ll start internalizing your critics; you&#8217;ll start asking yourself, &#8220;What am I missing here?&#8221; If you find someone who doesn&#8217;t have a design background, treat them like a user. This means taking their feedback very seriously but leaving some room for skepticism. Notoriously, <a href="http://uxmyths.com/post/746610684/myth-21-people-can-tell-you-what-they-want">users don&#8217;t always know what they want</a>.</li>
<li><strong>Read up on UI/UX/HCI/infoviz.</strong> There are a lot of good books and blogs out there. Some of the ones that we&#8217;ve found particularly helpful are <em>About Face</em> by <a href="https://twitter.com/#!/MrAlanCooper">Alan Cooper</a>, <em>Now You See It</em> by Stephen Few, and <em>Don&#8217;t Make Me Think</em> by Steve Krug.</li>
</ol>
<p>I hope this post will help you design better interfaces, and perhaps I&#8217;ll be <a href="http://www.palantir.com/careers/culture">working with you</a> soon!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.palantirtech.com/2011/12/01/the-ui-design-interview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Rock a Systems Design Interview</title>
		<link>http://blog.palantirtech.com/2011/10/28/how-to-rock-a-systems-design-interview/</link>
		<comments>http://blog.palantirtech.com/2011/10/28/how-to-rock-a-systems-design-interview/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 15:00:41 +0000</pubDate>
		<dc:creator>John Carrino</dc:creator>
				<category><![CDATA[development process]]></category>
		<category><![CDATA[enterprise engineering]]></category>
		<category><![CDATA[interviewing]]></category>
		<category><![CDATA[palantir]]></category>
		<category><![CDATA[softwarephilosophy]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">https://wp-admin-techblog.yojoe.local/?p=1937</guid>
		<description><![CDATA[Comic courtesy of XKCD, via Creative Commons License Note: this third installment in our series on doing your best in interviews. Previously: &#8220;How to Rock an Algorithms Interview&#8221; and &#8220;The Coding Interview&#8221;. One interview that candidates often struggle with is the systems design interview. Even if you know your algorithms and write clean code, that [...]]]></description>
			<content:encoded><![CDATA[<div style='text-align: center'><a href='https://www.xkcd.com/754/'><img style='width: 100%' src='/wp-content/uploads/2011/10/dependencies.png' alt='Compiler design dependency comic, originally from http://www.xkcd.com/754/' title='Comic originally from http://www.xkcd.com/754/' /></a>
<div style='text-align: right; font-size: 0.6em; margin-bottom: 1em;'>Comic courtesy of <a href='http://www.xkcd.com/754/'>XKCD</a>, via Creative Commons License</div>
</div>
<p>
<span style='font-size: 0.7em'><em>Note: this third installment in our series on doing your best in interviews.  Previously: <a href="/2011/09/26/how-to-rock-an-algorithms-interview/" title="How to Rock an Algorithms Interview" target="_blank">&#8220;How to Rock an Algorithms Interview&#8221;</a> and <a href="/2011/10/03/the-coding-interview/" title="The Coding Interview" target="_blank">&#8220;The Coding Interview&#8221;</a>.</em></span>
</p>
<p>One interview that candidates often struggle with is the systems design interview. Even if you know your algorithms and write clean code, that code needs to run on a computer somewhere &mdash; and then things quickly get complicated. A truly unbelievable amount of complexity lies beneath something as simple as <a href="https://plus.google.com/112218872649456413744/posts/dfydM2Cnepe">visiting Google in your browser</a>. While most of that complexity is abstracted away from the end user, as a system designer you have to face it head on, and the more you can handle, the better.</p>
<p>At Palantir, many of our teams give a systems design interview along with an <a href="http://blog.palantir.com/2011/09/26/how-to-rock-an-algorithms-interview/">algorithms interview</a> and a couple of <a href="http://blog.palantir.com/2011/10/03/the-coding-interview/">coding interviews</a>. We don’t expect anyone to be an expert at all three disciplines (although some are). We’re looking for generalists with depth &mdash; people who are good at most things, and great at some. If systems design isn&#8217;t your strength, that’s okay, but you should at least be able to talk and reason competently about a complex system.</p>
<p>Read on to learn about what we&#8217;re looking for and how you can prepare.</p>
<p><span id="more-1937"></span></p>
<h2>We’re measuring three things</h2>
<p>Nominally, this interview appears to require knowledge of <strong>systems</strong> and a knack for <strong>design</strong> &mdash; and it does. What makes it interesting, though, and sets it apart from a coding or an algorithms interview, is that whatever solution you come up with during the interview is just a side effect. What we actually care about is the process. </p>
<p>In other words, the systems design interview is all about <strong>communication</strong>. </p>
<p>This reflects what actually working at Palantir is like. As engineers we have a tremendous amount of freedom. We aren’t asked to implement fully-specced features. Instead we take ownership of <em>open-ended problems</em>, and it’s our job to come up with the best solution to each. We need people we can trust to do the right thing without a lot of supervision &mdash; people who can own large projects and take them consistently in the right direction. Invariably, this means being able to communicate effectively with the people around you. Working on <a href="http://blog.palantir.com/2009/11/06/palantir-like-an-operating-system-for-data-analysis/">problems with huge scope</a> isn&#8217;t something you can do in a vacuum.</p>
<h2>It&#8217;s an open-ended conversation</h2>
<p>Usually we’ll start by asking you to design a system that performs a given task. The prompt will be simple, but don’t be fooled &mdash; these problems are wide and bottomless, and the point of the interview is to see how much volume you can cover in 45 minutes.</p>
<p>For the most part, you’ll be steering the conversation. It’s up to you to understand the problem. That might mean asking questions, sketching diagrams on the board, and bouncing ideas off your interviewer. Do you know the constraints? What kind of inputs does your system need to handle? You have to get a sense for the scope of the problem before you start exploring the space of possible solutions. And remember, there is no single right answer to a real-world problem. Everything is a tradeoff.</p>
<h2>Topics</h2>
<p>Systems are complex, and when you’re designing a system you’re grappling with its full complexity. Given this, there are many topics you should be familiar with, such as:</p>
<ul>
<li><b>Concurrency.</b> Do you understand threads, deadlock, and starvation? Do you know how to parallelize algorithms? Do you understand consistency and coherence?</li>
<li><b>Networking.</b> Do you roughly understand <a href='https://secure.wikimedia.org/wikipedia/en/wiki/Inter-process_communication'>IPC</a> and <a href='https://secure.wikimedia.org/wikipedia/en/wiki/Internet_Protocol_Suite'>TCP/IP</a>? Do you know the difference between throughput and latency, and when each is the relevant factor?</li>
<li><b>Abstraction.</b> You should understand the systems you’re building upon. Do you know roughly how an OS, file system, and database work? Do you know about the various levels of caching in a modern OS?</li>
<li><b>Real-World Performance.</b> You should be familiar with the <a href="http://everythingisdata.wordpress.com/2009/10/17/numbers-everyone-should-know/">speed of everything</a> your computer can do, including the relative performance of RAM, disk, SSD and your network.
<li><b>Estimation.</b> Estimation, especially in the form of a back-of-the-envelope calculation, is important because it helps you narrow down the list of possible solutions to only the ones that are feasible. Then you have only a few prototypes or micro-benchmarks to write.</li>
<li><b>Availability and Reliability.</b> Are you thinking about how things can fail, especially in a <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Fallacies_of_Distributed_Computing">distributed environment</a>? Do know how to design a system to cope with network failures? Do you understand durability?</li>
</ul>
<p>Remember, we&#8217;re not looking for mastery of all these topics. We&#8217;re looking for <em>familiarity</em>. We just want to make sure you have a good lay of the land, so you know which questions to ask and when to consult an expert.</p>
<h2>How to prepare</h2>
<p>How do you get better at something? If your answer isn’t along the lines of &#8220;practice&#8221; or &#8220;hard work,&#8221; then I have a bridge to sell you. Just like you have to write a lot of code to get better at coding and do a lot of drills to get really good at basketball, you’ll need practice to get better at design. Here are some activities that can help:</p>
<ul>
<li><strong>Do mock design sessions.</strong> Grab an empty room and a fellow engineer, and ask her to give you a design problem, preferably related to something she&#8217;s worked on. Don&#8217;t think of it as an interview &mdash; just try to come up with the best solution you can. Design interviews are similar to actual design sessions, so getting better at one will make you better at the other.</li>
<li><strong>Work on an actual system</strong>. Contribute to OSS or build something with a friend. Treat your class projects as more than just academic exercises &mdash; actually focus on the architecture and the tradeoffs behind each decision. As with most things, the best way to learn is by doing.</li>
<li><strong>Do back-of-the-envelope calculations for something you&#8217;re building and then write micro-benchmarks to verify them.</strong> If your micro-benchmarks don&#8217;t match your back-of-the-envelope numbers, some part of your mental model will have to give, and you&#8217;ll learn something in the process.</li>
<li><strong>Dig into the performance characteristics of an open source system.</strong>  For example, take a look at <a href="https://code.google.com/p/leveldb/">LevelDB</a>.  It&#8217;s new and clean and small and well-documented. Read about the <a href="http://leveldb.googlecode.com/svn/trunk/doc/impl.html">implementation</a> to understand how it stores its data on disk and how it compacts the data into levels. Ask yourself questions about tradeoffs: which kinds of data and sizes are optimal, and which degrade read/write performance? <em>(Hint: think about random vs. sequential writes.)</em>
<li><strong>Learn how databases and operating systems work</strong> under the hood. These technologies are not only tools in your belt, but also a great source of design inspiration. If you can  think like a DB or an OS and understand how each solves the problems it was designed to solve, you&#8217;ll be able to apply that mindset to other systems.</li>
</ul>
<h2>Final thought: relax and be creative</h2>
<p>The systems design interview can be difficult, but it&#8217;s also a place to be creative and to take joy in the imagining of systems unbuilt. If you listen carefully, make sure you fully understand the problem, and then take a clear, straightforward approach to communicating your ideas, you should do fine.</p>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.palantirtech.com/2011/10/28/how-to-rock-a-systems-design-interview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Coding Interview</title>
		<link>http://blog.palantirtech.com/2011/10/03/the-coding-interview/</link>
		<comments>http://blog.palantirtech.com/2011/10/03/the-coding-interview/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 23:12:07 +0000</pubDate>
		<dc:creator>Allen Chang</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[interviewing]]></category>
		<category><![CDATA[palantir]]></category>
		<category><![CDATA[palantirtech]]></category>
		<category><![CDATA[software engineering]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">https://wp-admin-techblog.yojoe.local/?p=1925</guid>
		<description><![CDATA[Note: this part is part two of our series on doing your best in interviews. Part one: &#8220;How to Rock an Algorithms Interview&#8221;. Here at Palantir algorithms are important, but code is our lifeblood. We live and die by the quality of the code we ship. It’s no surprise, then, that coding ability is what [...]]]></description>
			<content:encoded><![CDATA[<div style='float: right; margin-left: 10px; margin-bottom: 10px'><img src="/wp-content/uploads/2011/09/einstein_coding_interview.jpg" alt="Einstein Coding Interview Joke Image" title="einstein_coding_interview" width="300"/></div>
<p><span style='font-size: 0.7em'><em>Note: this part is part two of our series on doing your best in interviews.  Part one: <a href="/2011/09/26/how-to-rock-an-algorithms-interview/" title="How to Rock an Algorithms Interview" target="_blank">&#8220;How to Rock an Algorithms Interview&#8221;</a>.</em></span></p>
<p>Here at Palantir algorithms are important, but code is our lifeblood. We live and die by the quality of the code we ship. It’s no surprise, then, that coding ability is what we stress the most in our interview process. A candidate can get by with mediocre algorithm skills (depending on the role), but no one can skimp on coding.</p>
<p>Suppose you&#8217;re confident in your ability to write great software. Your task in a coding interview (of which there will be several) is to show the interviewers that you in fact do have the programming chops — that you&#8217;re an experienced coder who knows how to write solid, production-quality code.</p>
<p>This is easier said than done. After all, coding in your <a href="http://eclipse.org/">favorite IDE</a> from the comfort of <code>$familiar_place</code> is very different from coding on a whiteboard (on a problem you&#8217;re totally unfamiliar with) in a pressure-filled 45-minute interview. We realize that the interview environment is not the real world, and we adjust our expectations accordingly. Nonetheless, there are a number of things you can do to put your best foot forward during the interview.</p>
<p>First, though, we&#8217;d like to give you a sense for what we look for during a coding interview. Most important is the ability to write clean <strong>and</strong> correct code &mdash; it&#8217;s not enough just to be correct. A lot of people will be interacting with your code once you&#8217;re on the job, so it should be readable, maintainable, and extensible where appropriate. If your solution is clean and correct, and you produced it in a reasonable amount of time without a lot of help, you&#8217;re in good shape. But even if you stumble a bit, there are other ways to demonstrate your ability. As you work, we also watch for debugging ability, problem-solving and analytical skills, creativity, and an understanding of the ecosystem that surrounds production code.</p>
<p>With our evaluation criteria in mind, here are some suggestions we hope will help you perform at your very best.</p>
<p><span id="more-1925"></span></p>
<h2>Before you start coding</h2>
<ul>
<li><strong>Make sure you understand the problem.</strong> Don&#8217;t hesitate to ask questions. Specifically, if any of the problem requirements seem loosely defined or otherwise unclear, ask your interviewer to make things more concrete. There is no penalty for asking for clarifications, and you don&#8217;t want to miss a key requirement or proceed on unfounded assumptions.</li>
<li><strong>Work through simple examples.</strong> This can be useful both before you begin and after you&#8217;ve finished coding. Working through simple examples before coding can give you additional clarity on the nature of the problem — it may help you notice additional cases or patterns in the problem that you would otherwise have missed had you been thinking more abstractly.</li>
<li><strong>Make a plan.</strong> Be wary of jumping into code without thinking about your program&#8217;s high-level structure. You don&#8217;t have to work out every last detail (this can be difficult for more meaty problems), but you should give the matter sufficient thought. Without proper planning, you may be forced to waste your limited time reworking significant parts of your program.</li>
<li><strong>Choose a language.</strong> At Palantir, we don&#8217;t care what languages you know as long as you have a firm grasp on the fundamentals (decomposition, object-oriented design, etc.). That said, you need to be able to communicate with your interviewer, so choose something that both of you can understand. In general, it&#8217;s easier for us if you use Java or C++, but we&#8217;ll try to accommodate other languages. If all else fails, <a href="http://lolcode.com/">devise your own pseudo-code</a>. Just make sure it&#8217;s precise (i.e. not hand-wavy) and internally consistent, and explain your choices as you go.</li>
</ul>
<h2>While you&#8217;re coding</h2>
<ul>
<li><strong>Think out loud.</strong> Explain your thought process to your interviewer as you code. This helps you more fully communicate your solution, and gives your interviewer an opportunity to correct misconceptions or otherwise provide high-level guidance.</li>
<li><strong>Break the problem down and define abstractions.</strong> One crucial skill we look for is the ability to handle complexity by breaking problems into manageable sub-problems. For anything non-trivial, you&#8217;ll want to avoid writing one giant, monolithic function. Feel free to define helper functions, helper classes, and other abstractions to reach a working solution. You can leverage design patterns or other programming idioms as well. Ideally, your solution will be well-factored and as a result easy to read, understand, and prove correct.</li>
<li><strong>Delay the implementation of your helper functions.</strong> (this serves a corollary to the previous point) Write out the signature, and make sure you understand the contract your helper will enforce, but don&#8217;t implement it right away. This serves a number of purposes: (1) it shows that you&#8217;re familiar with abstractions (by treating the method as an API); (2) it allows you to maintain momentum towards the overall solution; (3) it results in fewer context-switches for your brain (you can reason about each level of the call stack separately); and (4) your interviewer may grant you the implementation for free, if he or she considers it trivial.</li>
<li><strong>Don&#8217;t get caught up in trivialities.</strong> At Palantir we are much more interested in your general problem solving and coding abilities than your recall of library function names or obscure language syntax. If you can&#8217;t remember exactly how to do something in your chosen language, make something up and just explain to your interviewer that you would look up the specifics in the documentation. Likewise, if you utilize an abstraction or programming idiom which admits a trivial implementation, don&#8217;t be afraid to just write out the interface and omit the implementation so you can concentrate on more important aspects of the problem (e.g., &#8220;I&#8217;m going to use a circular buffer here with the following interface without writing out the full implementation&#8221;).</li>
</ul>
<h2>Once you have a solution</h2>
<ul>
<li><strong>Think about edge cases.</strong> Naturally, you should strive for a solution that&#8217;s correct in all observable aspects. Sometimes there will be a flaw in the core logic of your solution, but more often your only bugs will be in how you handle edge cases. (This is true of real-world engineering as well.) Make sure your solution works on all edge cases you can think of. One way you can search for edge-case bugs is to&#8230;</li>
<li><strong>Step through your code.</strong> One of the best ways to check your work is to simulate how your code executes against a sample input. Take one of your earlier examples and make sure your code produces the right result. Huge caveat here: when mentally simulating how your code behaves, your brain will be tempted to project what it wants to happen rather than what actually says happen. Fight this tendency by being as literal as possible. For example, if you&#8217;re calculating a string index with code like <code>str.length()-suffix.length()</code>, don&#8217;t just assume you know where that index will land; actually do the math and make sure the value is what you were hoping for.</li>
<li><strong>Explain the shortcuts you took.</strong> If you skipped things for reasons of expedience that you would otherwise do in a &#8220;real world&#8221; scenario, please let us know what you did and why. For example, &#8220;If I were writing this for production use, I would check an invariant here.&#8221; Since whiteboard coding is an artificial environment, this gives us a sense for how you&#8217;ll treat code once you&#8217;re actually on the job.</li>
</ul>
<p>As an addendum, here are a few suggestions for books we like about the art of software construction:</p>
<p><em><a href='http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882'>Clean Code: A Handbook of Agile Software Craftsmanship</a></em> &#8211; Robert C. Martin<br />
<em><a href="http://www.cc2e.com/">Code Complete: A Practical Handbook of Software Construction</a></em> &#8211; Steve McConnell<br />
<em><a href="http://cm.bell-labs.com/cm/cs/tpop/">The Practice of Programming</a></em> &#8211; Brian Kernighan, Rob Pike<br />
<em><a href="https://secure.wikimedia.org/wikipedia/en/wiki/Design_Patterns">Design Patterns: Elements of Reusable Object-Oriented Software</a></em> &#8211; Erich Gamma, et al.<br />
<em><a href="http://java.sun.com/docs/books/effective/">Effective Java</a></em> &#8211; Joshua Bloch</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.palantirtech.com/2011/10/03/the-coding-interview/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to Rock an Algorithms Interview</title>
		<link>http://blog.palantirtech.com/2011/09/26/how-to-rock-an-algorithms-interview/</link>
		<comments>http://blog.palantirtech.com/2011/09/26/how-to-rock-an-algorithms-interview/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 17:11:54 +0000</pubDate>
		<dc:creator>Kevin Simler</dc:creator>
				<category><![CDATA[interviewing]]></category>
		<category><![CDATA[palantir]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">https://wp-admin-techblog.yojoe.local/?p=1902</guid>
		<description><![CDATA[Comic courtesy of XKCD, via Creative Commons License We do a lot of interviewing at Palantir, and let me tell you: it&#8217;s hard. I don&#8217;t mean that we ask tough questions (although we do). I mean that the task of evaluating a candidate is hard. The problem? Given a whiteboard and one hour, determine whether [...]]]></description>
			<content:encoded><![CDATA[<div style='text-align: center'><a href='http://www.xkcd.com/399/'><img style='width: 100%; margin-bottom: 20px' src='/wp-content/uploads/2011/09/travelling_salesman_problem.png' alt='Traveling salesman problem comic, originally from http://www.xkcd.com/399/' title='Traveling salesman problem comic, originally from http://www.xkcd.com/399/' /></a>
<div style='text-align: right; font-size: 0.6em; margin-bottom: 1em;'>Comic courtesy of <a href='http://www.xkcd.com/399/'>XKCD</a>, via Creative Commons License</div>
</div>
<p>We do a lot of interviewing at Palantir, and let me tell you: it&#8217;s hard. I don&#8217;t mean that we ask tough questions (although we do). I mean that the task of evaluating a candidate is hard.</p>
<p>The problem? Given a whiteboard and one hour, determine whether the person across from you is someone you&#8217;d like to work with, in the trenches, for the next n years. A candidate&#8217;s performance during an interview is only weakly correlated with his or her true potential, but we&#8217;re stuck with the problem of turning the chickenscratch on the whiteboard into an &#8216;aye&#8217; or &#8216;nay&#8217;. Sometimes it feels like a high-stakes game of reading tea leaves. Believe me we&#8217;re doing our best, but we&#8217;re often left the nagging worry that we&#8217;re passing up brilliant people who just had a bad day or who didn&#8217;t click with a particular problem.</p>
<p>In an effort to improve this situation, we wanted to write up a guide that will help candidates make sense of this process, or at least the part known as an Algorithms Interview. At Palantir we ask questions that test for a lot of different skills — coding, design, systems knowledge, etc. — but one of our staple interviews is to ask you to design an algorithm to solve a particular problem.</p>
<p>It usually starts like this:</p>
<blockquote><p>Given X, figure out an efficient way to do Y.</p></blockquote>
<p><strong>First: Make sure you understand the problem</strong>. You&#8217;re not going to lose points asking for clarifications or talking through the obvious upfront. This will also buy you time if your brain isn&#8217;t kicking in right away. Nobody expects you to solve a problem in the first 30 seconds or even the first few minutes.</p>
<p>Once you understand the problem, <strong>try to come up with a solution – any solution whatever</strong>. As long as it&#8217;s valid, it doesn&#8217;t matter if your solution is trivial or ugly or extremely inefficient. What matters is that you&#8217;ve made progress. This does two things: (1) it forces you to engage with the structure of the problem, priming your brain for improvements you can make later, and (2) it gives you something in the bank, which will in turn give you confidence. If you can achieve a brute force solution to a problem, you&#8217;ve cleared a major hurdle to solving it in a more efficient way.</p>
<p>Now comes the hard part. You&#8217;ve given an O(n^3) solution and your interviewer asks you to do it faster. You stare at the problem, but nothing&#8217;s coming to you. At this point, there are a few different moves you can make, depending on the problem at hand and your own personality. Almost all of these can help on almost any problem:</p>
<ol>
<li><strong>Start writing on the board</strong>. This may sound obvious, but I&#8217;ve had dozens of candidates get stuck while staring at a blank wall. Maybe they&#8217;re not visual people, but still I think it&#8217;s more productive to stare at some examples of the problem than to stare at nothing. If you can think of a picture that might be relevant, draw it. If there&#8217;s a medium-sized example you can work through, go for it. (Medium-sized is better than small, because sometimes the solution to a small example won&#8217;t generalize.) Or just write down some propositions that you know to be true. Anything is better than nothing.
</li>
<p><br/></p>
<li><strong>Talk it through</strong>. And don&#8217;t worry about sounding stupid. If it makes you feel better, tell your interviewer, &#8220;I&#8217;m just going to talk out loud. Don&#8217;t hold me to any of this.&#8221; I know many people prefer to quietly contemplate a problem, but if you&#8217;re stuck, talking is one way out of it. Sometimes you&#8217;ll say something that clearly communicates to your interviewer that you understand what&#8217;s going on. Even though you might not put much stock in it, your interviewer may interrupt you to tell you to pursue that line of thinking. Whatever you do, please DON&#8217;T fish for hints. If you need a hint, be honest and ask for one.
</li>
<p><br/></p>
<li><strong>Think algorithms</strong>. Sometimes it&#8217;s useful to mull over the particulars of the problem-at-hand and hope a solution jumps out at you (this would be a bottom-up approach). But you can also think about different algorithms and ask whether each of them applies to the problem in front of you (a top-down approach). Changing your frame of reference in this way can often lead to immediate insight. Here are some algorithmic techniques that can help solve more than half the problems we ask at Palantir:
<ul>
<li>Sorting (plus searching / binary search)</li>
<li>Divide-and-conquer</li>
<li>Dynamic programming / memoization</li>
<li>Greediness</li>
<li>Recursion</li>
<li>Algorithms associated with a specific data structure (which brings us to our fourth suggestion&#8230;)</li>
</ul>
</li>
<p><br/></p>
<li><strong>Think data structures</strong>. Did you know that the top 10 data structures account for 99% of all data structure use in the real world? Probably not, because I just made those numbers up — but they&#8217;re in the right ballpark. Yes, on occasion we ask a problem whose optimal solution requires a <a href="http://en.wikipedia.org/wiki/Bloom_filter">Bloom filter</a> or <a href="http://en.wikipedia.org/wiki/Suffix_tree">suffix tree</a>, but even those problems tend to have a near-optimal solution that uses a much more mundane data structure. The data structures that are going to show up most frequently are:
<ul>
<li>Array</li>
<li>Stack / Queue</li>
<li>Hashset / Hashmap / Hashtable / Dictionary</li>
<li>Tree / binary tree</li>
<li>Heap</li>
<li>Graph</li>
</ul>
<p>You should know these data structures inside and out. What are the insertion/deletion/lookup characteristics? (O(log n) for a balanced binary tree, for example.) What are the common caveats? (Hashing is tricky, and usually takes O(k) time when k is the size of the object being hashed.) What algorithms tend to go along with each data structure? (<a href="https://secure.wikimedia.org/wikipedia/en/wiki/Dijkstra%27s_algorithm">Dijkstra&#8217;s</a> for a graph.) But when you understand these data structures, sometimes the solution to a problem will pop into your mind as soon as you even think about using the right one.
</li>
<p><br/></p>
<li><strong>Think about related problems you’ve seen before and how they were solved</strong>. Chances are, the problem you&#8217;ve been presented is a problem that you&#8217;ve seen before, or at least very similar.  Think about those solutions and how they can be adapted to specifics of the problem at hand.  Don&#8217;t get tripped up by the form that the problem is presented &#8211; distil it down to the core task and see if matches something you&#8217;ve solved in the past.</li>
<p><br/></p>
<li><strong>Modify the problem by breaking it up into smaller problems.</strong> Try to solve a special case or simplified version of the problem.  Looking at the corner cases is a good way to bound the complexity and scope of the problem.  A reduction of the problem into a subset of the larger problem can give a base to start from and then work your way up to the full scope at hand.
<p>Looking at the problem as a composition of smaller problems may also be helpful. For example, “find a number in a sorted array which has been shifted cyclically by an unknown constant k” can be solved by (1) first figuring out “k” and then (2) figuring out how to perform binary search on a shifted array).</li>
<p><br/></p>
<li><strong>Don&#8217;t be afraid to backtrack</strong>. If you feel like a particular approach isn&#8217;t working, it might be time to try a different approach. Of course you shouldn&#8217;t give up too easily. But if you&#8217;ve spent a few minutes on an approach that isn&#8217;t bearing any fruit and doesn&#8217;t feel promising, back up and try something else. I&#8217;ve seen more candidates who overcommit than undercommit, which means you should (all else equal) be a little more willing to abandon an unpromising approach.</li>
</ol>
<p>Incidentally, trying out a few different approaches (rather than sticking with a single approach) tends to work well in interviews, because the problems we choose for an interview usually have many different solutions. Happily, the same is true for the problems we solve on the job =)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.palantirtech.com/2011/09/26/how-to-rock-an-algorithms-interview/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Fun and Games with the Palantir Finance Spreadsheet Application</title>
		<link>http://blog.palantirtech.com/2011/08/11/mandelbrot-testing-with-hh-lang/</link>
		<comments>http://blog.palantirtech.com/2011/08/11/mandelbrot-testing-with-hh-lang/#comments</comments>
		<pubDate>Thu, 11 Aug 2011 20:18:49 +0000</pubDate>
		<dc:creator>Rico Chiu</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[problemspace - finance]]></category>
		<category><![CDATA[user interface]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">https://wp-admin-techblog.yojoe.local/?p=1859</guid>
		<description><![CDATA[&#8220;You&#8217;re asking us to test our platform&#8217;s programming language? How am I supposed to do that?&#8221; My head itches from trying to recall the bits and pieces of what I learned in high school about programming, specifically the semantics of a programming language. Sure, I did a bit of programming for homework assignments in college, [...]]]></description>
			<content:encoded><![CDATA[<div style='float: right; width: 300px; margin-left: 15px; margin-bottom-15px'><a href="/wp-content/uploads/2011/07/mandelbrot-15-1-to-51.jpg"><img src='/wp-content/uploads/2011/08/mandelbrot-15-1-to-51-tiny-thumb.jpg'/></a></div>
<blockquote><p>&#8220;You&#8217;re asking us to test our platform&#8217;s programming language?  How am I supposed to do that?&#8221;
</p></blockquote>
<p>My head itches from trying to recall the bits and pieces of what I learned in high school about programming, specifically the semantics of a programming language.  Sure, I did a bit of programming for homework assignments in college, but I was no CS major.  This was a much different challenge for a QA engineer to test.  Compared to an application, a programming language is completely open ended; there are no specifications to test, guidelines to follow, or limits to break.</p>
<p>The <a href="http://blog.palantir.com/2011/06/06/tech-talk-the-hedgehog-programming-language/">Hedgehog language</a> had the basic set of tools laid out for me already: I could declare variables, create data structures, and use loops for iteration.  As I was trying out individual usage examples, such as how to structure <code>if</code> statements or how to cast an object to a different type, I realized that this was no way to test something as powerful and flexible as an entire language.  It would be like a doctor who claims that since each individual organ works fine, there are no problems with the entire system.  This is insufficient: <a href="http://blog.palantir.com/2010/07/23/help-is-there-a-doctor-in-the-network/">one needs to look at the system as a whole, including examining the interactions between each component</a>.  I decided I needed to create much larger and elaborate code samples in order to test the Hedgehog language in a larger scope.</p>
<p>Using the Hedgehog language, I had programmed several algorithms, solving puzzles that would output a number.  This was getting bit boring, since once the output value was matched the expected number, there was nothing more to be done.  I wanted to create something more dynamic, a toy I could play around and experiment with.  And opportunity presented itself in the form of one of our newest tools: the spreadsheet application.  With the capability of setting the value of each cell programmatically and then coloring them depending on their value… hmm what could I do with this?</p>
<p>Hedgehog is a powerful tool in coding functions and workflows that directly interact with our applications. Most of the time, the language is used to write expressions for an input value, create custom metrics that return values after a set of calculations, or even to set inputs, calculate, and save documents. Given the language’s ability to integrate with Spreadsheet, the capabilities of the Hedgehog language can literally be visually shown to the user, resulting in some stunning displays.<span> </span>Below are three examples I’ve coded in Palantir Finance’s own language: calculating and drawing the Mandelbrot fractal, simulating Conway’s Game of Life, and solving a Nonograms puzzle.<br />
<span id="more-1859"></span></p>
<p class="MsoNormal"><span style="underline;"><strong>The Mandelbrot fractal</strong></span></p>
<p class="MsoNormal">The<a title="Mandelbrot Set" href="http://en.wikipedia.org/wiki/Mandelbrot_set" target="_self"> Mandelbrot set</a> is one of the most recognized images among fractals.<span> </span>Fractals are unique images due to their self-similarity, such that they have infinite detail: as you zoom in on a fractal border, detailed structures will continue to appear indefinitely.<span> </span></p>
<p>Since the Mandelbrot set is an example of an escape time fractal, we can write a function that counts the number of iterations it takes for a given point to escape a threshold value.<span> </span>Applying this function to each point within a grid of specified range and resolution, we can generate a field of values to be set in a spreadsheet.<span> </span>After resizing the spreadsheet cells into small squares and applying conditional formatting, specifically a heat map that colors the cell based on its value, the below images can be generated:</p>
<div id="attachment_1912" class="wp-caption aligncenter" style="width: 660px"><a href="/wp-content/uploads/2011/07/mandelbrot-15-1-to-51.jpg"><img class="size-full wp-image-1912 " src="/wp-content/uploads/2011/07/mandelbrot-15-1-to-51.jpg" alt="Mandelbrot Fractal drawn from (-1.5, -1) to (0.5, 1)" width="650" height="460" /></a><p class="wp-caption-text">Fig M1. Mandelbrot Fractal drawn from (-1.5, -1) to (0.5, 1), with the top left quadrant visible</p></div>
<div id="attachment_1913" class="wp-caption aligncenter" style="width: 660px"><a href="/wp-content/uploads/2011/07/mandelbrot2.jpg"><img class="size-full wp-image-1913" src="/wp-content/uploads/2011/07/mandelbrot2-thumb.jpg" alt="Mandelbrot Fractal drawn from (0.27205, 0.00451) to (0.27505, 0.00751)" width="650" /></a><p class="wp-caption-text">Fig M2. Mandelbrot Fractal drawn from (0.27205, 0.00451) to (0.27505, 0.00751)</p></div>
<div id="attachment_1914" class="wp-caption aligncenter" style="width: 660px"><a href="/wp-content/uploads/2011/07/manual-heat-map.jpg"><img class="size-medium wp-image-1914" src="/wp-content/uploads/2011/07/manual-heat-map-thumb.jpg" alt="Mandelbrot Fractal with manually created heat map" width="650" /></a><p class="wp-caption-text">Fig M3. Mandelbrot Fractal with manually created rainbow heat map</p></div>
<p class="MsoNormal"><span style="underline;"><strong>The Game of Life</strong></span></p>
<p><span>John Conway’s <a title="Game of Life" href="http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life" target="_self">Game of Life</a> </span>is a simple cellular automaton that shows the evolution of an initial state of cells governed by a set of rules.<span> </span>In the classic scenario, cells can be alive or dead, indicated by a filled or empty cell respectively.<span> </span>When evaluating the next generation of cells, each cell checks the number of live neighbors among its adjacent 8 cells.<span> </span>If the cell is alive with 2 or 3 live neighbors, it remains alive.<span> </span>If a dead cell has 3 live neighbors, it becomes alive.<span> </span>All other scenarios, the cell evolves into a dead cell.</p>
<p class="MsoNormal">In this example, we rely heavily on spreadsheet’s cell dependency tree.<span> </span>Cells are able to reference the value of other cells within their expression, creating a directed acyclic graph. If the value of a cell changes, all cells that point towards the changed cell need to recalculate their value.<span> </span>In this specific case, the user can change the value of which generation to view, which causes the recalculation of the grid of cells representing the game.</p>
<p class="MsoNoSpacing">In the spreadsheet below, the initial state, or generation 0, of “Noah’s Ark” is shown.<span> </span>The initial data for Noah’s Ark is derived from an external spreadsheet document containing a grid of 0’s and 1’s.<span> </span></p>
<p><a href="/wp-content/uploads/2011/07/initial-noahs-ark.jpg"><img class="size-medium wp-image-1915" src="/wp-content/uploads/2011/07/initial-noahs-ark.jpg" alt="Initial generation for Noah's Ark" width="650" /></a></p>
<p class="MsoNoSpacing">Below is an animated image of the evolution of Noah’s Ark from generation 0 to generation 10.</p>
<p><a href="/wp-content/uploads/2011/07/animation.gif"><img class="size-full wp-image-1916" src="/wp-content/uploads/2011/07/animation.gif" alt="Animation of Noah's Ark up to 10th Generation" width="640"/></a></p>
<p class="MsoNormal">One problem encountered is that it takes increasingly longer to calculate a larger generation number. Because the only generation that is saved is the initial generation, calculations must always start from generation 0 when the user changes the generation number.<span> This triggers a lot of redundant calculations: if I am at generation 10 and want to see generation 11, the calculation starts from generation 0, repeats all the same calculations up to generation 10, and finally calculates one more iteration to reach generation 11.  T</span>o prevent unnecessary calculations, the results of previous calculations can be written to a cache file: a separate spreadsheet document containing the generation data that was calculated previously.<span> When caching is enabled, previous generation calculations can be retrieved so the same calculation never happens twice.</span></p>
<p class="MsoNormal">Below is an animated image of a “Gospel Glider Gun” from generation 0 to generation 40, shown in increments of 2 generations.<span> </span>The glider gun will continue to oscillate over time while producing a 5 cell glider object that floats away from the gun diagonally down to the right.<span> </span>Without the caching functionality, the 40<sup>th</sup> generation would take approximately 4 times as long as the 10<sup>th</sup> generation.<span> </span>By enabling caching, each animation frame takes approximately the same time to calculate since only 2 generations are computed per frame.</p>
<p><a href="/wp-content/uploads/2011/07/211.gif"><img class="size-full wp-image-1918" src="/wp-content/uploads/2011/07/211.gif" alt="Animation of Glider Gun up to 40th generation" width="640" /></a></p>
<p><span style="underline;"><strong>Nonograms Solver</strong></span></p>
<p><span><a title="Nonograms" href="http://http://en.wikipedia.org/wiki/Nonogram" target="_self">Nonograms</a>, sometimes better known as Picross, </span>are a type of logic puzzle where the user is given a blank grid with a set of numbers for each row and column.<span> </span>The numbers represent the number of consecutively filled blocks in the final solution within that row or column.<span> </span>Using these numbers as clues, it can be deduced whether or not a space is filled or not, until the entire grid simultaneously satisfies all given conditions.<span> </span>Solving puzzles is a NP-complete problem: it is very easy to verify a solution by checking if each row and column satisfies its set of numbers, but becomes increasingly difficult to solve larger puzzles.<span> </span>Time it takes to check a puzzle increases linearly with puzzle size, but the time to solve increases much faster due to the increase in number of iterations over each row or column crossed with an increased number of permutation possibilities for each set of numbers per iteration.<span> </span>Solving a 25&#215;25 nonogram puzzle by hand usually takes about 30 minutes for an experienced solver.</p>
<div style='float: right; margin-left: 15px; margin-bottom: 15px;'><a href="/wp-content/uploads/2011/07/nonogram-permutation.jpg"><img class="size-full wp-image-1919" src="/wp-content/uploads/2011/07/nonogram-permutation.jpg" alt="Possible permutations of [2,1] in a row of 5 spaces" width="186" height="146" /></a></div>
<p class="MsoNormal">Given the initial set of values for each row and column, the algorithm iterates through each row or column individually. <span> </span>The simplest method to solve is to find all possible permutations of the given numbers over the length of the row or column and check if there are any spaces that are consistently filled or unfilled across all possibilities.<span> </span>Let’s consider a simple example: In a row of 5 spaces, the set of values given is [2,1].<span> </span>Thus the possible permutations are shown on the right, where 1 is a filled space, -1 is an unfilled space, and 0 is undetermined.</p>
<p class="MsoNormal">Additional optimizations, such as queuing the order of rows and columns to solve, trimming the solved ends of a range of spaces, and avoiding unnecessary calculations, were made to improve the performance of the algorithm such that the average time to solve a 25&#215;25 puzzle is 5 minutes.<span> </span>This is fairly impressive given that the Hedgehog language is by no means optimized to handle such calculations and array manipulations.<span> </span>Below are some examples of solved puzzles:</p>
<div id="attachment_1920" class="wp-caption aligncenter" style="width: 660px"><a href="/wp-content/uploads/2011/07/10x10.jpg"><img class="size-full wp-image-1920" src="/wp-content/uploads/2011/07/10x10.jpg" alt="10x10 nonogram solution, solved in less than a second" width="650" /></a><p class="wp-caption-text">Fig N1. 10x10 nonogram solution, solved in less than a second</p></div>
<div id="attachment_1921" class="wp-caption aligncenter" style="width: 657px"><a href="/wp-content/uploads/2011/07/20x20.jpg"><img class="size-full wp-image-1921" src="/wp-content/uploads/2011/07/20x20.jpg" alt="20x20 nonograms solution, solved in 20 seconds" width="647" /></a><p class="wp-caption-text">Fig 2. 20x20 nonograms solution, solved in 20 seconds</p></div>
<div id="attachment_1922" class="wp-caption aligncenter" style="width: 660px"><a href="/wp-content/uploads/2011/07/25x25.jpg"><img class="size-full wp-image-1922" src="/wp-content/uploads/2011/07/25x25.jpg" alt="25x25 nonograms solution, solved in 3 minutes" width="650" /></a><p class="wp-caption-text">Fig N3. 25x25 nonograms solution, solved in 3 minutes</p></div>
<p>The initial spark that ignited this series of code examples started from just a simple curiosity of, &#8220;I wonder if it would be possible to write this in Hedgehog?&#8221;  In a way, it was also an exercise for me to learn more about the Hedgehog language, extending the use of its capabilities and libraries of metrics, in order to inject more complicated expressions while testing other applications on our platform. Throughout the process of developing the finished product, I was able to expose issues with the language that may have gone unnoticed with smaller, simpler test cases.  </p>
<p>But of course, the driving motivation behind all this was to have fun, which is a big part of what it means to be working at Palantir.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.palantirtech.com/2011/08/11/mandelbrot-testing-with-hh-lang/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Human-Computer Symbiosis: 9/11 Memorial Name Layout</title>
		<link>http://blog.palantirtech.com/2011/07/05/human-computer-symbiosis-911-memorial-name-layout/</link>
		<comments>http://blog.palantirtech.com/2011/07/05/human-computer-symbiosis-911-memorial-name-layout/#comments</comments>
		<pubDate>Tue, 05 Jul 2011 20:49:41 +0000</pubDate>
		<dc:creator>Ari Gesher</dc:creator>
				<category><![CDATA[Human-Computer Symbiosis]]></category>
		<category><![CDATA[user interface]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">https://wp-admin-techblog.yojoe.local/?p=1849</guid>
		<description><![CDATA[We talk a lot about Human-Computer Symbiosis on this blog &#8211; it&#8217;s a systems design approach that guides us in our construction of our technology stacks. Given that, we&#8217;re always on the lookout for example of HCS systems built by other people. Here&#8217;s an unlikely example: the layout of names in the memorial was made [...]]]></description>
			<content:encoded><![CDATA[<div style='float: right; margin-left: 15px; margin-bottom: 15px; width: 300px'><a href='http://blog.blprnt.com/blog/blprnt/all-the-names'><img src='/wp-content/uploads/2011/06/9-11-memorial.jpg' width='300'/></a></div>
<p>We talk a lot about <a href="http://blog.palantir.com/category/human-computer-symbiosis/">Human-Computer Symbiosis on this blog</a> &#8211; it&#8217;s a systems design approach that guides us in our construction of our technology stacks.  Given that, we&#8217;re always on the lookout for example of HCS systems built by other people.</p>
<p>Here&#8217;s an unlikely example: the layout of names in the memorial was made according to &#8216;meaningful adjacencies&#8217; (as described by <a href='http://blog.blprnt.com/about'>Jer Thorp</a> in his blog post, <a href='http://blog.blprnt.com/blog/blprnt/all-the-names'><em>All The Names: Algorithmic Design and the 9/11 Memorial</em></a>):</p>
<blockquote><p>
The project was to design an algorithm for placement of names on the 9/11 memorial in New York City. In architect Michael Arad‘s vision for the memorial, the names were to be laid according to where people were and who they were with when they died – not alphabetical, nor placed in a grid. Inscribed in bronze parapets, almost three thousand names would stream seamlessly around the memorial pools. Underneath this river of names, though, an arrangement would provide a meaningful framework; one which allows the names of family and friends to exist together. Victims would be linked through what Arad terms ‘meaningful adjacencies’ – connections that would reflect friendships, family bonds, and acts of heroism. through these connections, the memorial becomes a permanent embodiment of not only the many individual victims, but also of the relationships that were part of their lives before those tragic events.</p></blockquote>
<p>Read on for details on the approach they used and how it embodies HCS architecture (not to mention, a video of their tool in action).<br />
<span id="more-1849"></span></p>
<p>The post goes deep into detail on how they built the information system to model and prototype the layout of the names.  In end, they let the computers track the adjacency issues while the humans handled the overall aesthetics of not just the overall memorial, but the details of how the names were laid out:</p>
<blockquote><p>It would be misleading to say that the layout for the final memorial was produced by an algorithm. Rather, the underlying framework of the arrangement was solved by the algorithm, and humans used that framework to design the final result. This is, I think, a perfect example of something that I’ve believed in for a long time: we should let computers do what computers do best, and let humans do what humans do best. In this case, the computer was able to evaluate millions of possible solutions for the layout, manage a complex relational system, and track a large set of important variables and measurements. Humans, on the other hand, could focus on aesthetic and compositional choices. It would have been very hard (or impossible) for humans to do what the computer did. At the same time, it would have been very difficult to program the computer to handle the tasks that were completed with such dedication and precision by the architects and the memorial team.</p></blockquote>
<p>To quote <a href="https://secure.wikimedia.org/wikipedia/en/wiki/J._C._R._Licklider">J.R. Licklider</a>, whose <a href="http://blog.palantirtech.com/man-computer-symbiosis/"><em>Man-Computer Symbiosis</em></a> paper is widely considered to be the seminal work on the how and why of building HCS systems:</p>
<blockquote><p>Men will set the goals and supply the motivations, of course, at least in the early years. They will formulate hypotheses. They will ask questions. They will think of mechanisms, procedures, and models. They will remember that such-and-such a person did some possibly relevant work on a topic of interest back in 1947, or at any rate shortly after World War II, and they will have an idea in what journals it might have been published. In general, they will make approximate and fallible, but leading, contributions, and they will define criteria and serve as evaluators, judging the contributions of the equipment and guiding the general line of thought.</p>
<p>In addition, men will handle the very-low-probability situations when such situations do actually arise. (In current man-machine systems, that is one of the human operator’s most important functions. The sum of the probabilities of very-low-probability alternatives is often much too large to neglect. ) Men will fill in the gaps, either in the problem solution or in the computer program, when the computer has no mode or routine that is applicable in a particular circumstance.</p>
<p>The information-processing equipment, for its part, will convert hypotheses into testable models and then test the models against data (which the human operator may designate roughly and identify as relevant when the computer presents them for his approval). The equipment will answer questions. It will simulate the mechanisms and models, carry out the procedures, and display the results to the operator. It will transform data, plot graphs (“cutting the cake” in whatever way the human operator specifies, or in several alternative ways if the human operator is not sure what he wants). The equipment will interpolate, extrapolate, and transform. It will convert static equations or logical statements into dynamic models so the human operator can examine their behavior. In general, it will carry out the routinizable, clerical operations that fill the intervals between decisions.</p></blockquote>
<p><iframe src="http://player.vimeo.com/video/23444105?title=0&amp;byline=0&amp;portrait=0" width="650" height="390" frameborder="0"></iframe>
<p><a href="http://vimeo.com/23444105">WTC Names Arrangement Tool</a> from <a href="http://vimeo.com/user313340">blprnt</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.palantirtech.com/2011/07/05/human-computer-symbiosis-911-memorial-name-layout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tech Talk: the Hedgehog Programming Language</title>
		<link>http://blog.palantirtech.com/2011/06/06/tech-talk-the-hedgehog-programming-language/</link>
		<comments>http://blog.palantirtech.com/2011/06/06/tech-talk-the-hedgehog-programming-language/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 20:53:38 +0000</pubDate>
		<dc:creator>Ari Gesher</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[distributed systems]]></category>
		<category><![CDATA[Human-Computer Symbiosis]]></category>
		<category><![CDATA[problemspace - finance]]></category>
		<category><![CDATA[software engineering]]></category>
		<category><![CDATA[user interface]]></category>

		<guid isPermaLink="false">https://wp-admin-techblog.yojoe.local/?p=1844</guid>
		<description><![CDATA[A few months back, Kevin introduced us to the Hedgehog Programming language &#8211; (here&#8217;s the post if you missed it). The Palantir Finance programming language — Hedgehog as we know it — is an interpreted, statically typed, object-oriented language. With a syntax that’s based loosely on Java, it mixes roughly Java-style semantics and a few [...]]]></description>
			<content:encoded><![CDATA[<div style='float: right; width: 300px; margin-bottom: 15px; margin-left: 15px'><a target='new' href='http://www.pfinance.com/'><img src="http://blog.palantir.com/wp-content/uploads/2010/10/hedgehog.jpg" alt="" title="hedgehog" width="300" height="129" class="alignnone size-medium wp-image-1753" /></a></div>
<p>A few months back, Kevin introduced us to the Hedgehog Programming language &#8211; <a href="http://www.youtube.com/watch?v=54Vv3Os3Ep4">(here&#8217;s the post if you missed it)</a>.  </p>
<p>The Palantir Finance programming language — Hedgehog as we know it — is an interpreted, statically typed, object-oriented language. With a syntax that’s based loosely on Java, it mixes roughly Java-style semantics and a few idiosyncrasies that make it a really interesting case study in language design. It’s built to be extremely efficient for batch operations on time series, which is the heavy lifting in financial analysis.</p>
<p>In this video, Eugene and Dave, two of the engineers that work on the language and platform features needed to support it, give a talk that goes into a number of areas around the Hedgehog language, including why we needed to build a language, how it makes the platform more powerful, how we built dev tools into the UI to make debugging easier, and a bunch of the nitty-gritty features that go into the strange (but fitting) beast that is the Hedgehog Language.</p>
<p><iframe title="YouTube video player" width="640" height="510" src="http://www.youtube.com/embed/54Vv3Os3Ep4" frameborder="0" allowfullscreen></iframe></p>
<p>As a final note: this is one of things that I love about working at Palantir Technologies.  We study a problem pretty hard before we decide that we need to re-invent the wheel &#8211; and then when we do, we go all out.  It&#8217;s one of the benefits of working with the incredibly talented and motivated folks here.  When someone says, &#8220;well, we need to build a programming language.  No, we&#8217;re sure,&#8221; we just roll up our sleeves and do it.  We can add it to the list of: <a href="http://blog.palantir.com/2009/02/23/palantir-monitoring-server-where-build-beats-buy/">JMX monitoring system</a>, <a href="http://blog.palantir.com/2009/08/13/palantir-search-with-a-twist-part-one-memory-efficiency/">refined Lucene search engine</a>, <a href="http://blog.palantir.com/2011/04/15/inside-horizon-interactive-analysis-at-cloud-scale/">speeding up Map-Reduce-like systems to interactive time</a>, and <a href="http://www.palantirtech.com/government/analysis-blog/isr">implementing our own GIS platform</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.palantirtech.com/2011/06/06/tech-talk-the-hedgehog-programming-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inside Horizon: interactive analysis at cloud scale</title>
		<link>http://blog.palantirtech.com/2011/04/15/inside-horizon-interactive-analysis-at-cloud-scale/</link>
		<comments>http://blog.palantirtech.com/2011/04/15/inside-horizon-interactive-analysis-at-cloud-scale/#comments</comments>
		<pubDate>Fri, 15 Apr 2011 19:04:46 +0000</pubDate>
		<dc:creator>Ari Gesher</dc:creator>
				<category><![CDATA[distributed systems]]></category>
		<category><![CDATA[enterprise engineering]]></category>
		<category><![CDATA[enterprise software]]></category>
		<category><![CDATA[Human-Computer Symbiosis]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[problemspace-government]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">https://wp-admin-techblog.yojoe.local/?p=1837</guid>
		<description><![CDATA[Late last year, we were honored to be invited to talk at Reflections&#124;Projections, ACM@UIUC&#8217;s annual student-run computing conference. We decided to bring a talk about Horizon, our system for doing aggregate analysis and filtering across very large amounts of data. The video of the talk was posted a few weeks back on the conference website. [...]]]></description>
			<content:encoded><![CDATA[<div style='width: 250; margin-left: 10px; margin-bottom: 10px; float: right;'><a href="http://www.acm.uiuc.edu/conference/2010/"><img src="http://blog.palantir.com/wp-content/uploads/2011/03/reflectionsprojections.png" alt="" title="reflectionsprojections" width="250" height="215"/></a></div>
<p>Late last year, we were honored to be invited to talk at Reflections|Projections, ACM@UIUC&#8217;s annual student-run computing conference.  We decided to bring a talk about Horizon, our system for doing aggregate analysis and filtering across very large amounts of data.  The video of the talk was posted a few weeks back on <a href="http://www.acm.uiuc.edu/Conferenceware/Schedule/Videos">the conference website</a>.</p>
<p>Horizon started as research project / technology demonstrator built as part of Palantir&#8217;s Hack Week &#8211; a periodic innovation sprint that our engineering team uses to build brand new ideas from whole cloth.  It was then used by the Center For Public Integrity in their <a href="http://www.publicintegrity.org/investigations/economic_meltdown/">Who&#8217;s Behind The Subprime Meltdown</a> report.  We produced a short video on the subject, <a href="http://www.palantirtech.com/government/analysis-blog/horizon">Beyond the Cloud: Project Horizon</a>, released on our analysis blog.  Subsequently, it was folded into our product offering, under the name <a href="http://www.palantirtech.com/labs/object-explorer">Object Explorer</a>.</p>
<p>In this hour-long talk, two of the engineers that built this technology tell the story of how Horizon came to be, how it works, and show a live demo of doing analysis on hundreds of millions of records in interactive time.</p>
<p><iframe title="YouTube video player" width="640" height="510" src="http://www.youtube.com/embed/9dOpDeRMTMc" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.palantirtech.com/2011/04/15/inside-horizon-interactive-analysis-at-cloud-scale/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Decorator Pattern: Implementing decorators using forwarding classes</title>
		<link>http://blog.palantirtech.com/2011/03/01/decorator-pattern-implementing-decorators-using-forwarding-classes/</link>
		<comments>http://blog.palantirtech.com/2011/03/01/decorator-pattern-implementing-decorators-using-forwarding-classes/#comments</comments>
		<pubDate>Tue, 01 Mar 2011 21:29:18 +0000</pubDate>
		<dc:creator>Allen Chang</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[enterprise engineering]]></category>
		<category><![CDATA[software engineering]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">https://wp-admin-techblog.yojoe.local/?p=1821</guid>
		<description><![CDATA[A forwarding class is an abstract base class which makes it easier to implement decorators for a particular interface. A forwarding class simply forwards all calls it receives to some delegate; a decorator can then be implemented by extending the forwarding class and overriding the relevant methods. Here&#8217;s an example implementation of a forwarding class [...]]]></description>
			<content:encoded><![CDATA[<p>A forwarding class is an abstract base class which makes it easier to implement decorators for a particular interface. A forwarding class simply forwards all calls it receives to some delegate; a <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Decorator_pattern">decorator</a> can then be implemented by extending the forwarding class and overriding the relevant methods. Here&#8217;s an example implementation of a forwarding class for the <code>Collection&lt;E&gt;</code> interface (from <a href="https://code.google.com/p/google-collections/">Google Collections</a>):</p>
<pre class="brush: java; title: ; notranslate">
public abstract class ForwardingCollection&lt;E&gt; extends ForwardingObject implements Collection&lt;E&gt; {
  @Override protected abstract Collection&lt;E&gt; delegate();

  public boolean add(E element) {
    return delegate().add(element);
  }

  // ... (more overridden methods) ...
}
</pre>
<p>Things worth noting:</p>
<ul>
<li>This class overrides the <code>delegate()</code> method to return a <i>more specific</i> type.</li>
<li>The class contains no instance variables and <i>does not</i> have to be marked <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/io/Serializable.html">Serializable</a>.</li>
</ul>
<p>Now, here&#8217;s an example of how to implement a decorator using a forwarding class (also from Google Collections):</p>
<pre class="brush: java; title: ; notranslate">
  public class ConstrainedCollection&lt;E&gt; extends ForwardingCollection&lt;E&gt; {
    private final Collection&lt;E&gt; delegate;
    private final Constraint&lt;? super E&gt; constraint;

    public ConstrainedCollection(Collection&lt;E&gt; delegate, Constraint constraint) {
      this.delegate = checkNotNull(delegate);
      this.constraint = checkNotNull(constraint);
    }
    @Override protected Collection&lt;E&gt; delegate() {
      return delegate;
    }
    @Override public boolean add(E element) {
      constraint.checkElement(element);
      return super.add(element);
    }
    @Override public boolean addAll(Collection&lt;? extends E&gt; elements) {
      return super.addAll(checkElements(elements, constraint));
    }
  }
</pre>
<p>This class implements a collection that checks a constraint on all elements added to the collection. Note that writing the decorator is easy given the <a href="https://google-collections.googlecode.com/svn/trunk/javadoc/com/google/common/collect/ForwardingObject.html">forwarding class</a> &#8212; only the methods relevant to the decorator need to be overridden.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.palantirtech.com/2011/03/01/decorator-pattern-implementing-decorators-using-forwarding-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

