Skip to content

Instantly share code, notes, and snippets.

@saml
Last active February 3, 2024 15:13
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save saml/5698758 to your computer and use it in GitHub Desktop.
Save saml/5698758 to your computer and use it in GitHub Desktop.
  1. Dining philosopher

They want food so they wait. And end up eating each other.

  1. Given a random number generator that returns a number between [0,1], how would you build a RNG that accounted for weighting?

WAT?

  1. You have two arrays with N integers in them. Merge those arrays using a recursive algorithm so that the integers in the final array are sorted.

Why not use merge sort?

  1. generators(in python) and about minesweeper.

They cray.

  1. given a query and a document, highlight the query in the document and return a snippet of the document itself. Don't use existing large 3rd party libraries.

No.

  1. Finding the longest palindrome in a given string.

No.

  1. query log, and how to get the top K most frequent ones

Put it into MySQL.

  1. Maximum subarray problem

Pobwem?

  1. Generate all permutations of an alphanumeric string (lowercase/uppercase only if a letter)

Use library.

  1. How can you improve the service of Yelp?

Make it more web scale.

  1. Pick a random number from weighted list based on weight

    list_of_random_numbers[adjust_weight(random_index)]

  2. given a string length 25, consisting of alphabet (lower and upper case) and numbers.in this string some of the upper case letters are lower cased and sent to me. I have a black box fuction that returns a integer, something like 13 or 14, that says the string I have got is correct else it throws a exception. find the right string given a corrupted string.

  3. Reconstruct a binary tree given two sequences of node traversals, one from inorder and one from postorder traversal.

  4. memory management (implementation of a garbage collector), compilation of Python code, what happens when a URL is typed into the browser, what can be done to speed up a select query

  5. Difference between POST and GET.

  6. How to prevent SQL Injection virus?

  7. How to prevent Cross site visiting?

  8. a fairly large log file, about 5GB. Each line of the log file contains an url which a user has visited on our site. We want to figure out what's the most popular 100 urls visited by our users.

  9. min stack

  10. Generic classes in C++ vs Java

    • operating system, process, multi threads, memory models
  • database, in particular, SQL language
  • scripting language: python (but I think answer in perl may be okay)
  • data structure & algorithm: stack, linked-list, hashmap, tree, heap, etc.
  • security (attacking, encryption, etc.)
  • web standards/protocol: http, dns, tcp/ip, ssl, etc.
  • recursion and/or dynamic programing
  • linux knowledge/commands
  1. Operating system questions, explaining some concept like process, thread
  2. linked list or array for binary search
  3. Given a file that contains chat messages, find out the top 10 chatters in an efficient way. Assume that the usernames are unique. For example, : Howdy : Some message : Something else : I am good Nick1 is the top chatter, find nine others like this.
  4. What command would you use to retrieve one row of data from a table using SQL?
  5. What is the command for viewing memory management information in Linux?
  6. Implement a Lock.
  7. Write a function that returns a random line in a file.
  8. Diff POST/GET ? What happens if type a URL in your browser ? How cookies are working ? HTTPS ?
  9. url shortener script, data structure, basic structure, and what to do if the URL is already in the DB, what to do to get analytics ?
  10. Which operation is more expensive? Multiply, Divide or Add
  11. Best and worst case time for hash table lookup
  12. How would you find the top 10 queries Yelp receives?
  13. How does memory management work in ?
  14. Given a big list of searches, how would you write a function that returns top 10 searches?
  15. How would you use all the data at our disposal?
  16. Describe the difference between get requests and post requests
  17. What is the average disk access time?
  18. in memory, what's the difference between a primitive and object
  19. what's a way to set up a large database to find things quickly
  20. what's the difference between hashtable and hashmap?
  21. find equilibrium index
  22. Generate all permutations of an alphanumeric string
  23. Implement and explain a generator and what it can be used for
  24. Find the longest sequence of unrepeated characters in a string.
  25. Asked about the search time difference between linked list and array.
  26. How to map an IP address to a server?
  27. Database questions like inner join, indexing.
  28. String processing question
  29. Write an function to compute if a string is an anagram. Time and space complexity and how to optimize it.
  30. Building regular expressions to catch specific patterns.
  31. how do would you find and kill a process using a lot of CPU?
  32. What is Big O notation?
  33. given a huge log file and the way id find the top 10 sites in them.
  34. hashtable implementation
  35. Describe about process and thread.
  36. How does process communicate with each other?
  37. We have a fairly large log file, about 5GB. Each line of the log file contains an url which a user has visited on our site. We want to figure out what's the most popular 100 urls visited by our users.
  38. What are the different synchronization mechanisms? Difference between semaphore and mutex
  39. Reverse a singly linked linklist
  40. Unix commands -> wordcount , finding out process information
  41. Explain process after you click a URL ( on server / client side )
  42. Given a Number to guess b/w 1-100 , how to point to the number in minimum time
  43. Explain DNS resolution
  44. Usual sorting algorithm complexity ... can it be made any quicker
  45. How might you keep track of where users were coming from to get to your site?
  46. If you have less memory storage, what would you use - Hash Table or Tree? Why?
  47. Given an Array of integers, find an efficient way to determine if it contains 3 numbers that sum to 0
  48. How to merge two arrays
  49. How would you find how much system resources a process is consuming on linux.
  50. Whether to use a list or linked list to implement a search tree
  51. What is the average look-up time for a good hash-function
  52. What situation arises when you have a parent div and all it contains is a pair of floating divs? And how can you remedy the situation.
  53. Given a telephone directory which is broken in number of files, how would you find a telephone number in it.
  54. u have a table wilh user information like name,age and sex. Give a smart way to sort the entires based on age.
@dsj9890
Copy link

dsj9890 commented Jul 22, 2014

Hey do you have the answers also?? some of them ??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment