competitive programming

i am pursuing engineering . so i want to ask do i need to do competitive programming to be a cyber security specialist. if yes why and if no why?

TL;DR: No (IMO).

Programming really helps in cyber sec but I thing there’s no need for so called “competitive programming” where not just the output is judged but also time spent on the problem and other things like e.g optimization.
In cyber sec you code mostly tools/exploits/shellcodes. This type of software needs to do its job and it really doesn’t matter if you write an eye-candy code with cool optimization tricks or not. It has to work. Of course if you create a public security tool, you should mind the code quality.

You should be familiar with programming concepts and be able to write ur tools, know how several vulnerabilities are made and how do they look in code, but I don’t thing that programming is the most important thing in security.