April 14, 2017 An Interview With Wladimir Leite (wleite)
Wladimir Leite (wleite) has been a Topcoder member since 2003. He has participated in 8 onsite finals, in Marathon and Algorithm tracks. Besides that, he copilots some sponsored Marathon matches.
gorbunov: I have insider information that you are a computer forensics expert. Can you tell us more about that?
wleite: I have been working as a computer forensics expert for the last 11 years. I came from a software development career, mostly working on banking related projects. It is totally different from what I was used to, dealing with all sorts of crimes, which can be unpleasant sometimes, but very challenging, as each case has peculiar (and usually unknown) characteristics.
gorbunov: Does the knowledge and skills you gained at Topcoder help you at work?
wleite: As I only need to write small utilities programs in my regular job, Topcoder challenges are a great way to keep my programming skills in good shape. Besides that, I have learned a lot of things competing in marathon matches (e.g. optimization, machine learning, and image processing techniques). Just to illustrate a bit, about 3 years ago, I didn’t have any machine learning knowledge. Competing in sponsored matches was a great way to start in this area. Last year I developed a simple (but very useful) algorithm to detect “explicit images”, currently used to speed up the analysis of real cases in which the forensics expert has to visually inspect a huge number of images.
gorbunov: I noticed that you rarely skip a Marathon Match. How do you manage to combine your day job with participating in the competitions, taking into account that doing well in marathons requires considerable amount of time to be spent?
wleite: That is a critical issue for me, and I guess for everyone who has a full time regular job and wants to compete. What I try to do is to improve the “usage quality” of my time when I am working in a marathon, i.e. avoid just sitting in front of the computer and watch it running thousands of tests (as I already did in the past when I had more free time). Now I usually have few (1~8) hours during night to work (plus part of the weekends). During these hours, I try to implement the most promising ideas, in a more or less organized way, and schedule longer tests batches to run when I am sleeping, at work, etc. Another thing that I often do is to prepare different versions of my solution, so even without working in the problem, I can still make few submissions when I am busy.
gorbunov: I will skip my regular question about story behind your nickname this time. Instead, how many Topcoder members do you know in person?
wleite: Since I’ve been in 8 TCO onsite events, I know many members in person. By the way that is a great part of the “Topcoder experience”, meeting awesome people from all over the world. Few of the good friends that I made in past TCOs are blackmath, eldidou, CatalinT, nika, Mojito1, mugurelionut, yedtoss, cjalmeida, romanoTC, pieguy, doudouille, [Jaco], and t-mac.
gorbunov: You started at Topcoder back in 2003, taking part in one of the early SRM contests. One year later you gained the red color in Algorithm competitions. Can you tell us more about those historical times, who were the leaders, how did the tasks differ from what they are nowadays?
wleite: Time really flies! SRMs were a great way for me to start here. I never reached a very high rating, but still got results that I am proud of (TCO 2007 onsite semifinal, 1st overall place on SRM 215, ~25 division 1 hard problems solved). In the first years, I practiced a lot, solving past problems. After the SRMs, I used to continue working on the problems that I missed until finding a passing solution. That was a great way to learn! Unfortunately, I don’t have the time to do that anymore. My favorite competitor at that time was SnapDragon, with his fast and elegant submissions.
gorbunov: How did you know about the Topcoder back then?
wleite: I was learning Java, and used to visit Sun’s website every single day. One day, there was a release about Topcoder, because Sun was the main sponsor of the 2003 TCCC (Topcoder Collegiate Challenge).
gorbunov: Did you attend programming or other discipline competitions at school or university? If so, did you have a coach or teammates?
wleite: I competed in national Mathematics competitions during high school, but not very seriously. My father is a Mathematics teacher. Although not formally, I would say he was my coach and the person who motivated me to start competing. Unfortunately, computer programming competitions only started here in Brazil when I was already graduated.
gorbunov: You have participated in Topcoder Marathon matches since MM 1. Does it feel more difficult to compete now than it was before, or has experience gained in past matches help?
wleite: Experience helps a lot in marathons matches. Now I usually figure out quickly (comparing to my initial standards) a good way to approach the problem, based in my experiences from past similar challenges. Experience also helps a lot with the strategy involved in a contest (e.g. when/where to spend more time and energy, how to use the information gave by other competitors’ scores/submissions).
gorbunov: How much time on average do you spend while solving a Marathon puzzle?
wleite: It varies a lot, but I would say something around 40 hours in a 2-week marathon. Certainly more on TCO qualification rounds.
gorbunov: What is the proportion of think/code times?
wleite: It is hard to tell because during a match I usually think about the problem “in the background” almost all of the time. In the hours dedicated to the match, I usually spend most of time coding and watching the visualizer. Very few times I try to “just think”, like writing or drawing in a piece of paper.
gorbunov: I believe your answers to the next questions will be valuable for newcomers.
It is not a secret that every non-trivial program has at least one bug. How do you fix them? What tools do you use to debug, profile, cleanup your code?
wleite: I rarely use something more sophisticated than couple of print statements. Maybe that explains why I always find a lot of bugs when reading my code from previous marathons!
gorbunov: I noticed that the code you submit during the competition (at least the last submission) is very clean and clear to understand. How do you achieve this? How often do you rewrite it from scratch?
wleite: That is good question! In the past I used to start coding very quickly and after a couple of days my solution was a complete mess, and I couldn’t go any further. To avoid that, I try (although not always successfully) to start slowly, keeping ideas relatively organized. That usually pays off, and I wish my code was much more organized. For me, really producing a truly “nice and clean” code consumes precious time, so I try to stay somewhere in the middle. In the last few years, I only rewrite from the scratch when in the middle of the contest my score is stuck far from the leaders.
gorbunov: You constantly submit the solutions in Java. There are good reasons for doing so in SRM/Algorithm competitions, because it is always known that the writer’s solution is also in Java and that implies that it is possible to write passing solution in that language. However, in past Marathons most of the top solutions are non-deterministic, and aggressively utilizing the time limit given. Does it feel painful when somebody submits the same algorithm as yours and gets more points just because of Java being a 1.5 times slower on average? Or do you prefer to count on the so-called developer time to be more valuable than runtime?
wleite: Although I worked with C++ many years ago, I am not used to it anymore. Writing a basic solution in C++ would take me much longer than in Java, consuming more energy, killing all the fun, and probably it will have many hard to find bugs. Java is pretty much the only option for me. Although the performance difference can be a clear disadvantage sometimes, I would say that for most matches it doesn’t make that much difference. I always like to point out that we had many matches won by Java submissions, and even a TCO marathon champion – wata – in 2010.
gorbunov: There are so-called sponsored matches that are regular now. Despite completely different in many aspects from the traditional fun matches, you do pretty well in both. What is the secret?
wleite: I really like competing and solving problems in general. Although sponsored matches are very different from traditional “fun” matches, most of them feature very interesting problems. Dealing with the real world “overhead” from sponsored problems can be annoying sometimes, but usually this is just a small part of the task. And the rest has the fun part of solving a challenge we usually have in fun marathons.
gorbunov: You mentioned once that you use 64-core mainframe now for local testing in sponsored matches. Does it pay off purely from material perspective or you plan to reuse your ideas or even code somewhere else? Other reasons for such an investment, taking into account that the computer power grows exponentially with time and so does decrease the cost of such a purchase?
wleite: For most sponsored matches, I use large AWS instances, but only in later stages of the competition, as the cost grows quickly when you let these machines run for a long time (unfortunately I prefer using Windows instances, which are pricier). Currently I am considering buying a powerful workstation (at least 32 cores and 128 GB of RAM). The “problem” is that I already got used to these large/fast AWS instances, and now working in my home PC (8 cores and 32 GB) seems a waste of time.
gorbunov: We observe many new members register to a match, but do not participate. Perhaps the tasks are too difficult. What can you suggest to our new members?
wleite: Don’t get scared by the amount of information or the initial complexity of the problem! Almost everything seems hard when you start. Try to build a simple working solution, and slowly improve from there. Another important aspect, is that once you try to solve by yourself the problem during the contest, even if you didn’t manage to came up with a great solution, you will enjoy much more the post-match discussions, and will learn more from reading other solutions (code and/or descriptions).
gorbunov: The creative credo?
wleite: Keep it simple!
Although we tend to look for complex “super smart” ways of solving things, often when analyzing the winning approaches, we find out that the right combination of simple and elegant ideas worked much better, with less coding effort.