Learned or Solved Something Today?

Dump it here! Let others learn from you

Write a javascript hack
Showing 20 of 253 from page 1

metabox posted in #javascript #codingchallenge #interviewquestion #facebook

[Solution] Matrix-num-paths | Facebook Interview Question

This problem was asked by Facebook. There is an N by M matrix of zeroes. Given N and M, write a function to count the number of ways of starting at the top left corner and getting to the bottom right

metabox posted in #javascript #codingchallenge #interviewquestion

[Solution] Division-without-divide | Interview Question

Implement division of two positive integers without using the division, multiplication, or modulus operators. Return the quotient as an integer, ignoring the remainder. Idea behind the solution The id

metabox posted in #javascript #codingchallenge #interviewquestion #amazon

[Solution] Words-per-line | Amazon Interview Question

This problem was asked by Amazon. Given a string s and an integer k, break up the string into multiple lines such that each line has a length of k or less. You must break it up so that words don t bre

metabox posted in #javascript #codingchallenge #interviewquestion #google

[Solution] Implementing an LRU (Least Recently Used) cache | Google Interview Question

This problem was asked by Google. Implement an LRU Least Recently Used cache. It should be able to be initialized with a cache size n, and contain the following methods set key, value sets key to valu

metabox posted in #codingchallenge #javascript #interviewquestion #google

Solution for Knights Tour problem | Google Interview Question

This problem was asked by Google. A knight s tour is a sequence of moves by a knight on a chessboard such that all squares are visited once. Given N, write a function to return the number of knight s

metabox posted in #javascript #twitter #codingchallenge #interviewquestion

[Solution] max-subarray-contiguous-sum | Twitter Interview Question

This problem was recently asked by Twitter You are given an array of integers. Find the maximum sum of all possible contiguous subarrays of the array. Example 34, 50, 42, 14, 5, 86 Given this input ar

metabox posted in #javascript #codingchallenge #interviewquestion #microsoft

[Solution] read7 | Microsoft Interview Question

This problem was asked Microsoft. Using a read7  method that returns 7 characters from a file, implement readN n  which reads n characters. For example, given a file with the content “Hello world”, th

metabox posted in #javascript #codingchallenge #interviewquestion #microsoft

[Solution] Finding word in the matrix | Microsoft Interview Question

This problem was asked by Microsoft. Given a 2D matrix of characters and a target word, write a function that returns whether the word can be found in the matrix by going left to right, or up to down.

metabox posted in #javascript #codingchallenge #interviewquestion #microsoft

[Solution] Implement a URL shortener | Microsoft Interview Question

This problem was asked by Microsoft. Implement a URL shortener with the following methods shorten url , which shortens the url into a six character alphanumeric string, such as zLg6wl. restore short ,

metabox posted in #javascript #codingchallenge #interviewquestion #microsoft

[Solution] Operation Tree | Microsoft Interview Question

This problem was asked by Microsoft. Suppose an arithmetic expression is given as a binary tree. Each leaf is an integer and each internal node is one of + , − , ∗ , or . Given the root to such a tree

metabox posted in #javascript #interviewquestion #microsoft #codingchallenge

[Solution] Finding perfect number (digits-sum-10) | Microsoft Interview Question

This problem was asked by Microsoft. A number is considered perfect if its digits sum up to exactly 10. Given a positive integer n, return the n th perfect number. For example, given 1, you should ret

metabox posted in #javascript #codingchallenge #interviewquestion #google

[Solution] Finding deepest node of a binary tree | Google Interview Question

This problem was asked by Google. Given the root of a binary tree, return a deepest node. For example, in the following tree, return d. a b c d Idea behind the solution For this problem we just need t

metabox posted in #javascript #codingchallenge #google #interviewquestion

[Solution] constant-time-sort | Google Interview Question

This problem was recently asked by Google Given a list of numbers with only 3 unique numbers  1, 2, 3 , sort the list in O n  time. Example 1 Input   3, 3, 2, 1, 3, 2, 1  Output   1, 1, 2, 2, 3, 3, 3

metabox posted in #javascript #codingchallenge #facebook #interviewquestion

[Solution] Best-Multiply-In-Array | Facebook Interview Question

This problem was asked by Facebook. Given a list of integers, return the largest product that can be made by multiplying any three integers. For example, if the list is  10, 10, 5, 2 , we should retur

metabox posted in #javascript #facebook #interviewquestion #codingchallenge

[Solution] Best-Buy-Sell-Price | Facebook Interview Question

This problem was asked by Facebook. Given a array of numbers representing the stock prices of a company in chronological order, write a function that calculates the maximum profit you could have made

metabox posted in #javascript #codingchallenge #amazon #interviewquestion

[Solution] Espiral matrix print | Amazon Interview Question

Here s your coding interview problem for today. This problem was asked by Amazon. Given a N by M matrix of numbers, print out the matrix in a clockwise spiral. For example, given the following matrix

azrina posted in #html #css #javascript #project #beginners

Simple But amazing Animated Eyes Follow Mouse Cursor using Vanilla Javascript

Naturally, we humans are happy to see other people in danger, Which is not desirable at all, This project is like my protest against this type of mentality. This is a very simple but cute looking Anim

metabox posted in #javascript #java #nodejs #snippets

Beautify Java Code With Prettier In Node.JS | Javascript Example

Prettier is an opinionated code formatter which support many languages. In this example we will see how to prettify java code. NPM Modules We need Prettier Prettier Java NPM Installation npm install s

metabox posted in #javascript #nodejs #file #tutorial

Axios Download Binary Files (PDF, Images, TXT etc) In Node.JS Environment | Implementing Your own loader

Here s a simple downloadFile function to download any file using axios in Node JS How To Implement the Axios File Download in Node js Axios is a great http library for both browser and node js If you

bytebot posted in #js #javascript #tutorial #array

H Index II - Javascript Solution

H Index II is an example of Array problems In this post we will see how we can solve it in Javascript Problem Description H Index II Given an array of citations sorted in ascending order each citation

fb