webdev: (Default)
[personal profile] webdev
Over on his blog Arden Dertat has an excellent series of articles about common interview questions and their solutions. He discusses multiple solutions for almost every problem and talks about their complexities and other advantages and disadvantages. They're a really excellent series of articles and I highly recommend them.

Arden has done many of the solutions in Python or C. I decided it would be helpful to review the questions and present solutions in JavaScript, especially where JavaScript provides its own solutions that Python or C do not. After all, web application development often employs many of the techniques these questions illustrate: string and array manipulation, basic data structures, algorithms and optimization. I won't repeat Arden's excellent discussions of the details (I doubt I could do better), but I will be adding my own observations. I'll also be posting my code on Github as I go.

If anyone has worked through these examples in another language--even if it's just a repo on Github--let me know!

Question 1: Array Pair Sum. Given an array of random integers, output the pairs that add to a given number k.

Question 2: Matrix Region Sum. Given a matrix of integers and coordinates of a rectangular region within the matrix, find the sum of numbers inside the rectangle.

Question 3: Largest Continuous Sum of an Array. Given an array of positive and negative integers, find the largest continuous sum.
From:
Anonymous (will be screened)
OpenID (will be screened if not validated)
Identity URL: 
User
Account name:
Password:
If you don't have an account you can create one now.
Subject:
HTML doesn't work in the subject.

Message:

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org


 
Notice: This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.

Profile

webdev: (Default)
Jon Reid

October 2013

S M T W T F S
  12 345
6789101112
13141516171819
20212223242526
272829 3031  

Links