#TuentiChallenge6: Show me the numbers

Publicado el 20/5/2016 por Daniel Pañeda, Principal Software Engineer & Alfredo Beaumont, Senior Software Engineer

8 Days
298,791 Lines of code
3,294 Attempts to solve a problem
2,577 Problems correctly solved
1,817 People registered
776 People solving at least one problem


776 people passed the first problem and 4 brave participants reached the final optimization problem and fought each other to obtain the best score. This year, the challenges were a little easier than usual, because the 20th challenge was a NP optimization problem, and we wanted people to have some time to try to reach a high score.

There were two stoppers --problems with less solvers than the next one--, problems 11 and 15. The problems with the lowest percentage of solvers among all the people that tried to solve them were problems 14 and 15, as you can see in the graph below. All in all, it seems that problem 15 was one of the toughest.

Percentage of problems solved

Number of solutions per problem


As usual, we’ve seen a lot of languages being used to solve the problems, 25 this year. We already talked about the most popular, but there are some interesting languages being used to solve only a couple of problems. Visual Basic, Rust and Objective C were used just in one solution, there were two solutions in F# and three in Ocaml. The following graph shows the evolution of the most used languages on every challenge (excluding some non algorithmic ones).

The evolution of languages

Lines of code

The shortest solution has been a cryptic but well crafted shell script with just one line and 142 characters, which recalls this twitter fight we had two years ago, searching for the shortest solution to a problem. The longest one is a solution for the 9th problem with 12163 lines, including some very long libraries for number factorization.

As usual, in this following graph you have the average number of lines per solution on most used languages.

Lines per language

Optimization problem

We introduced a novelty in the last challenge: we created an optimization problem and a score system. An optimization problem is a NP complete problem in which having an optimal solution is too hard and thus the objective is to find a solution as near as possible to the optimal. This means that this challenge never ended and participants could have fun until the end of the contest and compete between them for the best score. We had 4 participants that reached this last level, you can see their score evolution in the following graph:

Score timeline in optimization problem

Kudos to all of them and specially to Jakub who was the best with a score of 34972. Good work!

This solution was quite close to the best solution that, without the time constraints of the contest, we obtained with a greedy algorithm (yes, we have to admit that we had some fun ourselves with this problem ;), which has a score of 35104. Using local search we managed to get  a score of 36035. We will give more details of how we got this score in a future post. In the meantime… what’s the best score you can get?

Tuenti Challenge 6: Phase 1 results sneak peek

Publicado el 06/5/2016 por Daniel Pañeda, Principal Software Engineer & Alfredo Beaumont, Senior Software Engineer

The first round of the sixth edition of Tuenti Challenge ended this Tuesday at 13:37 hours, as scheduled. Of the 1817 people registered in this first phase, 781 of them were able to solve at least one problem and 756 of them were able to solve at least one of them correctly (both the test and submit phase).

You can see the full final ranking of the first round here.

This year, the first challenges were a little easier than in previous years, which means more problems solved and more people having fun \o/. What’s more, this year’s last challenge was something special. More info on this in our next posts!

There was very little change in the most used languages by the contestants in this edition, with Python, C++, Java and PHP being the most used languages, as you can see in the graph.

Tuenti Challenge is a competition where we can demonstrate our technical skills and which enables people with technical interests to have a good time while giving visibility to Tuenti as a company that is firmly based on technology in order to find especially qualified individuals for our team. The problems are a combination of programming, security and ingenuity challenges.

For those who wish to continue hacking or to complete any unfinished exercises, the webpage for the Challenge will remain available until next year ;) We would like to congratulate the top 30 ranked contenders and thank everyone for participating! Now it’s time for the second round. The excitement is building!

Ikusth: Android threads dependency graph generator

Publicado el 30/3/2016 por Iván Mosquera Paulo, Lead Software Engineer

ChkBugReport is a command line tool which parses and converts android traces files into more human-readable html reports. Once you get your traces.txt file, instead of trying to check the dependency among threads manually you can use the ChkBugReport tool against it which would generate a report like this:

In this example you see that the tool has detected a deadlock. It doesn’t mean you have a deadlock every time you get an ANR; it may be just be a busy Thread, in which case the system will let you know this.

We sent 2 pull requests to the ChkBugReport project. The first one made the deadlock report richer and the second one implemented a graph model we needed in order to create an external plugin that would generate an image with the thread dependencies: Ikusth.

Using ChkBugReport with Ikusth is easy. You will see a graph like this and, if you’ve ever had to draw something like this yourself, you’ll understand how cool it is :)

More info and support in the project’s github.

.Tuenti for Android Wear

Publicado el 16/3/2016 por Guillermo M. and Alejandro M, Software Engineers, and David P., Principal Software Engineer

It’s been a while since the Android Wear OS was launched. Back in 2014, we were all excited by the possibilities offered by these tiny screens on our wrists.

A few months later, during a Hack Me Up, we made a prototype of what we thought customers would be looking for in a .Tuenti application for a Wear device. The initial challenge was to design an interface for a screen so small that it can be difficult to interact with. We wanted an application that displays information really quickly, and enables the user to contact their friends as quickly and easily as possible.

Finally, Alejandro Miragall, David Pastor and I began to prepare the architecture for our app to meet .Tuenti quality standards. We followed the Clean Code principles and designed our app as a little brother of the Mobile application.

Our application enables the user to interact with incoming notifications, check their current account balance, navigate through and call their favorite contacts or answer/decline incoming VozDigital calls.

We hope that this is just the start of this new app and we plan to continue adding new functionalities to it.

Hack Me Up 28: Hacking a new beginning!

Publicado el 11/3/2016 por Engineering Outreach Committee

We've just finished the 28th edition of our non-stop hacking session in the office after 24 hours of brainstorming, coding and testing (with coffee, pizza and more coffee).

The projects presented in this Hack Me Up were tested live during Demo time before the voting took place, which involved all members of the company. As always, there were two categories, Product and Geek.

With 12 projects presented, the winners in each category were:

  • In the Product category, Víctor P. won with Open VozDigital: Telegram & More, which consisted of a SDK to integrate our VozDigital technology in other apps.
  • In the Geek category we had a tie, Pedro L., Alexis S., Abel T. lifted the trophy for Tuenti powered by React Native, a version of our app built using React Native, and, Juan Antonio G. with Call activity visualization which consisted of a map of cell tower's usage.

Now it’s time to have a well-deserved snack and to celebrate. Congratulations to all the participants and the winning teams! Will one of the projects presented become a reality? We’ll keep you informed…