When I am curious about an algorithm, I implement it. My goal is understanding, not production quality, so I don't mind making simplifying assumptions as long as the essential complexity of the algorithm remains. When I really want to understand it, I then teach the algorithm to someone else.
I don't worry about "reinventing the wheel". As long as the investment is relatively small, the value of increasing my own confidence is worth it. Plus it's just fun.
Where do I start?
I’m a huge financial nerd, and have spent an embarrassing amount of time talking to people about their money habits.
Here are the biggest mistakes people are making and how to fix them:
Not having a separate high interest savings account
Having a separate account allows you to see the results of all your hard work and keep your money separate so you're less tempted to spend it.
Plus with rates above 5.00%, the interest you can earn compared to most banks really adds up.
Here is a list of the top savings accounts available today. Deposit $5 before moving on because this is one of th
Where do I start?
I’m a huge financial nerd, and have spent an embarrassing amount of time talking to people about their money habits.
Here are the biggest mistakes people are making and how to fix them:
Not having a separate high interest savings account
Having a separate account allows you to see the results of all your hard work and keep your money separate so you're less tempted to spend it.
Plus with rates above 5.00%, the interest you can earn compared to most banks really adds up.
Here is a list of the top savings accounts available today. Deposit $5 before moving on because this is one of the biggest mistakes and easiest ones to fix.
Overpaying on car insurance
You’ve heard it a million times before, but the average American family still overspends by $417/year on car insurance.
If you’ve been with the same insurer for years, chances are you are one of them.
Pull up Coverage.com, a free site that will compare prices for you, answer the questions on the page, and it will show you how much you could be saving.
That’s it. You’ll likely be saving a bunch of money. Here’s a link to give it a try.
Consistently being in debt
If you’ve got $10K+ in debt (credit cards…medical bills…anything really) you could use a debt relief program and potentially reduce by over 20%.
Here’s how to see if you qualify:
Head over to this Debt Relief comparison website here, then simply answer the questions to see if you qualify.
It’s as simple as that. You’ll likely end up paying less than you owed before and you could be debt free in as little as 2 years.
Missing out on free money to invest
It’s no secret that millionaires love investing, but for the rest of us, it can seem out of reach.
Times have changed. There are a number of investing platforms that will give you a bonus to open an account and get started. All you have to do is open the account and invest at least $25, and you could get up to $1000 in bonus.
Pretty sweet deal right? Here is a link to some of the best options.
Having bad credit
A low credit score can come back to bite you in so many ways in the future.
From that next rental application to getting approved for any type of loan or credit card, if you have a bad history with credit, the good news is you can fix it.
Head over to BankRate.com and answer a few questions to see if you qualify. It only takes a few minutes and could save you from a major upset down the line.
How to get started
Hope this helps! Here are the links to get started:
Have a separate savings account
Stop overpaying for car insurance
Finally get out of debt
Start investing with a free bonus
Fix your credit
If I understood your question it goes on something like this: "how do I know all the answers when I'm asked?" And the answer is: either you know it, or you don't. And the only way to know it is because you tried it before and it worked within the same circumstances.
Programming is a craft. It's a profession of practice. And the only way to know is practice. Repeat many things many times and keep experimenting new things even if you know a way that works right now. Relentlessly, continuously, all the time, forever.
There is absolutely no "line" to be drawn. Stop the process and you're obsolete a
If I understood your question it goes on something like this: "how do I know all the answers when I'm asked?" And the answer is: either you know it, or you don't. And the only way to know it is because you tried it before and it worked within the same circumstances.
Programming is a craft. It's a profession of practice. And the only way to know is practice. Repeat many things many times and keep experimenting new things even if you know a way that works right now. Relentlessly, continuously, all the time, forever.
There is absolutely no "line" to be drawn. Stop the process and you're obsolete as of right now. And that's exactly how this profession is supposed to be. No amount of certifications, diplomas, or whatever can replace continuous improvement.
IMHO, we should never be in a rat race. Do something only because you love to do it and it excites you, pleasures you. Appreciate the beauty in algorithms.
There is no need to reinvent the wheel, I agree, but there is more important reasons why they focus on your algorithm knowledge. To understand that, there could not a better article than this
The Law of Leaky Abstractions
Basically the law states and boils down to one point that, though you don't have to reinvent the wheel, you have to understand how it is made and how it works dot
None. Not one. Or more precisely, I wouldn’t ask him about any.
(I use the male pronouns below, because I find it awkward to be gender neutral — and besides, the actual candidate identified as male.)
When I interview someone, I want to know what he’s done, how he’s done it, how he thinks.
Me: Tell me about a project you’ve worked on.
Him: I developed a system for the control of a five stand copper rolling mill for a system integrator.
Me: What was your role in the project?
Him: I was brought onto the project after a previous developer worked on a time and material basis for many months and delivered
None. Not one. Or more precisely, I wouldn’t ask him about any.
(I use the male pronouns below, because I find it awkward to be gender neutral — and besides, the actual candidate identified as male.)
When I interview someone, I want to know what he’s done, how he’s done it, how he thinks.
Me: Tell me about a project you’ve worked on.
Him: I developed a system for the control of a five stand copper rolling mill for a system integrator.
Me: What was your role in the project?
Him: I was brought onto the project after a previous developer worked on a time and material basis for many months and delivered nothing. The client and I met multiple times and hammered out a hardware design. We chose to use three Z-80 microprocessors. One controlled the first three stand, a second controlled the last two stands, and the third handled the overall command and control of the system. I chose the processor, defined the hardware interfaces, and was the sole software developer.
Me: Tell me about the software.
Him: The software was written in assembly language. I developed a real-time task scheduler — there’s a paper by Butler Lampson with the outline of a design I stole — that was installed on the three processors. The task scheduler is interrupt driven, has a real-time clock driver, serial drivers, and drivers for the display and input devices. It has sixteen priority levels.
Me: How did the scheduler decide which task to run next?
Him: There are sixteen queues, one for each priority. Each queue is organized as a linked list. There are two cases where we must decide which task to run next.
In the first case, a task needs to wait for some event and relinquishes the processor. The running task is no longer ready and is taken off the corresponding priority queue. In that case, we look at the task control block (TCB) for the currently running task to determine which priority queue it is on. Since it is always the first entry on its queue (otherwise it wouldn’t be running), that’s pretty simple. We take the next entry from that queue. (Only tasks that are ready to run are on the queue.) If the queue is empty, we advance to the next lower priority queue. There will always be at least one lower priority task to run because there is an idle task that is always ready.
In the second case, an interrupt or the currently running task causes another task to become ready. The task control block tells us the priority of of the new task. We place that entry on the queue for that priority. If the task is lower priority than the current task, nothing needs to be done. If it is higher priority, the context of the current task is saved in its TCB and the new task is started.
That’s the way I do a technical interview. I would continue to ask about the structure of TCBs, how they relate to priority queues, how the real-time clock event queue is managed, when I have to disable interrupts or use mutexes, etc. I start at the top and drill down into the details.
Notice that I don’t ask about structures and algorithms in the abstract. I ask to tell me about how something was done. If he used some specific structures or algorithms I will learn something about him. If he tells me that he used a red-black tree to maintain a priority queue where there were only sixteen priorities and a total of thirty tasks, that would tell me something.
For what it’s worth, the candidate I was interviewing was myself. The answers I gave were reasonably accurate considering that the project was done when a Z-80 was a new device.
With today’s modern day tools there can be an overwhelming amount of tools to choose from to build your own website. It’s important to keep in mind these considerations when deciding on which is the right fit for you including ease of use, SEO controls, high performance hosting, flexible content management tools and scalability. Webflow allows you to build with the power of code — without writing any.
You can take control of HTML5, CSS3, and JavaScript in a completely visual canvas — and let Webflow translate your design into clean, semantic code that’s ready to publish to the web, or hand off
With today’s modern day tools there can be an overwhelming amount of tools to choose from to build your own website. It’s important to keep in mind these considerations when deciding on which is the right fit for you including ease of use, SEO controls, high performance hosting, flexible content management tools and scalability. Webflow allows you to build with the power of code — without writing any.
You can take control of HTML5, CSS3, and JavaScript in a completely visual canvas — and let Webflow translate your design into clean, semantic code that’s ready to publish to the web, or hand off to developers.
If you prefer more customization you can also expand the power of Webflow by adding custom code on the page, in the <head>, or before the </head> of any page.
Trusted by over 60,000+ freelancers and agencies, explore Webflow features including:
- Designer: The power of CSS, HTML, and Javascript in a visual canvas.
- CMS: Define your own content structure, and design with real data.
- Interactions: Build websites interactions and animations visually.
- SEO: Optimize your website with controls, hosting and flexible tools.
- Hosting: Set up lightning-fast managed hosting in just a few clicks.
- Grid: Build smart, responsive, CSS grid-powered layouts in Webflow visually.
Discover why our global customers love and use Webflow | Create a custom website.
Let me make an analogy.
Mathematics at the undergraduate level is not that hard if you have the knack for it, because it’s pure logic.
Economics can be quite complex because it combines math with subject matter. However, the math in economics is very simple. Overall, that makes the study of economics non-trivial, but not too hard either.
Physics, on the other hand, can be very hard. It combines advanced math with complex subject matter.
Algorithms in computer science are like math. Just pure logic. It’s when you apply them to real-world problems that things become difficult.
The programming equival
Let me make an analogy.
Mathematics at the undergraduate level is not that hard if you have the knack for it, because it’s pure logic.
Economics can be quite complex because it combines math with subject matter. However, the math in economics is very simple. Overall, that makes the study of economics non-trivial, but not too hard either.
Physics, on the other hand, can be very hard. It combines advanced math with complex subject matter.
Algorithms in computer science are like math. Just pure logic. It’s when you apply them to real-world problems that things become difficult.
The programming equivalent of physics is something like a large distributed system that operates within a complex domain. Not only does it involve advanced algorithmic problems, but one also has to deal with how these algorithms interact with the specific quirks of the domain.
There are different kinds of difficult.
I’m going to focus on two kinds of difficult algorithm.
One is difficult to manage and sometimes even difficult to spot, though not difficult to implement.
The other is a group of algorithms that can be very varied and complex, and also overlaps with the first group.
I would first like to nominate
Computationally complex algorithms.
Starting with any intractable or NP/NP-hard/NP-complete problem.
Because there are actual physical hardware constraints that prevent them from being solved in reasonable time, and you may not always know you’re working on one.
Wh
There are different kinds of difficult.
I’m going to focus on two kinds of difficult algorithm.
One is difficult to manage and sometimes even difficult to spot, though not difficult to implement.
The other is a group of algorithms that can be very varied and complex, and also overlaps with the first group.
I would first like to nominate
Computationally complex algorithms.
Starting with any intractable or NP/NP-hard/NP-complete problem.
Because there are actual physical hardware constraints that prevent them from being solved in reasonable time, and you may not always know you’re working on one.
Why? Because they’re deceptively simple brute force algorithms, easy to code, and it would seem, easy for a computer to handle, but they can quickly become unwieldy and slow down your code as the input data increases.
Even a simple O(n^2) problem where the time taken to solve is the square of the data points you’re working on, can give you problems.
Want to code a bullet hell game in C with 50,000 objects on screen? No problemo.
Now try doing collision detection between those objects, and suddenly you’re checking (50,000^2)/2 or 1.25 billion possible collisions.
So the algorithm itself isn’t hard, but you need to understand its computational complexity and find shortcuts like grid based or quad tree collision.
Large numbers of objects usually isn’t an issue for a CPU, but you start connecting those objects together and the number of connections will be an issue.
And this brings me to the second category of difficult problems I’d like to nominate:
Graph based algorithms.
(Which also overlaps with the first quite a bit, plenty of your intractable problems will be found here)
These are algorithms that work on graph structures, which can be visually and structurally complex, as well as requiring computationally complex solutions:
You’re no longer dealing with a list/array or grid of data points, but a complex structure with connections.
You have to generalise your algorithm to work for all structures, or categorise them with one algorithm (Is it a complete graph? is it planar? does it have circuits? or is it a tree?) and approach them differently.
They get very feisty very quickly. This is about 100 data points:
Because there are so many different forms they can take, there is a lot to learn, even the most basic graph theory from a mathematical point of view, gives us a lot of algorithms to study.
Sedgewick’s Algorithms parts 1–4 came in one volume:
Part 5, Graph Algorithms, was a second volume:
That I think says a lot.
—————————-
Edit - so I really appreciate the upvotes and shares.
I should probably also mention some other types of challenging algorithm that aren’t covered by computationally complex or graph algorithms. Those two alone cover a lot, but there are still a few areas that pose their own unique challenges.
- Parallel programming, which breaks down into things like:
- Distributed programming, for multiple machines.
- Multithreading, for multiple CPUs and cores in one machine.
- Parallel at the hardware level, like GPU shaders.
- There’s also asynchronous programming, like for example the game engine Godot, that splits up functionality into different servers, or even just dealing with async operations on a webpage.
Each of the above provides challenges, and requires the use of a completely different approach due to the parallel nature of the system. Either you don’t have access to the surrounding operations, as with c) above, or you’re working with events that don’t have a specified order, as with d), and in the case of a) and b) it could be both.
Shaders are the most incredible programs and the purest expression of parallel algorithms at work, but they can be very tricky to work with. A fragment shader outputs just one pixel, and has no idea what the adjacent pixels are doing. The reason for the odd constraints is the speed.
A 4k screen at 120fps is 120x3840x2160 or 995,328,000 pixels that need to be shaded per second, so just under a billion pixels per second for a modern GPU to run a 4k screen at 120fps
..And that's the entire shader, each one could be hundreds of instructions long.
2. Then there’s Functional Programming, which in some ways is less about the algorithms and more about how they are implemented and combined, though it does have its roots in Category Theory, and while the basics are easy to grasp, at the deep end it gets very abstract.
It is all about using functions as building blocks, but also, using them as a datatype in higher order functions (see metaprogramming below) using sequences of functions and combining them to create bigger functions (currying) and then there are monads, and if I told you that: “a monad is just a monoid in the category of endofunctors”, you would be as confused as I am.
Lisp was the first well know functional language, but Haskell is more modern and I guess purer in its approach. Though you can use functional paradigms in other modern languages, Java and C++ have added functional operations now, and Javascript has kinda had it from the beginning, with it’s functions being datatypes or first class citizens.
I personally prefer a language that allows it but doesn’t force it on you.
3. Finally, there’s Metaprogramming. Programs that work on code, or create/modify their own code. Related to that is Self-Reference, Recursion, Reflection, Introspection, Quines, Higher Order Functions, Genetic Programming and Code as Data in general.
There’s a lot of jargon there for those that want to take a deeper dive.
In simple terms, algorithms that treat programs as data are a massive rabbit hole, and by their very nature can be incredibly complex and difficult, but also one of the most fascinating areas of software development.
I also think it’s an area that that has the most potential to yield new technologies and will open up more areas of research in AI when the current trends have died down.
See my answer here:
It is only beneficial if you need it.
Otherwise it would be a lot smarter to practice the skills you actually need first.
I have never been asked a single algorithm question during an interview. And I also never asked algorithm questions if I interview someone.
The reason is simple: None of the work that I do or that anyone in my team does requires algorithms.
So I ask about stuff that I know they will need when working in the company:
Multithreading, Localization, Libraries, Architecture, Network protocols, REST APIs, Framework usage, byte twiddling and math and so on.
So no, dont learn random algo
It is only beneficial if you need it.
Otherwise it would be a lot smarter to practice the skills you actually need first.
I have never been asked a single algorithm question during an interview. And I also never asked algorithm questions if I interview someone.
The reason is simple: None of the work that I do or that anyone in my team does requires algorithms.
So I ask about stuff that I know they will need when working in the company:
Multithreading, Localization, Libraries, Architecture, Network protocols, REST APIs, Framework usage, byte twiddling and math and so on.
So no, dont learn random algorithms, learn something useful.
After you have all that down, you can learn algorithms. For yourself, cause I dont care.
There are libraries out there filled with algorithms, the chance you have to write a new one is exactly 0%.
People usually say data structures and algorithms in one same breadth but the coding interview tests slightly different things. Algorithms, the proper use of data structures, some form of pattern recognition / know-how on how to deal with certain forms problems and to some extent domain knowledge.
For algorithms proper, the candidate should know:
- sorting, especially merge sort,
- binary search, tree traversal
- graph traversal - DFS, BFS
- recursion/backtracking, dynamic programming
Candidates should then know when to use / what to do with various data structures like linked lists, arrays, trees, hashes,
People usually say data structures and algorithms in one same breadth but the coding interview tests slightly different things. Algorithms, the proper use of data structures, some form of pattern recognition / know-how on how to deal with certain forms problems and to some extent domain knowledge.
For algorithms proper, the candidate should know:
- sorting, especially merge sort,
- binary search, tree traversal
- graph traversal - DFS, BFS
- recursion/backtracking, dynamic programming
Candidates should then know when to use / what to do with various data structures like linked lists, arrays, trees, hashes, stacks/queues/heaps and then have some sort of idea of how to use these data structures in an interview. For instance, a pattern which is often used with linked lists is the idea of a slow pointer and a fast pointer. This isn’t really part of the definition of a linked lists but so many linked list problems expect a fast pointer. Likewise, if you have an array of items, you may need to loop through them, some times you need to maintain a left and a right index, sometimes you have to manage nested loop.
Often times the coding exercise represents the world with one data structure which is not useful. The candidate may have to see that there is a much better way to organize the data. For instance, sometimes a graph is a hash table where a key corresponds to a value or another hash table. Sometimes it is an array of values and an array of links between these values. While it’s not too hard to shift from one of these representation to the other, sometimes one would make the exercise much easier.
Here’s the thing: I wish I had known these money secrets sooner. They’ve helped so many people save hundreds, secure their family’s future, and grow their bank accounts—myself included.
And honestly? Putting them to use was way easier than I expected. I bet you can knock out at least three or four of these right now—yes, even from your phone.
Don’t wait like I did. Go ahead and start using these money secrets today!
1. Cancel Your Car Insurance
You might not even realize it, but your car insurance company is probably overcharging you. In fact, they’re kind of counting on you not noticing. Luckily,
Here’s the thing: I wish I had known these money secrets sooner. They’ve helped so many people save hundreds, secure their family’s future, and grow their bank accounts—myself included.
And honestly? Putting them to use was way easier than I expected. I bet you can knock out at least three or four of these right now—yes, even from your phone.
Don’t wait like I did. Go ahead and start using these money secrets today!
1. Cancel Your Car Insurance
You might not even realize it, but your car insurance company is probably overcharging you. In fact, they’re kind of counting on you not noticing. Luckily, this problem is easy to fix.
Don’t waste your time browsing insurance sites for a better deal. A company called Insurify shows you all your options at once — people who do this save up to $996 per year.
If you tell them a bit about yourself and your vehicle, they’ll send you personalized quotes so you can compare them and find the best one for you.
Tired of overpaying for car insurance? It takes just five minutes to compare your options with Insurify and see how much you could save on car insurance.
2. Ask This Company to Get a Big Chunk of Your Debt Forgiven
A company called National Debt Relief could convince your lenders to simply get rid of a big chunk of what you owe. No bankruptcy, no loans — you don’t even need to have good credit.
If you owe at least $10,000 in unsecured debt (credit card debt, personal loans, medical bills, etc.), National Debt Relief’s experts will build you a monthly payment plan. As your payments add up, they negotiate with your creditors to reduce the amount you owe. You then pay off the rest in a lump sum.
On average, you could become debt-free within 24 to 48 months. It takes less than a minute to sign up and see how much debt you could get rid of.
3. You Can Become a Real Estate Investor for as Little as $10
Take a look at some of the world’s wealthiest people. What do they have in common? Many invest in large private real estate deals. And here’s the thing: There’s no reason you can’t, too — for as little as $10.
An investment called the Fundrise Flagship Fund lets you get started in the world of real estate by giving you access to a low-cost, diversified portfolio of private real estate. The best part? You don’t have to be the landlord. The Flagship Fund does all the heavy lifting.
With an initial investment as low as $10, your money will be invested in the Fund, which already owns more than $1 billion worth of real estate around the country, from apartment complexes to the thriving housing rental market to larger last-mile e-commerce logistics centers.
Want to invest more? Many investors choose to invest $1,000 or more. This is a Fund that can fit any type of investor’s needs. Once invested, you can track your performance from your phone and watch as properties are acquired, improved, and operated. As properties generate cash flow, you could earn money through quarterly dividend payments. And over time, you could earn money off the potential appreciation of the properties.
So if you want to get started in the world of real-estate investing, it takes just a few minutes to sign up and create an account with the Fundrise Flagship Fund.
This is a paid advertisement. Carefully consider the investment objectives, risks, charges and expenses of the Fundrise Real Estate Fund before investing. This and other information can be found in the Fund’s prospectus. Read them carefully before investing.
4. Earn Up to $50 this Month By Answering Survey Questions About the News — It’s Anonymous
The news is a heated subject these days. It’s hard not to have an opinion on it.
Good news: A website called YouGov will pay you up to $50 or more this month just to answer survey questions about politics, the economy, and other hot news topics.
Plus, it’s totally anonymous, so no one will judge you for that hot take.
When you take a quick survey (some are less than three minutes), you’ll earn points you can exchange for up to $50 in cash or gift cards to places like Walmart and Amazon. Plus, Penny Hoarder readers will get an extra 500 points for registering and another 1,000 points after completing their first survey.
It takes just a few minutes to sign up and take your first survey, and you’ll receive your points immediately.
5. Get Up to $300 Just for Setting Up Direct Deposit With This Account
If you bank at a traditional brick-and-mortar bank, your money probably isn’t growing much (c’mon, 0.40% is basically nothing).
But there’s good news: With SoFi Checking and Savings (member FDIC), you stand to gain up to a hefty 3.80% APY on savings when you set up a direct deposit or have $5,000 or more in Qualifying Deposits and 0.50% APY on checking balances — savings APY is 10 times more than the national average.
Right now, a direct deposit of at least $1K not only sets you up for higher returns but also brings you closer to earning up to a $300 welcome bonus (terms apply).
You can easily deposit checks via your phone’s camera, transfer funds, and get customer service via chat or phone call. There are no account fees, no monthly fees and no overdraft fees. And your money is FDIC insured (up to $3M of additional FDIC insurance through the SoFi Insured Deposit Program).
It’s quick and easy to open an account with SoFi Checking and Savings (member FDIC) and watch your money grow faster than ever.
Read Disclaimer
5. Stop Paying Your Credit Card Company
If you have credit card debt, you know. The anxiety, the interest rates, the fear you’re never going to escape… but a website called AmONE wants to help.
If you owe your credit card companies $100,000 or less, AmONE will match you with a low-interest loan you can use to pay off every single one of your balances.
The benefit? You’ll be left with one bill to pay each month. And because personal loans have lower interest rates (AmONE rates start at 6.40% APR), you’ll get out of debt that much faster.
It takes less than a minute and just 10 questions to see what loans you qualify for.
6. Lock In Affordable Term Life Insurance in Minutes.
Let’s be honest—life insurance probably isn’t on your list of fun things to research. But locking in a policy now could mean huge peace of mind for your family down the road. And getting covered is actually a lot easier than you might think.
With Best Money’s term life insurance marketplace, you can compare top-rated policies in minutes and find coverage that works for you. No long phone calls. No confusing paperwork. Just straightforward quotes, starting at just $7 a month, from trusted providers so you can make an informed decision.
The best part? You’re in control. Answer a few quick questions, see your options, get coverage up to $3 million, and choose the coverage that fits your life and budget—on your terms.
You already protect your car, your home, even your phone. Why not make sure your family’s financial future is covered, too? Compare term life insurance rates with Best Money today and find a policy that fits.
Complex data structures and algorithms are the crux of all software solutions.
Use of a wrong data structure can bog down the performance of your application significantly.
Now, you might not really apply bubble sort or quick sort as is, but understanding these algorithms help you build your own algorithms.
Interview questions are an effort to figure out how your approach is to a given problem. You might not be able to come up with the right solution, but if the approach you adopted is proper, I believe you should be selected.
For example, if you are asked to write a program
- Did you ask the right q
Complex data structures and algorithms are the crux of all software solutions.
Use of a wrong data structure can bog down the performance of your application significantly.
Now, you might not really apply bubble sort or quick sort as is, but understanding these algorithms help you build your own algorithms.
Interview questions are an effort to figure out how your approach is to a given problem. You might not be able to come up with the right solution, but if the approach you adopted is proper, I believe you should be selected.
For example, if you are asked to write a program
- Did you ask the right questions about the pre and post conditions?
- Did you note down the corner cases?
- Did you write pseudo code before actually writing the program?
- Did you (if needed) draw a flowchart?
You might not write the program correctly, but the direction is right.
Talking about complex data structures, Blockchain is a complex data structure.
Experience and Intelligence. Everything really isn’t new. pretty much everything is some form of crud with some business rules and a bunch of layers between the datastore and the client. Very little is actually new. Experience before brings about a cycle of understanding what is happening. Intelligence helps because you’ve gone through and learned from other people.
Sure, there are new databases. Sure, there are new client systems. Sure, there is a lot of new stuff, but the actually work really isn’t new.
Let me provide a recent example. I do a lot of scale work, especially with databases. I had
Experience and Intelligence. Everything really isn’t new. pretty much everything is some form of crud with some business rules and a bunch of layers between the datastore and the client. Very little is actually new. Experience before brings about a cycle of understanding what is happening. Intelligence helps because you’ve gone through and learned from other people.
Sure, there are new databases. Sure, there are new client systems. Sure, there is a lot of new stuff, but the actually work really isn’t new.
Let me provide a recent example. I do a lot of scale work, especially with databases. I had a database and a few tables in MySql where I had to query a few million records multiple times via a join. As I added each table into the join, the time to execute went by a factor of about 10–15x. At about the 10 join point, it was a couple of seconds, and the next join made the query take a couple of minutes. Given that I had to join in 36 total tables, I knew that would not work. I added two indexes, the times went down to around 200 ms and stayed there all throughout the rest of the tables. Instead of flailing for some dumb coding exercise of submitting multiple queries like a beginner would, I had the query all setup as a view, and the view returns a full set of data in that 200–250 ms timeframe. How did I know to do that? Experience and intelligence. I’m a smart guy and I’ve had the query performance problem before and knew that indexes would solve it.
In another example, I had a complex operation that knew was an O(n cubed) solution the way I was going to do. I also had enough experience to know that the amount of data was going to be small, so O(n cubed) didn’t really matter. The algo still runs in a couple of seconds vs hours to do it by hand. Experience showed me that the amount of data was not a huge deal inspite of the algo.
Incidentally, we had a Tech Fest at a college today and I was asked to conduct a Web Designing event. I had to give the undergrad students a simple web page designing problem that could be solved and evaluated in 2 hours.
I asked them to build a web page like this MyFridgeFood - Home. The site allows you to choose a few ingredients and then it tells you what preparations are possible with those.
To keep it simple, I asked the students to do everything in one page on the client side itself (using HTML & JavaScript).
The winner’s “algorithm” was very simple. There were N if statements that looked l
Incidentally, we had a Tech Fest at a college today and I was asked to conduct a Web Designing event. I had to give the undergrad students a simple web page designing problem that could be solved and evaluated in 2 hours.
I asked them to build a web page like this MyFridgeFood - Home. The site allows you to choose a few ingredients and then it tells you what preparations are possible with those.
To keep it simple, I asked the students to do everything in one page on the client side itself (using HTML & JavaScript).
The winner’s “algorithm” was very simple. There were N if statements that looked like this:
if (One.isSelected && Five.isSelected && Ten.IsSelected) echo “Sandwich”;
if (Three.isSelected && Five.isSelected && Fifteen.IsSelected) echo “Soup”;
if (Six.isSelected && Twelve.isSelected && Thirty.IsSelected) echo “Cake”;
For students who aren’t living in coding cultures, it is still reasonable given the time constraint.
However, if the same student has to be hired by a company for building a professional product, they have to think and do much better, with just a little extra time and effort.
How would you, as a professional/aspiring web developer, do it? Pause and think before you continue reading.
Here is my approach. Use one bit to represent each ingredient. I can use multiple words (32-bit or 64-bit) to encode and send the user’s complete selection to the server. So, 11000…0001 implies Apples, Avacado and Zucchini were selected (and no other ingredient was selected).
On the server, you do a bit-wise and of the user selection (words) with each recipe/preparation (which is also stored as a collection of words). If you get the recipe words back after the bit-wise and, it implies that the recipe is possible with the user selection.
Of course, you could choose to do it differently. If you don’t want to play with bits, you can pass the user selection as an array of ids (each ingredient has an id instead of a designated bit) and do the intersection on the server with each recipe/preparation array.
Now, when you were taught bit manipulations in C, you weren’t told if it could/should be used in web designing. You were just made aware of the provisions in a programming language and things were left to your imagination.
So, it is up to the developer to put data structures and algorithms to good use regardless of whether they are in to web or device driver development. The idea behind modern day coding interviews is to check this ability.
call the BS, since it are usually basic sorting algorithms that are probably embedded in libraries since the stone age.
For a computer science graduate with a basic programming background, it's required to start with interview questions that assess fundamental concepts rather than diving into advanced algorithms and data structures. Here are some good interview questions suitable for such candidates:
Basic Programming Concepts:
Explain the difference between a compiler and an interpreter.
What are variables, and how do they work in programming languages?
Describe the difference between pass-by-value and pass-by-reference.
Write code to swap the values of two variables without using a temporary variable.
What is the s
For a computer science graduate with a basic programming background, it's required to start with interview questions that assess fundamental concepts rather than diving into advanced algorithms and data structures. Here are some good interview questions suitable for such candidates:
Basic Programming Concepts:
Explain the difference between a compiler and an interpreter.
What are variables, and how do they work in programming languages?
Describe the difference between pass-by-value and pass-by-reference.
Write code to swap the values of two variables without using a temporary variable.
What is the significance of the main() function in C/C++?
Control Structures:
What are conditional statements (if-else) in programming? Provide an example.
Describe loops (for, while, do-while) and give examples of when to use each.
Data Types and Data Structures:
Differentiate between arrays and linked lists.
Explain the concept of an array index and how it relates to accessing elements.
What is a stack, and how does it work? Provide examples of its use.
Functions and Recursion:
What is a function, and why is it useful in programming?
Explain the concept of recursion with an example.
Basic Algorithms:
Write an algorithm to find the maximum value in an array.
Describe a linear search algorithm and provide its time complexity.
What is a sorting algorithm? Explain the bubble sort algorithm.
Basic Complexity Analysis:
What is Big O notation, and why is it important?
Compare the time complexity of linear search and binary search.
Memory Management:
What is dynamic memory allocation, and how is it different from static memory allocation?
Explain the concept of memory leaks and how to avoid them.
Object-Oriented Programming (OOP):
Describe the principles of OOP, including encapsulation, inheritance, and polymorphism.
Error Handling:
What is exception handling, and why is it important in programming?
Problem-Solving:
Given a simple problem statement, the candidate is asked to design an algorithm and write code to solve it. This could be something like finding the sum of all even numbers in an array or reversing a string.
You need to adapt the difficulty level of these questions based on your programming background and the specific role you're being hired for. These questions should serve as a starting point to gauge understanding of foundational concepts before delving into more complex algorithms and data structures. In order to be prepared for job interviews in tech companies you can enroll in professional online platforms that provide comprehensive Data structure and Algorithms courses along with interview preparation. Some of these platforms are Udemy, Expertifie, Coursera, Educative, etc.
How should seasoned developers respond to interview questions about algorithms?
Knock the answers out of the park.
I’m afraid I don’t understand the attitude that says “I’m so good at my job that I shouldn’t have to show you how good I am,” or “I’ve been at my job a long time, so you should just assume that I’m good.”
If you’re not good, don’t be upset that they want to hire people who are.
If you are good, show them. This is what you want: you don’t want to work for a company that hires a bunch of bad developers.
One day my father bought me some lunch at a ski place. It cost $22. My dad gave a ten and a twenty to the cashier. The cashier was going to hand him $8 back, but realized they were out of ones. (They could only make a 5+1+1) .
So my dad says, “give me a ten and I’ll give you a two” 10 - 2 = 8. The cashier says “no that will not work”, the customers surrounding them agree, and the cashier proceeds to spend five minutes getting fresh one-dollar bills.
When my dad got back to the table, he said “American’s can’t do math”
Little did I know, the cashier was not doing math. No, she was using an algorit
One day my father bought me some lunch at a ski place. It cost $22. My dad gave a ten and a twenty to the cashier. The cashier was going to hand him $8 back, but realized they were out of ones. (They could only make a 5+1+1) .
So my dad says, “give me a ten and I’ll give you a two” 10 - 2 = 8. The cashier says “no that will not work”, the customers surrounding them agree, and the cashier proceeds to spend five minutes getting fresh one-dollar bills.
When my dad got back to the table, he said “American’s can’t do math”
Little did I know, the cashier was not doing math. No, she was using an algorithm: the cashier’s algorithm.
Take the largest bill possible, and continue until you give the amount. By using the algorithm, the cashier never had to do more than basic thinking. Need to make 22? Take a $20 bill and two $1 bills. 8 is just 5+1+1+1 (if you don’t have $2 bills :). And here’s the kicker: it is optimal.
But what about Chicken McNuggets? Chicken McNuggets come in packs of 4, 6, 9, and 20. What if I wanted to make 22? I would take 9, 9, and 4. 9+9+4 = 22. But using the cashier’s algorithm, I would take 20, then… I would be stuck. Here, the cashier’s algorithm is not optimal.
An algorithm is nothing but a procedure to produce some useful solution or solve some task. Start with algorithms that sort and search. Then maybe try some greedy algorithms, which are algorithms that choose the best answer at the moment: the cashier’s algorithm is a greedy. Then try to do dynamic programming, graph algorithms, string, and other common topics. You will be ready then.
The internet is your friend. Look at topcoder data science tutorials.
Oh, and make sure the algorithm is correct.
Cashiers at McDonalds live the hard life.
P.S The “ski place” was not McDonalds, that was another example.
Yes, but you don't learn algorithms to interview questions, you learn how to improve your coding. In your day-to-day work, you may not need to implement or do algorithm-related work, but that's at the core of programming, an algorithm is simply a sequence of steps to solve a problem. that will improve your coding. When you solve an algorithm problem, you need to clarify a problem, define the input, the input, a test case for that problem, you need to analyze the problem, break it down into a small problem. more and handle it. That will help you a lot when you try to solve the real problem. Tha
Yes, but you don't learn algorithms to interview questions, you learn how to improve your coding. In your day-to-day work, you may not need to implement or do algorithm-related work, but that's at the core of programming, an algorithm is simply a sequence of steps to solve a problem. that will improve your coding. When you solve an algorithm problem, you need to clarify a problem, define the input, the input, a test case for that problem, you need to analyze the problem, break it down into a small problem. more and handle it. That will help you a lot when you try to solve the real problem. That's why the top company in the world needs you to be strong about it. being good at algorithms can show you are a good problem solver and remember, programming language or framework is just a tool, you need to be able to learn it quickly and not focus too much much on it. You need to focus on programming and problem solving.
Does web development require algorithms?
No. You don’t need an algorithm to make a website for:
- A non-profit organization
- A university department (or university)
- A small business
- A wiki website
- A the list goes on…
A lot of things in web development do require algorithms. For example, if you have an user-authentication system, you’d want to use a hashing algorithm to hash the user’s password instead of storing it as plain text (which is a cardinal sin in web development). However, you DO NOT write the hashing algorithm yourself.
In fact, you’re highly discouraged to write such algorithms yourself. You’
Does web development require algorithms?
No. You don’t need an algorithm to make a website for:
- A non-profit organization
- A university department (or university)
- A small business
- A wiki website
- A the list goes on…
A lot of things in web development do require algorithms. For example, if you have an user-authentication system, you’d want to use a hashing algorithm to hash the user’s password instead of storing it as plain text (which is a cardinal sin in web development). However, you DO NOT write the hashing algorithm yourself.
In fact, you’re highly discouraged to write such algorithms yourself. You’d typically use an algorithm written by someone else, a professional who knows exactly what they’re doing. This is usually done through libraries that are widely-used, such as Werkzeug.
Edit: Don’t only think BIG when it comes to web development. There’s no job too small, especially if you’re just getting started. I’ve built websites for all the types of institutions listed above. The majority of the websites on the internet are SMALL websites. Your first website project isn’t going to be the next Quora.
The scope of algorithms asked in coding interviews is very limited. Candidates are not asked to come up with a massive breakthrough in computer science within half an hour. It’s always going to be one of the usual suspects. Without preparation, the vast majority of candidates would fail, and that’s the catch. The assumption is that with the right preparation, and that material is widely available online, the better candidates will be able to identify the problem category, apply the right algorithm/data structure, and implement a solution in a time-effective manner, while other candidates won’t
The scope of algorithms asked in coding interviews is very limited. Candidates are not asked to come up with a massive breakthrough in computer science within half an hour. It’s always going to be one of the usual suspects. Without preparation, the vast majority of candidates would fail, and that’s the catch. The assumption is that with the right preparation, and that material is widely available online, the better candidates will be able to identify the problem category, apply the right algorithm/data structure, and implement a solution in a time-effective manner, while other candidates won’t be able to make these connections fast enough or will somehow mess up the implementation.
What’s interesting there is that preparation will trump credentials. Somebody who prepped correctly but who didn’t graduate from a prestigious college or who didn’t work at selective tech companies can do better than someone who has the perfect resume, but hasn’t prepped well.
Uhm… yes and no.
First of all, we have to understand what an algorithm is.
“In mathematics and computer science, an algorithm (/ˈælɡərɪðəm/ (listen)) is a finite sequence of well-defined, computer-implementable instructions, typically to solve a class of problems or to perform a computation”
So, in this wide definition, a simple sorting operation use an algorithm.
But… when developing a web app, you’ll never write a sort algorithm, you’ll rely on your framework implementation.
More on this: when writing a web app, we are talking about the last layer of our code, which owns the
Uhm… yes and no.
First of all, we have to understand what an algorithm is.
“In mathematics and computer science, an algorithm (/ˈælɡərɪðəm/ (listen)) is a finite sequence of well-defined, computer-implementable instructions, typically to solve a class of problems or to perform a computation”
So, in this wide definition, a simple sorting operation use an algorithm.
But… when developing a web app, you’ll never write a sort algorithm, you’ll rely on your framework implementation.
More on this: when writing a web app, we are talking about the last layer of our code, which owns the presentation logic. With that in mind, you don’t need a big knownledge on algorithms to implement that.
You don’t. Well at least not in the way you’re thinking.
You just evaluate if he has at least the same skills as you. After that you interview the person, you find out what makes him tick, why he prefers software development over anything else in life.
In the end you just need to answer this question to yourself:
Is this the kind of person I would like to have around for 8/10 hours a day.
At least that’s what I believe in.
If you are an intermediate programmer looking to learn or re-learn data structures and algorithms in order to become capable of top companies and competitive programming, the following path may be helpful:
1. Start by reviewing the basics of programming and algorithms. Ensure that you have a solid understanding of programming concepts, such as variables, control structures, loops, functions, and recursion, as well as basic algorithms, such as linear search and binary search.
2. Learn the fundamentals of data structures. Focus on basic data structures, such as arrays, linked lists, stacks, and qu
If you are an intermediate programmer looking to learn or re-learn data structures and algorithms in order to become capable of top companies and competitive programming, the following path may be helpful:
1. Start by reviewing the basics of programming and algorithms. Ensure that you have a solid understanding of programming concepts, such as variables, control structures, loops, functions, and recursion, as well as basic algorithms, such as linear search and binary search.
2. Learn the fundamentals of data structures. Focus on basic data structures, such as arrays, linked lists, stacks, and queues, and understand their implementation and usage in various programming scenarios.
3. Master more advanced data structures. Once you have a good grasp of the basics, move on to more advanced data structures, such as trees, graphs, heaps, and hash tables, and understand how they can be used to solve complex problems.
4. Learn important algorithms. Learn and implement algorithms such as sorting, searching, dynamic programming, and graph traversal algorithms.
5. Practice, practice, practice. Practice coding problems from various sources, including coding challenges on websites like HackerRank, LeetCode, or Codeforces. Solve a wide range of problems from easy to hard.
6. Read and learn from others. Read books, watch tutorials, and learn from others' experiences. A great book for problem-solving in data structures and algorithms is "Problem Solving in Data Structures and Algorithms using Python" by Hemant Jain. This book covers a wide range of topics and provides practical examples and exercises to help you apply your knowledge.
7. Participate in programming contests. Participating in programming contests is a great way to test your skills and gain experience in solving problems under pressure.
By following these steps, you can build a strong foundation in data structures and algorithms and become capable of top companies and competitive programming. Remember to stay persistent and never give up, as mastery of these topics takes time and effort.
Read this book
Get this book.
There is no other way. I would have recommended you the Transformers one, but it's better you start with the absolute basics. The second chapter is a pretty basic + ...
Read this book
Get this book.
There is no other way. I would have recommended you the Transformers one, but it's better you start with the absolute basics. The second chapter is a pretty basic + ...
Of course more complex algorithms are harder to program than easy ones. However, I would say that a particularly hard-to-program-correctly algorithm is any divide-and-conquer algorithm on an array. These are hard because of the need to divide the array into two or three parts, without making an off-by-one error. They are also hard because of recursion, also without making an off-by-one error. It’s the wide latitude for tiny errors that makes them hard to get right.
How do you learn when to apply which data structures and algorithms to which problems in job interviews?
When you’ve written enough code to learn when to apply which data structures and algorithms to which problems in actual code.
It isn’t like there’s thousands of data structures to learn. You got arrays, linked lists, trees, and hash tables, and that will cover 98% of real-world programming.
The *hard* part is looking at the problem and coming up with “Let’s see, if I make a hash table of wombats, hang a linked list off each entry to allow for duplicates, and then each linked list entry has a p
How do you learn when to apply which data structures and algorithms to which problems in job interviews?
When you’ve written enough code to learn when to apply which data structures and algorithms to which problems in actual code.
It isn’t like there’s thousands of data structures to learn. You got arrays, linked lists, trees, and hash tables, and that will cover 98% of real-world programming.
The *hard* part is looking at the problem and coming up with “Let’s see, if I make a hash table of wombats, hang a linked list off each entry to allow for duplicates, and then each linked list entry has a pointer to an array of trees, then we can….”
And being able to figure out whether a hash table or a tree would have been more efficient at the top,,, which will require understanding what you’re trying to do with this code.
And all those ninja sort algorithms? You’re *probably* never going to actually code one, instead you’ll just throw it at the runtime library’s default sort function - and if that doesn’t run fast enough or small enough, you’ll use the already debugged code in an additional library.
Now yes, *some* people will be interviewing for jobs where the system sort isn’t fast enough, the libraries aren’t fast enough, and you’ll be writing custom code to sort billions of data points that won’t fit into memory.
But if you’re asking how to learn when to apply which structures and algorithms, you’re probably not the person they’ll hire to write that custom code….
First of all learn HTML and CSS. HTML is the document structure, CSS styles that structure.
jQuery is a javascript library, don't see it independent to javascript. Try to learn javascript first, then you'll see why jQuery id used.
Git is just a way to keep track of what you doing, considering how easy it is (in that in most cases there are only 4 lines of code that you us - others can be easily referenced) learn it after you get your feet wet with HTML and CSS. it is like a camera in the background, it helps take snapshots of your work, so that if you ever mess up your code, you can backtrack
First of all learn HTML and CSS. HTML is the document structure, CSS styles that structure.
jQuery is a javascript library, don't see it independent to javascript. Try to learn javascript first, then you'll see why jQuery id used.
Git is just a way to keep track of what you doing, considering how easy it is (in that in most cases there are only 4 lines of code that you us - others can be easily referenced) learn it after you get your feet wet with HTML and CSS. it is like a camera in the background, it helps take snapshots of your work, so that if you ever mess up your code, you can backtrack to when the code was working.
Angularjs is a javascript framework, very powerful and a joy to work with - but you need to know how to work with javascript.
Bootstrap is just a HTML & CSS library. By using it, you get preset CSS which you can use in your project. Whilst it does save time and so forth, I would highly recommend to not use it, you would not learn anything just by using that. I would strongly recommend to study it, learn from it, wonder how and why their css works.
You did not ask about server side (I assume that's the "etc"). There are a lot of programming language, one is PHP, you can find lists easy, learn one.
If you end up liking JavaScript, you'll find that there are ways to use JavaScript as a server side language, there you get introduced to things like NodeJS.
The way to tackle the confusion is by starting with HTML and CSS. Do few projects with those two, very soon you'll end up with lots of questions: "how can I get my current project to do a, b, c". The answers to those questions will lead you to JavaScript (jQuery) or to PHP and to Databases.
When you start exploring AngularJS you'll end up reading about NodeJS, expressjs, mongoose. But you don't need to worry about all now. Learn HTML and css (with a touch of javascript) first
Note: there are a lot of libraries like bootstrap, I'd ignore them for now (only as I said, if you want to learn by reading their code)
Edited: I forgot to mention css preprocessor. They give more power to css. For example in css we don't have variables or if statements (features of programming languages - don't worry if you don't know what they are). The one I like is SASS, as far as I know is the most powerful one. But of course why would you be interested in learning something that makers something else powerful before you learn the something else in the first place! But when you hear of it, don't dismiss it.
Hope that helps
I would modify the question slightly and answer the same for problem solving. Data structures and algorithms are just different tools that help in problem solving.
Now, is problem solving knowledge necessary for a web developer? Absolutely YES! In fact, it is the most important.
For answering why, just look at any website with some level of complexity and analyse if there are some parts of it which are not that straightforward.
Let’s take a few examples from different fields out there :
- Gaming: Let’s take a website like Chess.com. Now, before a game starts you are matched with a participant around
I would modify the question slightly and answer the same for problem solving. Data structures and algorithms are just different tools that help in problem solving.
Now, is problem solving knowledge necessary for a web developer? Absolutely YES! In fact, it is the most important.
For answering why, just look at any website with some level of complexity and analyse if there are some parts of it which are not that straightforward.
Let’s take a few examples from different fields out there :
- Gaming: Let’s take a website like Chess.com. Now, before a game starts you are matched with a participant around your rating and the match starts. This matching is not an easy problem to solve considering every person can set a gap of rating with which he/she wants to play. Moreover, after the match is over, predicting how much rating should be added/subtracted also is a complex problem to solve and would require some dsa on past data. Thirdly, analysis of the game using engines would again be based off of some backtracking solution by exploring the possibilities and to be able to predict if the move was correct or not.
- Food Apps: Finding which active delivery guys should be allocated to which order is not so easy. Even showing relevant restaurants to you when you search for “restaurants selling cakes” is not so easy. There are many parameters to take care of: Restaurant delivery radius, popularity, rating, promoted restaurants, your history of orders, etc.
- Social Media: Designing your newsfeed itself is really complex. You need to look at so many factors: Is it a post from someone you know? Kind of posts you have interacted with? Kind of posts people like you interacted with? Some ad based on your data history? Something famous in your location? Community? Etc Etc.
So, no matter what kind of system you are creating as a web developer, you will at one point or the other, face a tough problem to solve. Then comes the use of problem solving and some common dsa like graphs, hashing, sorting, searching, recursion, backtracking etc .
Even more importantly, these form the core of the field you are working in. How can you excel in your job if you have not worked on the core skills?
Back just before the Tech Wreck in 2001 I ended up in charge of interviewing at a company of 300 sysadmins. I taught interviewing skills, interviewing legal issues, how to write up interview reports.
When we started hiring Oracle DBAs I was one of the three founding members of the DBA interviewing team. Plenty of the DBAs we hired ended up calling me months or years later to discuss their projects. When we started hiring Cisco network engineers the same thing happened.
I’m an expert UNIX sysadmin with more database proficiency than is average among sysadmins. I’ve done vacation coverage for Orac
Back just before the Tech Wreck in 2001 I ended up in charge of interviewing at a company of 300 sysadmins. I taught interviewing skills, interviewing legal issues, how to write up interview reports.
When we started hiring Oracle DBAs I was one of the three founding members of the DBA interviewing team. Plenty of the DBAs we hired ended up calling me months or years later to discuss their projects. When we started hiring Cisco network engineers the same thing happened.
I’m an expert UNIX sysadmin with more database proficiency than is average among sysadmins. I’ve done vacation coverage for Oracle DBAs. Oracle is not the only database technology I now. At the time the other database technology I knew was Ingres which was already obsolete.
Any DBA who wasn’t better at Oracle than I was could be easily rejected. All of the good candidates were better. The DBA though not at IT in general.
I said I was going to play the part of a client manager who used to be expert at Ingres and who know Oracle enough to get along. They were to play the part of an Oracle consultant with our company deployed to do some of their DBA work.
I started talking abut problems and various approaches to solving them. I let the discussion flow. Some DBAs ended up talking performance tuning - I eventually got credits on versions of the UNIX performance tuning section of the popular Oracle book. I don’t know SQL tuning but I know the OS end. Some DBAs ended up talking migrations - I ended up published in filesystem migrations of non-database systems so again I knew the OS end but not the DB end.
As long as you are good at what you do you’ll be able to tell who’s BSing you and who’s not. if you have related expertise, use it.
Where I write DBA, fill in whatever developer skill you are interviewing for. Where I write UNIX or OS, fill in yours.
That varies quite extremely depending upon your job.
There are jobs that simply knowing some basic simple algorithms are sufficient, such as an array (or some equivalent structure, like a C++ vector) and looping over it (or calling the relevant functions in the STL). There is a theorem that says you can write any program with just some basic operations like assignment, if statements, and while loops.
In fact, there are whole programming languages that show (Turing completeness, that is the ability to write any program) with only one weird operation. If you follow this link, you can be introduced
That varies quite extremely depending upon your job.
There are jobs that simply knowing some basic simple algorithms are sufficient, such as an array (or some equivalent structure, like a C++ vector) and looping over it (or calling the relevant functions in the STL). There is a theorem that says you can write any program with just some basic operations like assignment, if statements, and while loops.
In fact, there are whole programming languages that show (Turing completeness, that is the ability to write any program) with only one weird operation. If you follow this link, you can be introduced to them. No one in their proper mind uses them to develop software for any purpose beyond showing a sick sense of humor.
However, that level of knowledge won’t get you many jobs. It certainly, won’t get you a job at a place like Google. It probably won’t even get you an internship, although there are some exceptions like the STEP program that tries to get non-traditional students along the path to becoming a software engineer (or related field).
After learning your first programming language, learning algorithms and data structures is perhaps the most important thing to do. Those are the real tools of the trade. That is about “how to think”. The only thing that competes with it (in my mind) is learning the special idioms of the language.
Some of those special idioms are learning how (and when) to:
- write a recursive function (almost any language allows that)
- work with immutable and mutable data (increasingly important)
- create an object (OO programming languages)
- deal with pointers or references (most imperative languages)
- deal with threaded data (futures and promises in Java)
- write regular expressions
- use semaphores and protected regions
- deal with exceptions and error handling
- assertions, invariants, and induction
But, what algorithms and data structures would I learn first, i.e. along side the above:
- hashes (how to do things without searches, O(1) versus O(n))
- queues (how to put things in order, for doing later)
- stacks (doing things you can walk backward and “undo”)
- binary trees and binary search (divide and conquer, O(log n), how to balance a tree)
- general graphs (that matches up with pointers and references)
- especially trees (and pre-order, post-order, in-order traversals)
- depth first and breadth first search
- circular buffers
- priority queues
- finite state machines
You may not need to know all those things to get a job, but there is a pretty good chance that if you do enough programming, you will end up using almost everyone of them at one time or another. So, add those to your skill set. That is what I would consider the knowledge base of a competent software engineer. If you can do all those things in a whiteboard interview, you should be able to get (and keep) a job at a place like Google.
And the order of the list is only the order I thought of them in. I would learn dealing with errors very early if I were actually working. And assertions, invariants, and induction are in my mind the most important things to know how to do along with writing unit tests.
By the way, I suspect it takes about 4 years to learn that list. Which is the length of a typical CS bachelor’s degree, and why many employers want that before hiring a person.
I’m reminded that, back in the day, the appropriate response to an algorithm question, or something foolish like “what’s 2053 in Hex” - is “do you have a copy of Knuth handy,” or “do you have a Hex calculator handy?” If you actually started to scratch an answer on paper, they knew you were an amateur. (Or, for the real old timers, among us, “do you have a copy of the CRC Handbook.”)
Personally, I’d never hire someone who would play code monkey on a string, in an interview. If they even got in the door, in the first place.
I agree that you should not "memorize" a set of textbook algorithms. The goal here should be internalization, which requires more effort.
The more time one spends with algorithms, the better one will learn them and how to use them. It's like running, sports, math, or any other worthwhile discipline in this regard. Natural aptitude exists but matters little in the end compared to the amount of time invested in learning and internalizing them.
In your shoes, I probably would first learn various data structures (linked list, queue, stack, binary tree, hashmap) and their various Big-O attribu
I agree that you should not "memorize" a set of textbook algorithms. The goal here should be internalization, which requires more effort.
The more time one spends with algorithms, the better one will learn them and how to use them. It's like running, sports, math, or any other worthwhile discipline in this regard. Natural aptitude exists but matters little in the end compared to the amount of time invested in learning and internalizing them.
In your shoes, I probably would first learn various data structures (linked list, queue, stack, binary tree, hashmap) and their various Big-O attributes for insert, removal, traversal. Then I would move onto sorting algorithms. After that, I would branch into dynamic programming, pattern matching, pathfinding, and so forth depending on my needs.
My experience has been that no single source has helped me internalize concepts. For me, it has been a matter of settling on one concept and sticking to that concept, and googling everything about it starting with its Wikipedia entry, and also coding it in my preferred language, until I "got it." Then move onto the next concept. Go back and review as needed. Memorization is not needed nor the goal nor even always possible. The goal is to develop a big picture understanding to answer questions like "I have an array of numbers that are mostly in order, and I need to sort it. What is the best sorting algorithm to use?"
In some cases, for low-level developers are hired by small companies without attractive perks and other packages (including salary…).
As far as I know, deep understanding of Algorithm and Data structure is required at BIG TECH companies (Fb, Uber, Google, Twitter, Tencent, Taobao…) . About 6 month ago, I applied to small companies and their own interviewers just asked me about experience of using tools, libraries (Django, Python, Magento…), just a small talk via Skype (behavioral questions included), no coding on Google Doc or on whiteboard but in BIG Tech companies, the motto is “Let your code
In some cases, for low-level developers are hired by small companies without attractive perks and other packages (including salary…).
As far as I know, deep understanding of Algorithm and Data structure is required at BIG TECH companies (Fb, Uber, Google, Twitter, Tencent, Taobao…) . About 6 month ago, I applied to small companies and their own interviewers just asked me about experience of using tools, libraries (Django, Python, Magento…), just a small talk via Skype (behavioral questions included), no coding on Google Doc or on whiteboard but in BIG Tech companies, the motto is “Let your code speak for you”. I was interviewed at Google, Twitter, Microsoft and Tencent and I must say ALL questions they asked me were really tough like playing “Hack and Slash” games. Though I got rejected from 3/4 companies but at least, I got a great offer with really attractive perks and salary… :)). Ok , The ability of solving algorithmic questions is required if you wanna get hired by big tech companies, otherwise, basic knowledge of programming is Ok at small companies.
P/S: a capture of email I received from Google recruiter and he recommended me to review only Algorithm and DT.
Hope this help :)
Purchase this book if you get a chance: Programming Interviews Exposed: Secrets to Landing Your Next Job: John Mongan, Noah Kindler, Eric Giguère: 9781118261361: Amazon.com: Books ( I haven’t read Cracking the Coding Interview). This book does a great job covering string related problems. If you want to save money, you can buy the book on Kindle and read it on the cloud reader.
If you want a free resource, look at linked lists here: Linked List Problems
You should write code when solving problems. Make sure you can do that.
Recently I created a small game where the user has to type a word correctly within a given limit. If he succeeds, the score increases by a factor and if he fails, the game is over. I added a high score functionality where I stored the top 5 scores in the local storage of the browser. So after each game, I had to compare the current score with all the high scores and put it in the correct position (if eligible).
Now how to find the correct position. Since the high scores are sorted in decreasing order of their values, you can do the same with linear search O(n), i.e., by comparing the values of
Recently I created a small game where the user has to type a word correctly within a given limit. If he succeeds, the score increases by a factor and if he fails, the game is over. I added a high score functionality where I stored the top 5 scores in the local storage of the browser. So after each game, I had to compare the current score with all the high scores and put it in the correct position (if eligible).
Now how to find the correct position. Since the high scores are sorted in decreasing order of their values, you can do the same with linear search O(n), i.e., by comparing the values of adjacent elements. In my case ’n’ was small, as I was just practising my skills by making a project. But what if it is a real time game, which may involve millions of user data? So I used binary search whose complexity is O(logn).
Hope you get the point. Algorithms help us to solve real world problems and improve the performance of our products using optimization techniques. So you must know at least the basics of time complexity, recurrence relations, searching and sorting algorithms, greedy, dynamic programming, graph algorithms, backtracking, branch and bound, etc. to be a good developer.
Best of luck! Thank You.