SDE1 Practice Problem
Sum up functions return value running in parallel and in sequence
Problem Description & Specifications
This interview question was asked in Intuit’s SDE2 frontend interview, where the user was asked to run functions in parallel and in sequence and evaluate there performance. The problem statement reads as: Write two functions: A() returns 2 after 2 seconds B() returns 3 after 3 seconds Return their sum in two ways: Parallel execution → Total time: 3 seconds Sequential execution → Total time: 5 seconds
Implementation & Test Harness
Editable Monaco RunnerJavaScript Lab Sandbox
/*
This interview question was asked in Intuit’s SDE2 frontend interview, where the user was asked to run functions in parallel and in sequence and evaluate there performance.
The problem statement reads as:
Write two functions:
A() returns 2 after 2 seconds
B() returns 3 after 3 seconds
Return their sum in two ways:
Parallel execution → Total time: 3 seconds
Sequential execution → Total time: 5 seconds
*/Console Output
Click "Run Code" above to execute and view output...