Oren Eini

CEO of RavenDB

a NoSQL Open Source Document Database

Get in touch with me:

oren@ravendb.net +972 52-548-6969

Posts: 7,488
Comments: 51,038
Privacy Policy · Terms
filter by tags archive
time to read 4 min | 769 words

So here I am, only 3 days into WPF, and I have an interesting interview question. Given the following, what will be the title of the page? Why?


<Page x:Class="Browser.BlogViewer"






public partial class BlogViewer : Page


      public BlogViewer()


            Title = “Bar”;




time to read 4 min | 765 words

A couple of days ago I had a really great interview, I figure that I am due one after the long series of horrible candidates that I had recently. Anyway, I did a couple things there that I think that I will carry on to the future interviews. I gave the guy a laptop, and the following excersise, given the follwoing object model:

public class Customer
  public List<Order> Orders = new List<Order>();
  public string CompanyName;
  public string Id;
public class Order
  public int Id;
  public Customer Customer;
  DateTime ShippedAt;
  DateTime OrderedAt;

And the following SQL Statement:

SELECT  Customers.CustomerID,





FROM    Customers

INNER JOIN Orders ON Orders.CustomerID = Customers.CustomerID

The task is to give me a list of Customers with their orders collection filled. No duplicate customers are allowed. I think that you can see why this is a subject that is near & dear to my heart ;-) Anyway, this is a task that test several distinct parts of the candidate's knowledge, SQL/Database, ADO.Net, minor data structure, logic, etc. It also says a lot about the background of the candidated as they approach it.

Another thing that I thing that I'll keep is asking them what they don't know and then give a task in that area. The task is neccecarily trivial, but it shows how the candidate can learn and think. I don't want co-workers that needs step-by-step instructions.

time to read 15 min | 2819 words

I'm constantly on the look up for good questions to ask in interviews, mainly because "describe the page life-cycle" gets boring and I would like to get away from the page lifecycle myself. The problem with finding good questions is that it has to expose as much knowledge from the candidate, while keeping the answer short and possible to answer within the time limits of an interview.

Here is one that I just thought of:

Given an Employee class, create a collection that accepts employees but doesn't allow duplicate employees to be entered. You are free to use any of the classes in the .Net framework.

Basically, build a set class. This is a good question in my opinion because it tests a wide range of knowledge, in a short question, which can be implemented in about 10 minutes. The question test the following:

  • Basic data structure / efficencies knowledge - if they decide to use ArrayList and compare each time, that would cost in both time to develop and performance
  • Thinking toward reuse - if they implement this from scratch (starting from building growable arrays and moving forward), that means that they either have a problem with knowing the building blocks of the framework or they suffer from NIH.
  • Understanding basic idioms of the framework - implementing IEnumerable will make the collection usable for foreach(), for instnace.
  • Understanding how low level stuff works - can they explain what reference equality vs. value equality is, can the explain how the Dictionary works?

It then leads to another question:

In certain circumstances, I wasnt to be able to able to allow no employees with duplicate names, how would you extend the collection to support this?

And this question tests how they can extend an existing class, and whatever they can come up with something that fits into the .Net idioms cleanly. Adding a boolean to check for an employee name is not a good way to do this.

Here is what I would consider an excellent implementation (not great, because it doesn't implement ICollection<T>):

public class EmployeesSet : IEnumerable<Employee>


       Dictionary<Employee, object> internalDic;


       public EmployeesSet()


              internalDic = new Dictionary<Employee, object>();



       public EmployeesSet(IEqualityComparer<Employee> comparer)


              internalDic=new Dictionary<Employee, object>(comparer);



       public void Add(Employee item)






       public bool Contains(Employee item)


              return internalDic.ContainsKey(item);



       public bool Remove(Employee item)


              return internalDic.Remove(item);



       public int Count


              get { return internalDic.Count; }



       public IEnumerator<Employee> GetEnumerator()


              return internalDic.Keys.GetEnumerator();



       IEnumerator IEnumerable.GetEnumerator()


              return internalDic.Keys.GetEnumerator();




  1. RavenDB Cloud Global Status vs. Product Status - about one day from now
  2. Recording: Technology & Friends - Oren Eini on the Corax Search Engine - 2 days from now
  3. RavenDB and Two Factor Authentication - 3 days from now

There are posts all the way to Mar 06, 2024


  1. Recording (13):
    15 Jan 2024 - S06E09 - From Code Generation to Revolutionary RavenDB
  2. Meta Blog (2):
    23 Jan 2024 - I'm a JS Developer now
  3. Production postmortem (51):
    12 Dec 2023 - The Spawn of Denial of Service
  4. Challenge (74):
    13 Oct 2023 - Fastest node selection metastable error state–answer
  5. Filtering negative numbers, fast (4):
    15 Sep 2023 - Beating memcpy()
View all series


Main feed Feed Stats
Comments feed   Comments Feed Stats