/aync-coding-challenges

playground for practicing async code.

Primary LanguageJavaScript

Getting Started

  • npm install
  • npm test

JavaScript interview code challenges on Asynchronous programming - challenges

(#Q1) Print "Hello, world" with a delay of 3 seconds (#Q2) Create a function which receives a function as argument and executes it after 2 seconds (#Q3) Print numbers from 1 to 10 with delay of 1 second between each value being printed (#Q4) Print numbers from 1 to 10 with delay of 1 second between each value being printed using setInterval (#Q5) Print numbers from 10 to 1 with delay of 1 second between each value being printed using setTimeout using pre ES6 features only (#Q6) Write a utility which prints numbers starting from an initial value and increment in steps which can be started and stopped by the user, any number of times (#Q7) Execute an array of asynchronous functions one after the other in sequence using callbacks (#Q8) Execute the given list of asynchronous functions in parallel and return the results as an array to the callback (#Q9) Execute 3 asynchronous functions one after the other in sequence using promise chaining (#Q10) Execute 3 asynchronous functions one after the other in sequence using async await (#Q11) Execute 3 asynchronous functions one after the other in sequence using promise chaining and do not terminate on failure (#Q12) Execute 3 asynchronous functions one after the other in sequence using async await and do not terminate on failure (#Q13) Execute an array of asynchronous functions which returns a promise, one after the other in sequence (#Q14) Execute an array of asynchronous functions simultaneously but print the output in the ordered sequence. Do not wait for printing the data if it already available after promise is settled (#Q15) Design a utility which takes array of asynchronous functions and returns the 1st successful or non successful result with max waiting time set by the user (#Q16) Design a utility which takes URL and a value for attempts which will attempt to make a fetch request. If on failure it tries again with increasing delay for number of times which user has requested (#Q17) Create a generator to return a random number on every request (#Q18) Search for the presence of a given value in the nested object using generator