The Wayback Machine - https://web.archive.org/web/20241123172241/https://www.geeksforgeeks.org/coding-decoding/
Open In App

Coding Decoding Question and Answers

Last Updated : 30 Oct, 2024
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Coding decoding is an important part of the Quantitative Aptitude section in most of the competitive examinations in India. 

Coding and decoding questions are a common feature in the reasoning ability section of major Government exams such as those conducted by banks, insurance companies, SSC, and RRB.

Prerequisites: Coding-Decoding – Tricks

Sample Questions on Coding-Decoding

Q1. If EARTH is written as FCUXM in a certain code. How is MOON written in that code? 

Solution : 

Q2. If DELHI is written as EDMGJ in a certain code. How is NEPAL written in that code?

Solution :  

Q3. If SYMBOL is written as NZTMPC is it a certain code? How is NUMBER written in that code? 

Solution: 

Acc. to question 
 

Q4. In a certain code, COMPUTER is written as PMOCRETU, how is DECIPHER written in that code? 

Solution: 

Acc. to question 
 

Q5. In a certain code, NEWYORK is written as 111, how is NEWJERSEY written in that code?

Solution : 

In NEWYORK 
N = 14, E = 5, W = 23, Y = 25, O = 15, R = 18, K = 11 
Total = 14 + 5 + 23 + 25 + 15 + 18 + 11 = 111 
In NEWJERSEY 
Total = 14 + 5 + 23 + 10 + 5 + 18 + 19 + 5 + 25 
= 124 
 

Q6. In a certain code, HARYANA is written as 8197151, how is DELHI written in that code? 

Solution: 

We used the number of alphabets here. 
H = 8 
A = 1 
R = 18 = 1+8 = 9 
Y = 25 = 2+5 = 7 
For DELHI 
D = 4 
E = 5 
L = 12 = 1+2 = 3 
H = 8 
I = 9 
Hence, DELHI is written as 45389. 

Q7. In a certain code BOMB is written as 5745 and BAY is written as 529, how is BOMBAY written in that code?

Solution: 

Acc. to question 
Use the numbers to relate the words 

      B O M B      B A Y      ->          B O M B A Y 
5 7 4 5 5 2 9 5 7 4 5 2 9

Practice Problems on Coding Decoding

Q1. If in a certain language, MADRAS is coded as NBESBT, how is BOMBAY coded in that code?

(a) CPNCBX (6) CPNCBZ (c) CPOCBZ (d) CQOCBZ (e) None of these

Answer: b

Q2. In a certain code, TRIPPLE is written as SQHOOKD. How is DISPOSE written in that code?

(a) CHRONRD (6) DSOESPI (c) ESJTPTF (d) ESOPSID (e) None of these

Answer: a

Q3. If in a code language. COULD is written as BNTKC and MARGIN is written as LZQFHM, how will MOULDING be written in that code?

(a) CHMFINTK (6) LNKTCHMF (c) LNTKCHMF (d) NITKHCMF (e) None of these

Answer: c

Q4. In a certain code, MONKEY is written as XDJMNL. How is TIGER written in that code?

(a) QDFHS (6) SDFHS (c) SHFDQ (d) UJHFS (e) None of these

Answer: a

Q5. If FRAGRANCE is written as SBHSBODFG, how can IMPOSING be written?

(a) NQPTJHOJ (6) NQPTJOHI (c) NQTPJOHJ (d) NQPTJOHJ (c) None of these

Answer: d


Previous Article
Next Article

Similar Reads

