Right Rotate an array by k elements
An array of elements is given arr arr is of length n Right rotate array by k elements Time complexity […]
Master fundamental and advanced algorithms essential for technical interviews at top companies. This category covers sorting algorithms, search algorithms, graph algorithms, and optimization techniques that form the foundation of computer science problem-solving.
What You’ll Learn:
Sorting algorithms: Quick sort, merge sort, heap sort
Search techniques: Binary search and variations
Graph algorithms: DFS, BFS, Dijkstra’s, topological sort
Optimization: Dynamic programming, greedy algorithms
Time and space complexity analysis
Difficulty Progression: Start with basic sorting and searching, then progress to graph algorithms and dynamic programming.
Interview Frequency: Extremely high – algorithms appear in 80%+ of technical interviews at Google, Amazon, Facebook, Microsoft, and Apple.
An array of elements is given arr arr is of length n Right rotate array by k elements Time complexity […]
A typical programming interview question is “reverse a string, in place”. if you understand pointers, the solution is simple. even
problem: two trains enter a tunnel 200 miles long (yeah, its a big tunnel) travelling at 100 mph at the
Problem: write the definition for this function without using any built-in functions. if pStr is null, return 0. if pStr
Problem: this year on October 2, 2001, the date in MMDDYYYY format will be a palindrome (same forwards as backwards).10/02/2001when
Problem: you are given a sequence of numbers from 1 to n-1 with one of the numbers repeating only once.
This is a card trick without the trick. there is no sleight of hand, no tricks up my sleeve, no
Part I: draw a square. divide it into four identical squares. remove the bottom left hand square. now divide the
Five webloggers – joshua Allen, meg Hourihan, jason Kottke, robert Scoble, and joel Spolsky – were competing for karma points
A one armed surgeon with a hand wound needs to operate on three patients. the surgeon only has two gloves.
You find an old treasure map in your grandma’s attic. the map shows a cannon, a coconut tree, and a
This is difficult to describe in words, so read this carefully, lest there be any confusion. You have a normal
A person dies, and arrives at the gate to heaven. there are three doors. one of them leads to heaven.
Every night, I dump all the change in my pocket into a big bucket. When I buy things, I never
The warden meets with 23 new prisoners when they arrive. He tells them, “You may meet today and plan a