Good sets of practical problems for practice

quikah

Diamond Member
Apr 7, 2003
4,046
638
126
I am looking for problem sets to practice programming on that are actual useful problems. I have been going through leetcode, but it is really hard to stay motivated as they are all almost exclusively gimmick problems that have no practical purpose. For example, I don't really care about figuring out how to add roman numerals or adding numbers stored as a linked list (seems like a lot of these problems are dumb ways to add numbers).
 
  • Like
Reactions: katinanjelina

purbeast0

No Lifer
Sep 13, 2001
52,659
5,557
126
Many of the "practice programming" things aren't useful for real world. Most things that are useful for real world have already been done a million times and have been refined and are now libraries people use.

Those "adding numbers in linked lists" are very "useful" though if you are learning how to program. It helps you understand linked lists and how to traverse em, etc. Depending on the language, it can help with memory management, can help learn how to use external libraries, etc.

I guess I'm just a bit confused as to what you mean by being "useful" to you. It could mean a lot of different things.

I do agree though that going through tutorials and stuff like leetcode is tedious. The best "useful" thing to do would be to make something that you can personally use, or a website or webapp that would be useful to you, or a game or something. But of course, that means you have to have the idea already, and that is the toughest part of it all.
 

quikah

Diamond Member
Apr 7, 2003
4,046
638
126
Those "adding numbers in linked lists" are very "useful" though if you are learning how to program. It helps you understand linked lists and how to traverse em, etc. Depending on the language, it can help with memory management, can help learn how to use external libraries, etc.

I guess I'm just a bit confused as to what you mean by being "useful" to you. It could mean a lot of different things.

Give me a problem involving linked lists that people would actually use a linked list for.

Leetcode give me the problem add the number 2->3->4 with number 5->3->6.

My first response is why the hell are you storing numbers like that in the first place?
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,133
3,621
65
Linked lists are used to implement stacks, queues, and dequeues (double-ended queues) of unknown size. They're also a good, lightweight way to handle collisions in a hash table.

A lot of practical problems require a lot of background knowledge that isn't quick to acquire. You could look at creating pull requests to solve open issues on open-source projects on Github.
 

purbeast0

No Lifer
Sep 13, 2001
52,659
5,557
126
Give me a problem involving linked lists that people would actually use a linked list for.

Leetcode give me the problem add the number 2->3->4 with number 5->3->6.

My first response is why the hell are you storing numbers like that in the first place?
As @Ken g6 said, it's just to teach you about some basics/concepts. You gotta crawl before you can walk. Most of these "test" sites aren't there to give you real world problems. They are there to test your skills and see where you stand.

A "real world problem" involving a linked list and numbers would be so sort a list of random numbers. That is something that could be used in the real world. But as I mentioned, you are reinventing the wheel, because this has already been done a bajillion times and depending on the language you are using, you can just use a library/type to do so.
 
Jul 27, 2020
13,349
7,925
106
When I was a student, a fellow student told me that Notepad uses linked lists for storing the data. Each character is a node of the linked list. I dunno. Seems a lot of work. Or maybe each node contains a string consisting of each word? But then Notepad would need to identify words. Anyway, I think he was just trying to impress me. Anyone with experience wanna chime in?
 

quikah

Diamond Member
Apr 7, 2003
4,046
638
126
By the way, how long have you been programming? I would love to share what little I know. Or even learn from you.

Don't really consider myself a programmer. I am a performance engineer, so I do a lot of benchmarking and writing scripts (usually just bash scripts) to process data. I have taken classes and dabbled for maybe 20 years. Powershell, bash, C (long time ago), fortran (again long time ago), C#, java, perl (hate it), and python. Mostly self-taught, just trying to learn new things. Currently working on some projects in python at work. Pretty basic stuff, nothing complicated.
 
Jul 27, 2020
13,349
7,925
106
Unfortunately, everything I do is under NDA.
But you do have some benchmark side project as a hobby, measuring performance of various PCs/laptops you come into contact with from time to time, right? Github link and table of such benchmark results would be welcome!
 
  • Like
Reactions: katinanjelina

quikah

Diamond Member
Apr 7, 2003
4,046
638
126
But you do have some benchmark side project as a hobby, measuring performance of various PCs/laptops you come into contact with from time to time, right? Github link and table of such benchmark results would be welcome!

Uh, well, not really. All the interesting hardware I come into contact with is what the NDA is for. Lot of prototype server systems.

Personal stuff I don't really track, I just make tweaks and check if it makes something better. Not all that interested about recording this stuff. I don't really have a load of stuff to test on. Just my 1 desktop.
 
  • Like
Reactions: katinanjelina
Jul 27, 2020
13,349
7,925
106
All the interesting hardware I come into contact with is what the NDA is for.
Any interesting stories you could tell us, without violating the NDA? What do you measure usually? Time to complete something? Operations per second? Does the high resolution timer matter in the process of measurement or a simple difference between start time and stop time is usually good enough? The NDA applies even when hardware starts shipping?
 
  • Like
Reactions: katinanjelina

quikah

Diamond Member
Apr 7, 2003
4,046
638
126
Any interesting stories you could tell us, without violating the NDA? What do you measure usually? Time to complete something? Operations per second? Does the high resolution timer matter in the process of measurement or a simple difference between start time and stop time is usually good enough? The NDA applies even when hardware starts shipping?

All work that is done under NDA is always under NDA (depends, all NDAs are a bit different, some actually stipulate results can be released). Technically you could probably get some stuff released once product ships, but legal is a freaking nightmare to deal with. Not worth the effort, so I just treat everything as forever under NDA unless I am working on a released product.

What I measure depends on the benchmark used. Can be time spent, or transactions/s or some bandwidth measurement. My main tool is VMmark (www.vmmark.com). I am on the team that developed this benchmark. This sort of prompted me to want to improve my programming skills as I am writing a lot of python and bash scripts for this. This benchmark measures transactions/s and response time for those transactions. We set a limit on response time and pack as many VMs on the host that can still function under that response time.

Depending on what the goal is I sometimes will collect low level stats on the CPU scheduler of ESX to see if there is something funky going on (this happens when new architecture is developed like AMD Zen, see below whitepaper). Or maybe look at the network, disk, or memory, etc.

Some examples whitepapers:
Optane PMEM
https://www.vmware.com/content/dam/...er/performance/pmem-balanced-profile-perf.pdf

Also contributed to this whitepaper https://www.vmware.com/content/dam/...erformance/vsphere70u2-cpu-sched-amd-epyc.pdf

Haven't written any other whitepapers recently.

Usually I am just validating performance of vSphere on new CPUs. I am currently working on some upcoming servers which will be launched in the next year. See the CPU forums for ideas on what those might be...

Timers are kind of a moot point now. When I first started ~15 years ago this was a big issue. We always had to make sure time didn't drift by checking time sync for all systems at start and end of testing (or throughout the test for long running benchmarks). This was a big issue when the system was under heavy load. These days time is able to be kept very accurately. We still will check time sync, but I have never seen any drift in the past ~10 years on any system. I personally don't deal with real-time systems, probably much more of a concern in that space.