Encoding and Decoding Custom Objects in Python-JSON
JSON as we know stands for JavaScript Object Notation. It is a lightweight data-interchange format and has become the most popular medium of exchanging data over the web. The reason behind its popularity is that it is both human-readable and easy for machines to parse and generate. Also, it's the most widely used format for the REST APIs. Note: For
5 min read
Encoding and Decoding Base64 Strings in Python
The Base64 encoding is used to convert bytes that have binary or text data into ASCII characters. Encoding prevents the data from getting corrupted when it is transferred or processed through a text-only system. In this article, we will discuss about Base64 encoding and decoding and its uses to encode and decode binary and text data. Base64 encodin
4 min read
Elias Delta Decoding in Python
In this article, we are going to implement Elias Delta Decoding using python. Peter Elias devised the Elias delta code, which is a universal system for encoding positive integers. Syntax: Elias Delta Encoding(X)= Elias Gamma encoding (1+floor(log2(X))) + Binary representation of X without MSB. Approach:Import required libraries and read the encoded
2 min read
Elias Gamma Decoding in Python
The Elias gamma code is a universal code that is used to encode a sequence of positive integers. It is developed by Peter Elias. It is most useful when the upper-bound of integers cannot be determined beforehand. Formula: Elias Gamma Coding=Unary(1+floor(log2(x)))+Binary representation of 'x' without MSB Example: Let’s consider an example where we
2 min read
How Do I Perform HTML Decoding/Encoding Using Python/Django?
HTML (HyperText Markup Language) is used for creating webpages. Sometimes, we need to make sure that special characters in this HTML are displayed correctly. For example, characters like <, >, and & have special meanings in HTML, so they need to be encoded (converted to a special format) when displayed as plain text. Sometimes, we may als
4 min read
TCS National Qualifier 2 Coding Question.
You are given a string and your task is to print the frequency of each character. Direction to Solve Problem: 1. Take string from STDIN. aaaabbBcddee2. Get all different characters in given string using set(). set ={a, b, B, c, d, e} # unordered set3. Iterate for different characters ( len(set )) because we only need to print a character one time a
3 min read
Secure coding - What is it all about?
So you think you can code? Well that’s great to know… The world definitely needs more geeks and nerds like you and me… But, are your programs secure? This is what this whole article is all about. As a programmer, it is not only your job but also moral responsibility to ensure that your codes don’t have any margin which can be later on exploited by
6 min read
Why is python best suited for Competitive Coding?
When it comes to Product Based Companies, they need good coders and one needs to clear the Competitive Coding round in order to reach the interview rounds. Competitive coding is one such platform that will test your mental ability and speed at the same time. Who should read this? Any programmer who still hasn't tried python for Competitive Coding M
7 min read
Google Geo-coding Web Service (JSON response)
Prerequisite : JSON Formatting in Python Google has an excellent web service that allows us to make use of their large database of geographic information. Here, we are going to be working with the Google Maps API. In the old days, this Maps API was free and did 2, 500 requests per day but now they've made it so that parts of it are behind API keys
4 min read
Unary coding in Python
Unary code also sometimes called thermometer code is a type of entropy encoding. It is a lossless data compression technique with application in Golomb codes. Unary representation of a natural number n is n ones followed by a zero. For example, unary code for 6 will be 6 ones followed by a zero which is 1111110 Example: Input: 5 Output: 111110 resu
2 min read
Must Know Things to Clear Your Python Coding Interview
Python is not only one of the most loved languages but rather it is used in various different domains. Due to its high dependency and usage in a lot of fields, there has suddenly been an increase in the job openings in Python programming language and related frameworks. Python developers are in high demand as it solves problems effortlessly in area
6 min read
How to use the Live Coding Feature of Python in Eclipse?
In this article, we'll be talking about how to use the Live Coding features of Python in Eclipse. Every time the programmer has to spend a lot of time debugging their code. And still, they failed to debug. This extension will help the coders or programmers to reduce their debugging time. This extension is downloadable in Eclipse IDE / PyCharm IDE.
2 min read
PEP 8 : Coding Style guide in Python
Indeed coding and applying logic is the foundation of any programming language but there's also another factor that every coder must keep in mind while coding and that is the coding style. Keeping this in mind, Python maintains a strict way of order and format of scripting.Following this sometimes mandatory and is a great help on the user's end, to
5 min read
Python Tricks for Competitive Coding
Python is one such programming language that makes everything easier and straight forward. Anyone who has dabbled in python for Competitive Coding gets somewhat addicted to its many features. Here is a list of some of its cool features that I've found most useful in a competitive coding environment. The most common function of the Counter Package.
5 min read
Top 40 Flask Interview Questions and Answers
Flask is a popular Python web framework used to build web applications. If you're preparing for a Flask development position, it's important to be ready for the types of questions that you might encounter in an interview. In this article, we'll go through some of the top 40 Flask interview questions and provide answers to help you prepare. Q 1. Wha
15 min read
Top 50 Plus Networking Interview Questions and Answers for 2024
Networking is defined as connected devices that may exchange data or information and share resources. A computer network connects computers to exchange data via a communication media. Computer networking is the most often asked question at leading organizations such Cisco, Accenture, Uber, Airbnb, Google, Nvidia, Amazon, and many others. To get int
15+ min read
30 OOPs Interview Questions and Answers (2024) Updated
Object-oriented programming, or OOPs, is a programming paradigm that implements the concept of objects in the program. It aims to provide an easier solution to real-world problems by implementing real-world entities such as inheritance, abstraction, polymorphism, etc. in programming. OOPs concept is widely used in many popular languages like Java,
15+ min read
C# Interview Questions and Answers
C# is the most popular general-purpose programming language and was developed by Microsoft in 2000, renowned for its robustness, flexibility, and extensive application range. It is simple and has an object-oriented programming concept that can be used for creating different types of applications. Here, we will provide 50+ C# Interview Questions and
15+ min read
Top 50 Django Interview Questions and Answers
Django is one of the high-level Python-based free and open-source web frameworks and was created in 2003. It follows the model-view-template (MVT) architectural pattern. Nowadays, It is one of the most demanding skills. It has been managed by Django Software Foundation (DSF), a Non-benefit Organization based in the United States. If you are a begin
15+ min read
Top 50 Plus Software Engineering Interview Questions and Answers [2024]
Software engineering is one of the most popular jobs in this technology driven world. The demand for creative software engineers is increasing as technology becomes crucial for businesses in various sectors. If you are new to programming and want your first job as a software engineer, or if you are an experienced developer looking for a better job,
15+ min read
Top 50 TCP/IP Interview Questions and Answers 2024
Understanding TCP/IP is essential for anyone working in IT or networking. It's a fundamental part of how the internet and most networks operate. Whether you're just starting or you're looking to move up in your career, knowing TCP/IP inside and out can really give you an edge. In this interview preparation guide, we have listed top 50 TCP/IP interv
15+ min read
Top 50 IP Addressing Interview Questions and Answers
In today’s digital age, every device connected to the internet relies on a unique identifier called an IP Address. If you’re aiming for a career in IT or networking, mastering the concept of IP addresses is crucial. In this engaging blog post, we’ll explore the most commonly asked IP address interview questions, breaking down everything from the ba
15+ min read
Top 50+ Python Interview Questions and Answers (Latest 2024)
Python is the most used language in top companies such as Intel, IBM, NASA, Pixar, Netflix, Facebook, JP Morgan Chase, Spotify, and many more because of its performance and its powerful libraries. To get into these companies and organizations as a Python developer, you need to master some important Python Interview Questions to crack their Python O
15+ min read
Python MCQ (Multiple Choice Questions) with Answers
Python is a free open-source, high-level and general-purpose with a simple and clean syntax which makes it easy for developers to learn Python. Python programming language (latest Python 3) is being used in web development, Machine Learning applications, along with all cutting-edge technology in Software Industry. In this Python MCQ article, you wi
3 min read
Django Interview Questions & Answers With Practical Tips For Junior Developers
Django... Isn't it your favorite framework? (especially if you are new to the programming world) Yes! It is... Did you try to learn this framework and build some projects? If the answer is Yes then here is the next question... Did you understand the complete flow of the project? Again if the answer is Yes then here is another question (don't get an
15+ min read
Loops and Control Statements (continue, break and pass) in Python
Python programming language provides the following types of loops to handle looping requirements. Python While Loop Until a specified criterion is true, a block of statements will be continuously executed in a Python while loop. And the line in the program that follows the loop is run when the condition changes to false. Syntax of Python Whilewhile
4 min read
Python counter and dictionary intersection example (Make a string using deletion and rearrangement)
Given two strings, find if we can make first string from second by deleting some characters from second and rearranging remaining characters. Examples: Input : s1 = ABHISHEKsinGH : s2 = gfhfBHkooIHnfndSHEKsiAnG Output : Possible Input : s1 = Hello : s2 = dnaKfhelddf Output : Not Possible Input : s1 = GeeksforGeeks : s2 = rteksfoGrdsskGeggehes Outpu
2 min read
Releasing GIL and mixing threads from C and Python
Releasing GIL in C extension: Give a C extension code and one needs to concurrently execute it with other threads in the Python interpreter. For this Global Interpreter Lock (GIL) has to be released and reacquired. Code #1 : Releasing and Reacquiring GIL by inserting following macros #include "Python.h" ... PyObject *pyfunc(PyObject *self
2 min read
Django Request and Response cycle - HttpRequest and HttpResponse Objects
Prerequisite - Views In Django | PythonBefore we jump into using convenience methods that views come with, Let's talk about the Request and Response cycle. So, when a Request happens to a Django server, a couple of things go on. One of them is Middleware. Middleware Middleware is like a middle ground between a request and response. It is like a win
4 min read
OpenCV - Facial Landmarks and Face Detection using dlib and OpenCV
Content has been removed on Author's request.
1 min read
Article Tags :
Practice Tags :
three90RightbarBannerImg