Coding Challenge #85 - Time Zone Converter
This challenge is to build your own time zone conversion application and plan better across multiple timezones.
Hi this is John with this week’s Coding Challenge.
🙏 Thank you for being one of the 77,574 software developers who have subscribed, I’m honoured to have you as a reader. 🎉
If there is a Coding Challenge you’d like to see, please let me know by replying to this email📧
Coding Challenge #85 - Time Zone Converter
This challenge is to build your own Time Zone Converter. That is a tool to help people visualise and plan meetings across multiple time zones.
For example, take my live course, Build A Redis Server Clone: Master Systems Programming Through Practice that’s mentioned below. To make it work, I need to find a time slot that works for me in GMT, my fellow Europeans in CET and the largest market for the course, those in North America, therefore both EST and PST (and the timezones in between).
In theory it’s easy, just remember the timezone offsets. In reality it gets more complicated when you realise different countries change to daylight savings time on different dates.
🚨The Early Bird Discount Ends Soon! 🚨
Build A Redis Server Clone: Master Systems Programming Through Practice!
I’m running the Coding Challenges Live (Redis) course again starting 24th of March and you can get up to 30% off until Monday 10th March! See below for details.
It is a live course that runs for two working weeks from March the 24th to April 4th. During the course you’ll implement from scratch a clone of the original Redis server and extend it to support the RESP2 protocol and some additional commands.
This course touches on a wide variety of topics that are applicable to general programming, for example:
👉 Parsing skills. These can be applied to a variety of problems including data munging, scraping, protocol implementation and more.
👉 Understanding network programming. This can be applied to making more robust, secure and scalable distributed systems.
👉 Experience handling concurrency and parallelism in software. Giving you the core skills to build scalable distributed systems.
👉 Testing. Network servers are complex system software with components that can interact in non-trivial ways. Figuring out how to test them is a challenge. You’ll explore unit and integration testing.
This course is entirely project focused. The goal of the course is not just to learn how to write a server, but also how to approach the problem of server software. Part of the course involves group discussion about problem decomposition, coding techniques, design tradeoffs, testing, and other related topics. The rest of the time is spent working on individual coding.
You might not think that you're ready to write a server, but if you've been coding for a while and know the basics of data structures, it's something that you can tackle. No prior background in network servers is required although awareness of common programming language concepts (e.g., types, functions, classes, scoping rules, etc.) is strongly advised.
If you are a paid subscriber you can get 30% off - please visit the paid subscriber benefits page for the code. If you are a free subscriber you can get 20% off if you sign up here (code: EARLYBSS) or you could subscribe now! 😀
You can read all about the course here: https://codingchallenges.fyi/live-courses/redis
If you have any questions, please hit reply and ask away.
I offer a similar self-paced course on building a Redis Clone in Python and Go.
The Challenge - Building A Time Zone Converter
In this coding challenge your goal is to build a website or application that allows the user to enter a source timezone and one or more additional timezones and then see what the time is in each timezone relative to the source timezone.
Something a bit like this:
It should account for daylight savings time changes around the world too.
Step Zero
Like most of the coding challenges this one can be tackled in most programming languages and tech stacks. If you’re a frontend developer you could build it all in your favourite frontend stack. If you’re a applications programmer you could build some GUI based software. If you’re a backend/data engineering/systems software engineer you could build a CLI application.
Or just have fun and try something new!
Either way, your mission in step zero is to decide what you’re going to build it as and setup a new project with your chosen tech stack, programming language and development environment. After that proceed directly to step 1!
Step 1
In this step your goal is to allow the user to enter a source timezone and one or more additional timezones. Ideally they should be able to pick by city or timezone abbreviation.
You can find a full list of the timezone abbreviations on Wikipedia here.
Step 2
In this step your goal is to display the source timezone and additional timezones in a list on the screen and allow the user to re-order the list.
Include the ability to sort the list relative to the source timezone too. This should result in timezones with a negative offset being before the source and those with a positive offset after it.
Step 3
In this step your goal is to show 24 hours of each timezone. They should be aligned and start from 0:00 in the first listed timezone. The user should be able to hover over an hour and see the group of times that apply at that time.
For example the green box in this picture:
Step 4
In this step your goal is to allows the user to highlight a time period and have it reflected as the start and end time for each timezone. In other words make it possible to drag that green bar around a time period and show the start and the end time in each timezone.
This is demonstrated on the above picture.
Step 5
In this step your goal is to reflect daylight savings time. So in March and October/November.
Two Other Ways I Can Help You:
I write another newsletter Developing Skills that helps you level up the other skills you need to be a great software developer.
I have a YouTube channel sharing advice on software engineering.
Share Your Solutions!
If you think your solution is an example other developers can learn from please share it, put it on GitHub, GitLab or elsewhere. Then let me know via Bluesky or LinkedIn or just post about it there and tag me. Alternately please add a link to it in the Coding Challenges Shared Solutions Github repo
Request for Feedback
I’m writing these challenges to help you develop your skills as a software engineer based on how I’ve approached my own personal learning and development. What works for me, might not be the best way for you - so if you have suggestions for how I can make these challenges more useful to you and others, please get in touch and let me know. All feedback greatly appreciated.
You can reach me on Bluesky, LinkedIn or through SubStack
Thanks and happy coding!
John