How do you handle displaying all of the data quickly to the end user? // Since most people are familiar with stocks I generally have them articulate the requirements and functionality first. The crux of this problem is thinking about the different granularities in which they can view a stock price – real time, hourly, daily, yearly, etc. and modeling their data to support fast querying for those graphs.
What interfaces and class objects would you use? What configuration options would you need for the software to work in skyscrapers, buildings with only one elevator, and buildings with banks of elevators? How would these use cases change the objects and interfaces in your design?
What are the primary functions? What are the various interfaces, classes, etc. that you would need to provide those functions? // and feel free to replace text editor with any common small program of your choosing (mobile apps make great examples)
How might you find the minimum number in the list? // It is easier if you can assume all the numbers are increasing, until it reaches the end of the list.Implement a function that will divide two numbers without using the division operator. (solution for dividing a number by 3)
How would you dive the tasks across two different servers to they finished in the same amount of time?Write a program that will find the 10 most popular words (popularity is determined by how often they occur) in a file. How can you do this efficiently in terms of space? In terms of time? // Sometimes it helps to tell them it is a really big file that can’t fit in memory if they get hung up on timing
And every 2 digit counts as a 2, so if N was 7 the answer would be 1 (just the number 2), whereas if n was 23 there would be 7 2’s {2, 12, 20, 21, 22 (this counts for 2), 23}. // This is actually pretty challenging and one of my favorite questions to ask candidates that are doing really well in with lots of other questions. Getting the brute force answer is easy, coming up with an elegant solution takes a little more effort.
// You can also use the current time if there is a clock in the room. You aren’t looking for a wild guess but for someone who can rationalize out the answer. For candidates rusty on geometry I will give them the number of degrees in a circle via hints
How would you pick the state? How would you go about deciding what salaries to pay the employees? // This is a great question for a leadership role, if you don’t like the salary version you can modify the question to be about opening a data center and partitioning services.
Assume each item has a title, a description and price. // feel free to set limits on the fields or your choosing, or ask the candidate to pick something reasonable.
Most of the time I am looking to verify the candidate understands the different sizes of data and how it would be impact their programs. Other interviewers go deeper here, though, so it is up to you.)
// Also pay attention to what questions the candidate asks you about the database – hopefully the questions will help clarify assumptions and problems and will likely give you more insight than just the potential solutions.
// I like to use one of the products or features at my company, but you could also use familiar scenarios like: course catalog for students, a rental car database, a flight database for an airline, inventory for an ecommerce site, etc.
Try to pick a schema from one of your databases if possible – it is always nice to use real world data. // If you can’t come up with one an employee or student database are easy to grok examples.
Any of the following will work: TCP, UDP, HTTP, DNS, but there are way more. // In the event the candidate starts to explain one you are less familiar with take notes and ask questions – you can verify their knowledge later and test their communication now.
Do you have any experience with other data stores? What was the use case? Why might you consider an alternate solution (to an relational DB) and what would be the downsides of doing so?
In your past projects, what types of caches were present?How would you decide if you should buy servers with more memory or disk space? How would you develop a cost model to help you make the decision? // This question is probably best for someone with some experience managing or having exposure to servers. You can still answer it without that knowledge of course, but there may be better questions.
How do you know which items need to be refreshed? What happens when the cache is full; how do you decide which items to evict? // BTW this is one of my favorite interview questions for phone screens. Mostly because you can go really deep with candidates that really understand this concept and you don’t need a diagram or whiteboard to communicate the question and answer.
Why is it important and when have you done it? (Some candidates can even talk about different refactorings and design patterns here, but mostly I am looking for someone who wants to improve the code they write – as very few people ever get it all right the first time)
What tools do you like to use best? Have you tried others before? What were the reasons you use the ones you do? // There is really no right answer here, it is mostly just about learning how they do their work, and how it fits into past projects. Good answers usually involve thoughtful responses on trade-offs, technology, and experience.
What do you do first? // This question works best if you have a product or example with some issues in mind – otherwise it can be a pretty abstract question.