Search Results


26 matches found for 'search'

Search in a rotated sorted array

... example, \([0,1,2,4,5,6,7]\) might become \([4,5,6,7,0,1,2]\). You are given a target value to search. If found in the array return its index, otherwise return \(-1\). Note: You may assume no duplicate exists in the array.


Atomic operations with Elasticsearch

Preface Elasticsearch is a distributed, open source search and analytics engine for all types of data, including textual, numerical, geospatial, structured, and unstructured.


4 Line Depth-first Search

Context Depth-first search (DFS) is a common searching algorithm for graphs, alongside Breadth-first search (BFS). DFS is useful for finding ways to solve mazes.


Data stores in Software Architectures

... Service Text autocomplete is so popular that a solution was made specifically for it - search engines. These include well-known names like Elasticsearch and Solr, which are powered by Lucene under the hood.


RDBMS Indexing

... others. What is an index? An index at the most basic level has at least two columns: A search key column that this index is based on The pointer column to the actual location of the row in another table In most RDBMS implementations, you are allowed to create an index based off of a column.


String Manipulation in Python 3+

There are a few ways to search for a string in Python (3+): String operations str.find(sub[, start[, end]])] "shadow walker".find('w') => 5 This gives you the index of the first match.


Data Sharding: Twitter Posts

... among all the database servers. However, one problem with this approach is that if we need to search for a range of tweets, then we would have to query all of the servers, collate them, and sort them (assuming that we want to search by creation date) before we give them back to the client.


Build a Trie in Python

... a trie (pronounced "try"), also called digital tree, radix tree or prefix tree, is a kind of search tree—an ordered tree data structure used to store a dynamic set or associative array where the keys are usually strings.


Intro to Python Lambda

... at another lambda function that deals with A.I. heuristics. Material: http://ai.berkeley.edu/search.html h = lambda x: heuristic(x[0], problem) heuristic is a function that takes in a node, and the search problem.


CSR vs. SSR

... found that every 100ms of latency cost them 1% in sales. Google found an extra .5 seconds in search page generation time dropped traffic by 20%. A broker could lose $4 million in revenues per millisecond if their electronic trading platform is 5 milliseconds behind the competition.


Algorithm Interview Problems

Welcome This page contains solutions to common interview problems that may be encountered. Arrays Longest Substring Without Repeating Characters Rotate a 2D Matrix Buy/Sell Two Stocks Merge Intervals Next Permutation Random Permutation Replace all occurrences of a space with a string Linked Lists Reversing sublists of singly linked lists Cycles in singly linked lists Overlapping singly linked lists Merging two sorted singly linked lists Merge k sorted lists Recursion Counting the path of sums Money Denominations Phone Number Mnemonics Unique Permutation Dynamic Programming Perfect Squares Find the Maximum Min Path Binary Trees Tree Symmetry Iterative In-Order Traversal of a Binary Tree Construct a Binary Tree from Pre-Order Traversal and In-Order Traversal BST Validate a BST Binary Heaps Merge k sorted lists Graphs Find a path in a maze from start to finish Flip colors in a matrix Search Search in a rotated sorted array Find the Duplicate Number Greedy Algorithms Queue Reconstruction By Height Trie Build a Trie in Python Invariant Compute the max.


DataFrames (a software engineer's perspective)

... memory overhead. DataFrames for very large datasets (i.e., 100GB+) can be very slow to index and search through. Libraries There are several different implementations of DataFrames.


Web Development 101

... based, which can be limiting for more complex lookups. It effectively doesn't lend itself well to search like operations, often needing more than one network call (or REST API call) to do the job.


NumPy vs. Pandas, and other flavors (Dask, Modin, Ray)

... memory overhead. DataFrames for very large datasets (i.e., 100GB+) can be very slow to index and search through. For more details, see here. NumPy and Pandas For experienced data scientists, you may realize that these two libraries are often used in conjunction, rather than in isolation.


Scanning for memory addresses with Cheat Engine and ZSNES

Cheat Engine (CE) is an open source memory scanner/hex editor/debugger that works for Windows applications. Another way to put it is that CE is used to explore the memory that is dynamically allocated (by Windows) in games.


Local Secondary Index vs. Global Secondary Index

... the local secondary index, the global secondary index can be partitioned by some term (taken from search engines such as Elasticsearch). A term here would be a field in a Document database, or a column in RDBMS.


Symmetry in a Tree

... // set left child ct.layout(); Problem Given a binary tree (not necessarily a binary search tree), check if the tree is symmetric. A tree is symmetric if the nodes on the left mirror the nodes on the right.


Useful Links

... Machine Learning MLU Frameworks, Libraries, Stacks PostgreSQL Full text search in milliseconds with PostgreSQL psql and hostname Manual reload Django Checklist to Build Great Reusable Django Apps PNG vulnerability (~1.


Flip adjacent colors in a 2D matrix

... as the entry color), and these points may be color-grouped in big lumps. It is much better to search the points closest to the entry point first. This makes BFS an excellent choice.


Algorithm Handbook

... in-degree and out-degree. Tries Pronounced "try-es" Faster alternative to string searching, but can be space heavy. Basically a tree of nodes with R pointers (hence a R-tree), where R is the number of distinct characters that can be used (Radix).


P vs. NP

... NP set, because P problems can also check their solutions efficiently (on top of being able to search for a solution efficiently). var jsav = new JSAV("set"); var c1 = jsav.


Find the duplicate number

... \(3\). At \(i = 3\), \(A[i] = 1\), so replace with this value with the former \(3\) and then search for index \(1\) now. At \(i = 1\), \(A[i] = 1\), which is a duplicate since \(i = A[i]\), so we return \(i\).


Build a Binary Tree with Pre-order and In-order traversal data

... determine the left and right borders of the preorder and inorder arrays (similar to a binary tree search) instead of creating new sub-arrays.


Next Permutation

... that is not in descending order from the right (call the index, \(swap_i\)), we'll have to search the right side now for an element that is just larger than that element. This entails that we traverse all the way back to the end of the array.


Machine Learning Basics

... function and is normally a hand-coded function. For example, the A* algorithm uses heuristics for searching. At its core, it is a helper function. In a ML context, it is not based on a model obtained by training on a data set, but typically embodies some common-sense expertise from domain experts.


Misconceptions of Software Engineer interviews at FAANG

... studying. Core concepts will always trump niche knowledge such as Math tricks with pow/modulo or searching substrings using Rabin-Karp. Things like bitwise operators and multi-threading can also fall into the niche category and will usually depend on the role you apply for.