Skip to content

Instantly share code, notes, and snippets.

@barretts
barretts / getAppliedJobInfo.js
Created March 26, 2025 03:29
get applied job information from LinkedIn
function extractJobs(linkedInResponse) {
const jobs = [];
const jobElements = linkedInResponse?.data?.data?.searchDashClustersByAll?.elements?.[0]?.items || [];
const jobDetails = linkedInResponse?.included || [];
jobElements.forEach(({ item }) => {
const entityUrn = item?.["*entityResult"];
if (!entityUrn) return;
@barretts
barretts / undirectedGraphNodeComponents.js
Last active March 31, 2025 23:08
turning interview questions into learning opportunities
/*
Given n, i.e. total number of nodes in an undirected graph numbered
from 1 to n and an integer e, i.e. total number of edges in the
graph. Calculate the total number of connected components in the graph.
A connected component is a set of vertices in a graph that are linked
to each other by paths.
O(E^2 log E)
mine un-sorted: 15421ms
mine un-sorted and Set nodes: 41ms