Santiago Profile picture
26 Jan, 14 tweets, 2 min read
11 short programming problems to stretch your imagination and make sure you are staying on your toes.

(Starting with the simple ones, they get more fun as you move towards the end.)

๐Ÿงต๐Ÿ‘‡
1. Write a function that reverses an array in place.

In other words, the function should not use an auxiliary array to do the work.
2. Write a function that finds the missing number in an unsorted array containing every one of the other 99 numbers ranging from 1 to 100.
3. Write a function that finds the duplicate number in an unsorted array containing every number from 1 to 100.

Only one of the numbers will appear twice.
4. Write a function that removes every duplicate value in an array.

There could be more than one value duplicated. You should remove all of them leaving a single copy of the value.
5. Write a function that finds the largest and smallest number in an unsorted array.
6. Write a function that finds a subarray whose sum is equal to a given value.
7. Write a function that finds the contiguous subarray of a given size with the largest sum.
8. Write a function that, given two arrays, finds the longest common subarray present in both of them.
9. Write a function that, given two arrays, finds the length of the shortest array that contains both input arrays as subarrays.
10. Write a function that, given an array, determines if you can partition it in two separate subarrays such that the sum of elements in both subarrays is the same.
11. Write a function that, given an array, divides it into two subarrays, such as the absolute difference between their sums is minimum.
I'd love to see some answers!

If you want more content on software engineering, machine learning, and adjacent topics, give me a follow. I post threads like this every week. You can enjoy more of this content here: @svpino.
I've seen several answers, but I haven't seen any solutions for the last few problems yet.

๐Ÿ‘ฟ

โ€ข โ€ข โ€ข

Missing some Tweet in this thread? You can try to force a refresh
ใ€€

Keep Current with Santiago

Santiago Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @svpino

28 Jan
Interviews aren't only about technical skills.

Here are some questions to help you prepare.

๐Ÿงต๐Ÿ‘‡
Explain what you have been working on for the past few weeks.

What are the most exciting parts about that work?

What portion of it do you consider boring and why?

[2 / 10]
What specific libraries and frameworks are you familiar with?

What's the minimum set of libraries and frameworks that you'd recommend to any practitioner?

[3 / 10]
Read 11 tweets
27 Jan
An easy change that will improve your communication immediately:

โ–ซ๏ธ When explaining your progress, start from the end.

After that, take time to explain the next steps and go through the process you followed if needed.

๐Ÿงต๐Ÿ‘‡
If you only had a couple of sentences to communicate what you did, how would you structure the message?

You wouldn't want to waste it listing out every single step you went through, right?

There's a much better way.

[2 / 7]
You'll always be better off getting to the core of your findings right away.

โ–ซ๏ธ What is the thing that everyone cares about?
โ–ซ๏ธ What do they want to understand?

Only after that should you get into adjacent details.

[3 / 7]
Read 7 tweets
25 Jan
After well over a decade fully dedicated to web development, I learned a thing or two.

Here are a few thoughts that may be helpful:

๐Ÿงต๐Ÿ‘‡
Obviously, HTML, JavaScript, and CSS are table stakes.

There are plenty of jobs out there where you only require these, but it's always smart to go beyond the basics.

Don't get comfortable because the money is coming in.
A good way of increasing your value is by adventuring outside your comfort zone.

Whenever you are ready, I'd recommend you look into:

โ–ซ๏ธ Databases
โ–ซ๏ธ REST APIs
โ–ซ๏ธ UX

There's much more, but this is a great place to start.
Read 18 tweets
24 Jan
Some of the things I've learned in more than 20 years in the tech industry.

You need to hear these.

๐Ÿงต๐Ÿ‘‡
Listen to more people who don't look like you, don't speak your language, and don't come from the same place you do.

We aren't doing this near enough.
Small habits compound.

No small improvement is too small.

Just aim for something new every day, and you'll be surprised at the end.
Read 23 tweets
19 Jan
What are the differences between a multi-class classification problem and a multi-label classification problem?

(This is the answer to the second question from the attached thread.)



๐Ÿงต๐Ÿ‘‡
Let's assume we are classifying images into 3 different classes.

We will process each image and assign them to the class corresponding to the animal they show.

For example, we will classify the attached images as CAT, DOG, and CHICK.

๐Ÿ‘‡
Because we are classifying images into three or more classes, this is a multi-class classification problem.

The main characteristic of these problems is that the classes are mutually exclusive: we either classify an image as a CAT, DOG, or CHICK.

๐Ÿ‘‡
Read 8 tweets
18 Jan
100,000 followers!
Here is a rant about followers, some "you-can-do-it" encouragement, and a little bit about my account's story.

๐Ÿ‘‡
Of course, this tweet was a way for me to hack the number of people who go and look at my profile.

You know, one of those silly experiments I've been doing.

But here is the thing: although 100,000 is still out there, it will happen at some point this year!

๐Ÿ‘‡
Read 12 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!