All Questions
6 questions
2
votes
3
answers
1k
views
Find the 'n' most frequent words in a text, aka word frequency
I'm doing freeCodeCamp's Coding Interview Prep to improve my JavaScript skills. This challenge is called "Word Frequency", and is based on the Rosetta Code's entry of the same name.
The ...
2
votes
0
answers
628
views
Cron expression parser
Problem
Write a command line application or script which parses a cron string and expands each field
to show the times at which it will run.
~$ your-program "*/15 0 1,15 * 1-5 /usr/bin/find"...
3
votes
1
answer
580
views
Find the largest product of an array
This task is taken from www.interviewbit.com
Given an array of integers, return the highest product possible by
multiplying 3 numbers from the array
Input:
...
5
votes
3
answers
1k
views
Print out N by N Spiral Matrix in javascript
I got this question during my practice interview.
Matrices - N Spiral Matrix
Prompt
Given an integer N, output an N x N spiral matrix with integers 1 through N.
Examples:
...
1
vote
1
answer
916
views
Hackerrank "Queues: A Tale of Two Stacks" Javascript Solution
Here is the original problem, and below is my solution (passing). It's asking to implement a queue with 2 stacks, which means I cannot simply use Array.shift. I wonder if the solution can be improved. ...
18
votes
4
answers
2k
views
O(N) vs O(N * N) for Word Frequency Algorithm
I am trying to come up with a better solution to the following problem:
Statement
You are supposed to write a function which takes the contents of a document in string format and also a whole ...