4

BigO for technical interviews

 2 years ago
source link: https://dev.to/coderbyte/bigo-for-technical-interviews-3ij9
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Cover image for BigO for technical interviews

BigO for technical interviews

May 18

・2 min read

When preparing for upcoming technical interviews (especially for software engineering roles at FAANG companies), you might practice by solving coding challenges online and preparing by solving common interview questions.

One of our previous articles lists some common platforms where you can practice coding, like:

Big-O is an important concept you'll come across when learning about algorithms and data structures.

Big-O notation is used to classify algorithms according to how their run time or space requirements grow as the input size grows.

Coderbyte is the only platform where the runtime analysis for your solutions is generated and expressed in Big-O notation automatically in your profile. Below is a screenshot of how it'll look on your profile after solving a coding challenge.

function FindIntersection(strArr) { 
  let arr1= strArr[0].split(', ');
  let arr2 = strArr[1].split(', ');
  let intersArr= [];
  for (i = 0; i < arr1.length; i++) {
    if (arr2.includes(arr1[i])) {
      intersArr.push(arr1[i])
    }
  }
  return intersArr.toString();
}
Enter fullscreen modeExit fullscreen mode

When you submit a solution for a challenge and it passes all the test cases, your solution is then sent to our runtime-analysis server where we run a series of progressively larger test cases, and then statistically determine what runtime trajectory it matches. We currently will return one of the following common Big-O results.

We open-sourced our code for this as well (written in TypeScript) so you can learn how it works!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK