Thales Coding Questions and Answers

Thales Coding Questions with Solutions

On this page, you will get Thales Coding Questions and Answers asked in Online Assessment and Coding – Technical Interview involved Thales Recruitment Process.

Apart from this, you will get other details like Job profiles, Job Locations, CTC Offered, and specific steps of the Recruitment Process.


About Thales

Thales was founded in 1968, and earlier it was named Thomson – CSF, is a French MNC that designs and manufactures electronic devices and equipment for defense, aerospace, transportation, security, and surveillance-related Organizations.

In 1999, Thales and Samsung Electronics created a Joint Venture and started manufacturing Electronic Equipments together.

Thales Recruitment Process

The recruitment process mainly consists of 3 processes :

  1. Online Assessment [ Aptitude + Logical + Verbal + Coding ]
  2. Technical Interview
  3. HR Interview

We have mentioned further details of the Thales Recruitment Process in the following Tabular Form

ThalesRelated Information
Position :Software Engineer – Support
Course :
  • B.E / B.Tech CSE, IT, ECE & EEE
  • Eligible Batch – 2023
Eligibility Criteria / Academic Qualification Required :
  • A minimum of 60 % is required in 10th / 12th/ B.Tech.
  • No Current Backlogs
Cost to Company (CTC)
  • During Internship – Rs. 25,000 /- per month.
  • After Internship – 8 LPA
Selection Process :
  1. Online Assessment
  2. Technical Interview
  3. HR Interview
Joining Location :Noida

Prime Course Trailer

Related Banners

Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription

Thales Coding Questions and Answers

Question 1: Consecutive Prime Sum

Problem Description

Question – :  Some prime numbers can be expressed as a sum of other consecutive prime numbers.

  • For example
    • 5 = 2 + 3,
    • 17 = 2 + 3 + 5 + 7,
    • 41 = 2 + 3 + 5 + 7 + 11 + 13.
      Your task is to find out how many prime numbers which satisfy this property are present in the range 3 to N subject to a constraint that summation should always start with number 2.

Write code to find out the number of prime numbers that satisfy the above-mentioned property in a given range.

Input Format: First line contains a number N

Output Format: Print the total number of all such prime numbers which are less than or equal to N.

Constraints: 2<N<=12,000,000,000

Question 2 : Reach the Channel

Problem Statement – Sahil watches TV all day and gets bored. He started playing this dumb game of identifying minimum number of inputs needed to reach a channel. As his cousin, you have to help him, but you live far from his house. So you decide to write a code that will ask Sahil for some inputs and give outputs respectively.

Here are the problems you need to keep in mind,

  • There are 13 buttons on his remote: 10 buttons for the numbers (0-9) to form integers denoting respective channel index, “Up channel” button and  “ Down channel” button for going i +1th channel and i-1th channel from i respectively, and  a “Last viewed” button to see what’s the last channel before it. 
  • The number buttons allow you to jump directly to a specific channel  (Ex: to go to channel 172 by typing 1,7,2).
  • If the channel which you are in is ith and that is the max channel index possible, by Up channel, you will reach the first channel possible. Same goes for the down channel button. You can go to the highest channel possible if you go down from the lowest channel possible.

Sahil can get from one channel to the next in one of the two ways.

Sahil’s parents have set some parental control on some channels on Aniruth’s television. The “Up Channel “ and “Down buttons” buttons skip these channels as these channels are not viewable.

Given a list of channels to view, the lowest channel, the highest channel, and a list of blocked channels, your program should return the minimum number of clicks necessary to get through all the shows that Anirudh would like to match.

Input Format

  • First line is the lowest Channel
  • Second-line is the highest Channel
  • Followed by a number of blocked channels B, 
  • and the next B lines contain the actual blocked channels.
  • Followed by the number of Channels to view V, and the next V lines contain the actual channels to view.


  • The lowest channel on the television will be greater than 0. and less than or equal to 10,000.
  • The highest channel on the television will be greater than or equal to the lowest channel. and less than or equal to 10.000. 
  • The list of channels that are blocked on Anirudh’s television. All the channels in this list will be valid channels (greater than or equal to lowest channel, less than or equal 1 to highest channel). Duplicates may be Ignored. The blocked list can be a maximum of 40 channels.  
  • The sequence that Sahil must view contains between 1 and 50 elements. inclusive. All channels in this sequence are not in the blocked list and are between lowest channel and highest channel. Inclusive.

Sample Input 0:












Sample output 0:


Question 3 : Find the Siblings

Henry is extremely keen on history and every one of the ages of his family. He does a ton of exploration and understands that he has plummeted from the incomparable Amaya line. After a ton of looking through old records and the most recent records of the general public, he can discover all the parent-kid connections in his family right from the extraordinary ruler Ming of the tradition to himself.

These connections are given in the structure a direct exhibit where emperor is at the main position and his kids are at pos (2i + 1) and (2i + 2)

This is the pattern followed throughout.

Henry needs to sort out every one of the kin of individual X from the information.

Write a program for Henry to figure out all the siblings of person X from the data.
Return the sorted list of all of Henry’s siblings.

If no sibling return {-1}

  • input 1: N, the length of the array
  • input2: An array representing the ancestral tree
  • input 3 : X, the person whose siblings are sought.
  • output – return the array of all siblings in increasingly sorted order.

Example 1 :

input 1 : 5
input 2 : {1,2,3,4,5}
input 3 : 1
output : {-1}
Explanation : x is the root of the tree and has no siblings

Example 2 :
input 1 : 6
input 2 : {1,2,3,4,5,6}
input 3 : 5
output : {4,6}
Explanation : {2,3 } are the children of {1}.
{4,5,6 } are the children of {2,3}, thus the siblings of x= 5 are {4,6}

Question 4 : Total Distance Covered by the Beetle

Problem Description

A 10cm x 10cm x 10cm solid cube rests on the ground. It has a beetle on it, as well as some sweet honey spots on the cube’s surface. The beetle begins at a point on the cube’s surface and moves in a clockwise direction along the cube’s surface to the honey spots.

  • If it goes from one point on the same face to another (say, X to Y), it goes in an arc of a circle that subtends an angle of 60 degrees at the circle’s center.
  • If it travels from one point to another on a different face, it takes the shortest path on the cube’s surface, except that it never travels along its bottom.

The beetle is a Cartesian geometry student who knows the coordinates (x, y, z) of all the points it needs to visit. Its coordinate origin is one of the cube’s corners on the ground, and the z-axis points up. As a result, z=0 is the bottom surface (on which it does not crawl), and z=10 is the top. The beetle keeps track of all distances traveled and rounded the distance to two decimal places when it arrives at the following location so that the final distance is a sum of the rounded distances from spot to spot.


The first line returns an integer N, the total number of points visited by the beetle (including the starting point).

The second line contains 3N non-negative numbers, each with two decimal places. These are to be interpreted as the x, y, and z coordinates of the points the beetle must visit in the given order.


One line containing a number representing the total distance traveled by the beetle to two decimal places. Even if the travel distance is an integer, the output should have two decimal places.


None of the points visited by the beetle are on the bottom face (z=0) or on any of the cube’s edges (the lines where two faces meet)


Question 5 : Hamming Distance

Problem Statement : Given two integers, the task is to find the hamming distance between two integers. Hamming Distance between two integers is the number of bits that are different at the same position in both numbers.

Example :

Input 1:

a= 10 , b =8

Output 1:


Explanation: 10= 1010 , 8=1000 , No of different bits=1.

Input 2:

a=9, b=14

Output 2:


Explanation: 9=1001 , 14=1110  , No. of different bits=3.

FAQs on Thales Coding Questions

Question 1: In what field does Thales primarily work on?

Thales is a multinational technology company that operates in the aerospace, defense, transportation, and security sectors.

Question 2: Is coding questions asked in Thales Recruitment Process?

Yes, in both 1st Round (i.e Online Assessment) and 2nd Round (i.e. Technical Interview) coding questions was asked in Thales Recruitment Process.

Question 3: Does Thales offer internships in India?

Yes, Thales does offer internships in India for students and recent graduates. You can check the Thales careers page for current internship opportunities.

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others

Checkout list of all the video courses in PrepInsta Prime Subscription

Checkout list of all the video courses in PrepInsta Prime Subscription