master d8198cb7c2c1 cached
32 files
76.8 KB
22.3k tokens
26 symbols
1 requests
Download .txt
Repository: amalpoulose/Zoho-Interview-questions
Branch: master
Commit: d8198cb7c2c1
Files: 32
Total size: 76.8 KB

Directory structure:
gitextract_5u_4w79b/

├── .gitignore
├── LICENSE
├── README.md
├── Set 01 Qns.txt
├── Set 01-01.print the following pattern.c
├── Set 01-02.find sum of weights based on the following conditions.c
├── Set 01-03.Save the string in a two dimensional array and search for substring.c
├── Set 01-05.find no of grandchildren.c
├── Set 02-01.Alternate sorting.c
├── Set 02-01.Alternate sorting.py
├── Set 02-02.Remove unbalanced parentheses in a given expression.c
├── Set 02-02.Remove unbalanced parentheses in a given expression.py
├── Set 02-03.Form a number system with only 3 and 4.c
├── Set 02-qns
├── Set 03-01.program to give the following output.c
├── Set 03-02.sort the elements in odd positions in descending order and elements in ascending order.c
├── Set 03-03.program to print the following output for the given input.c
├── Set 03-05-01.two sorted arrays, merge them such that the elements are not repeated.c
├── Set 03-05-02.two sorted arrays, merge them such that the elements are not repeated.c
├── Set 03-Qns
├── Set 08 Qns
├── Set 08 Qns2
├── Set 08-01.Spiral printing.c
├── Set 08-02.Two strings of equal length are given print the mismatched ones..c
├── Set 08-03.Get a number and check whether its palindrome do not use arrays and string manipulations.c
├── Set 12-01.Given two numbers a and b both < 200 we have to find the square numbers which lie between a and b.c
├── Set 12-03.Given an array and a threshold value find the output.c
├── Set 12-05.Write a program to print the below pattern.c
├── Set 12-06.Given bigger NxN matrix and a smaller MxM matrix print TRUE if the smaller matrix can be found in the bigger matrix else print FALSE.c
├── Set 12-07.Given two matrices a and b both of size NxN find if matrix a can be transformed to matrix b by rotating it 90deg , 180deg , 270deg if so print TRUE else print FALSE.c
├── Set 12-08.In addition to the above question you have to check if matrix a can be transformed by mirroring vertically or horizontally to matrix b..c
└── Set 12-Qns

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
# Prerequisites
*.d

# Object files
*.o
*.ko
*.obj
*.elf

# Linker output
*.ilk
*.map
*.exp

# Precompiled Headers
*.gch
*.pch

# Libraries
*.lib
*.a
*.la
*.lo

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex

# Debug files
*.dSYM/
*.su
*.idb
*.pdb

# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf


================================================
FILE: LICENSE
================================================
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    {one line to give the program's name and a brief idea of what it does.}
    Copyright (C) {year}  {name of author}

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    {project}  Copyright (C) {year}  {fullname}
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.


================================================
FILE: README.md
================================================
# Zoho-Interview-questions
previous zoho interview questions


================================================
FILE: Set 01 Qns.txt
================================================
SET 1

Second Round: (Normal Programming round)
1. Print the word with odd letters as

P         M
 R      A
   O  R
     G
  O    R
 R       A
P          M 


2. Given a set of numbers like <10, 36, 54,89,12> we want to find sum of weights based on the following conditions
    1. 5 if a perfect square
    2. 4 if multiple of 4 and divisible by 6
    3. 3 if even number

And sort the numbers based on the weight and print it as follows

<10,its_weight>,<36,its weight><89,its weight>

Should display the numbers based on increasing order.


3. Save the string “WELCOMETOZOHOCORPORATION” in a two dimensional array and search for substring like “too” in the two dimensional string both from left to right and from top to bottom.

w	e	L	C	O
M	E	T	O	Z
O	H	O	C	O
R	P	O	R	A
T	I	O	n	  

And print the start and ending index as

Start index : <1,2>

End index: <3, 2>


4. Given a 9×9 sudoku we have to evaluate it for its correctness. We have to check both the sub matrix correctness and the whole sudoku correctness.


5. Given a two dimensional array of string like

  <”luke”, “shaw”>
  <”wayne”, “rooney”>
  <”rooney”, “ronaldo”>
  <”shaw”, “rooney”> 

Where the first string is “child”, second string is “Father”. And given “ronaldo” we have to find his no of grandchildren Here “ronaldo” has 2 grandchildren. So our output should be 2.


Third Round: (Advanced Programming Round)


Here they asked us to create a “Railway reservation system” and gave us 4 modules. The modules were:
    1. Booking
    2. Availability checking
    3. Cancellation
    4. Prepare chart
We were asked to create the modules for representing each data first and to continue with the implementation phase.


================================================
FILE: Set 01-01.print the following pattern.c
================================================
  /*  To print the following pattern
        	P     M
                 R   A
                  O R
                   G
                  O R
                 R   A
                P     M                   */

#include<stdio.h>
int main(void)
{

	char str[100],i,j,k,n;
	printf("Enter the string : ");
	scanf("%s",str);
	for(n=-1;str[n];n++);
        if(n%2==0)
        {
          printf("\n\nString length is even\n\n");
          return;
        }
	n=n/2+1;
	for(i=1;i<=n;i++)
	{
		k=0;
		for(j=1;j<i;j++)
			printf(" ");
		for(j=1;j<=2*(n-i)+1;j++)
		{  if(j==1 || j==2*(n-i)+1)
			printf("%c",str[i-1+k]);
			else
				printf(" ");
			k++;
		}
		printf("\n");
	}

	for(i=2;i<=n;i++)
	{
		k=0;
		for(j=1;j<=n-i;j++)
			printf(" ");
		for(j=1;j<=2*i-1;j++)
		{
			if(j==1 || j==2*i-1) 
				printf("%c",str[n-i+k]);
			else
				printf(" ");
			k++;
		}
		printf("\n");
	}
}



================================================
FILE: Set 01-02.find sum of weights based on the following conditions.c
================================================
/* Given a set of numbers like <10,36,54,89,12> we want to find sum of weights based on the following conditions
    1. 5 if a perfect square
    2. 4 if multiple of 4 and divisible by 6
    3. 3 if even number

And sort the numbers based on the weight and print it as follows

<10,its_weight>,<36,its weight><89,its weight>

Should display the numbers based on increasing order*/
#include<stdlib.h>
#include<stdio.h>
int check(int);
int main(void)
{
	int *a,i,j,n;
	printf("Array size : ");
        scanf("%d",&n);
        a=malloc(sizeof(int)*n);
           printf("Enter array elements : ");
        for(i=0;i<n;i++)
            scanf("%d",&a[i]);
	printf("Array elements : ");
        for(i=0;i<n;i++)
            printf("%d ",a[i]);
	for(i=0;i<n-1;i++)
		for(j=0;j<n-i-1;j++)
			if(check(a[j])>check(a[j+1]))
				a[j]=a[j]+a[j+1]-(a[j+1]=a[j]);
	printf("The elements after sorting with its weight is : \n");
	for(i=0;i<n;i++)
		printf("< %d , %d >\n",a[i],check(a[i]));
        free(a);
	return 0;
}

int check(int n)
{
	int sum,weight=0,i;
	for(sum=0,i=1;i<n;i+=2)
	{
		sum=sum+i;
		if(sum==n)
			weight+=5;
	}
	if(n%4==0 && n%6==0)
		weight+=4;
	if(n%2==0)
		weight+=3;
	return weight;
}


================================================
FILE: Set 01-03.Save the string in a two dimensional array and search for substring.c
================================================
/* Save the string “WELCOMETOZOHOCORPORATION” in a two dimensional array and search for substring like “too” in the two dimensional string both from left to right and from top to bottom.

w	e	L	C	O
M	E	T	O	Z
O	H	O	C	O
R	P	O	R	A
T	I	O	n	  

And print the start and ending index as

Start index : <1,2>

End index: <3, 2>*/
#include<stdio.h>
int sqt(float);
int main(void)
{
 // a is 2d array to store the sting
char str[100],str1[100],a[100][100];
 //main variables inx =index of string  n= length of string rc=number of rows and coloumn(square matrix)
int n,rc,i,j,inx,k,c;
 //enter main string to str
printf("Enter the string : ");
scanf("%s",str);
//find length of string
for(n=0;str[n];n++);
 // find row and coloumn size by taking square root of n(length of string
if(n=sqt(n)*sqt(n))
 rc=sqt(n)+1;
else
 rc=sqt(n);
 //enter each character in to 2 diamensional array
for(inx=0,i=0;i<rc ;i++)
  for(j=0;j<rc && str[inx];j++)
   { 
      a[i][j]=str[inx++];
   }
// print contents of 2d array
for(i=0;i<rc;i++)
{
  for(j=0;j<rc;j++)
   printf("%c ",a[i][j]);
  printf("\n");
}
//Enter the substring as str1
printf("Enter word to found  :  ");
scanf("%s",str1);
//find substring in rows
for(i=0;i<rc;i++)
  for(j=0;j<rc;j++)
    if(a[i][j]==str1[0])
    {  for(k=j,c=0;a[i][k]==str1[c] && a[i][k]!='\0';k++,c++);
       if(str1[c]=='\0'){
          printf("\nStart index : <%d ,%d>   End index: <%d, %d>\n",i,j,i,k-1);}
    }
//find substring in coloumns
for(i=0;i<rc;i++)
  for(j=0;j<rc;j++)
    if(a[j][i]==str1[0])
    { 
      for(k=j,c=0;a[k][i]==str1[c] && a[k][i]!='\0';k++,c++);
       if(str1[c]=='\0'){
         printf("\nStart index : <%d ,%d>   End index: <%d, %d>\n",j,i,k-1,i);}
    }          
return 0;

}

//user defined function to find square root by Babylonian method
int sqt(float n)
{
float x=n,y=1;
while(x-y>0.00001)
{
  x=(x+y)/2;
  y=n/x;
}
return x;
}


================================================
FILE: Set 01-05.find no of grandchildren.c
================================================
/*  Given a two dimensional array of string like

  <”luke”, “shaw”>
  <”wayne”, “rooney”>
  <”rooney”, “ronaldo”>
  <”shaw”, “rooney”> 

Where the first string is “child”, second string is “Father”. 
And given “ronaldo” we have to find his no of grandchildren Here “ronaldo” has 2 grandchildren.
 So our output should be 2. */
#include<stdlib.h>
#include<stdio.h>
int main(void)
{
char *str,***a;
str=malloc(50);
int n,i,j,c=0;
//enter th number of pair of strings
printf("Enter the number of pair : ");
scanf("%d",&n);
//create 3d array dynamically using malloc
a=malloc(sizeof(char*)*n);     //allocate n character pointer spaces and store addres in a
for(i=0;i<n;i++)                 
{ a[i]=malloc(sizeof(char*)*2); // store 2 chara pointer spaces to every previously allocated n spaces 
  for(j=0;j<2;j++)
     a[i][j]=malloc(sizeof(char)*50); // allocate 50 bytes to previously allocated 2 char pointer spaces
}
//enter the list of strings
printf("Enter the strings : ");
for(i=0;i<n;i++)
{
  for(j=0;j<2;j++)
   scanf(" %s",a[i][j]);
}
//print length of strings
printf("The Array is : \n");
for(i=0;i<n;i++)
{
  printf("<");
  for(j=0;j<2;j++)
   printf("%-10s ",a[i][j]);
  printf(">\n");
}
//enter the grangfather name 
printf("Enter the string : ");
scanf("%s",str);

printf("Grandchildren of %s :  ",str);
for(i=0;i<n;i++)
  if(strcmp(a[i][1],str)==0)             //Locate grandfather in the list
      for(j=0;j<n;j++)                   // Find son of the grandfather
         if(strcmp(a[j][1],a[i][0])==0)  //find grandchildren
          {  printf("%s ",a[j][0]); 
             c++;                        //increment count for every grandchildren   
          }
printf("\nNumber of grandchildren  :  %d\n",c);
free(a);
free(str);
return 0;
}         



================================================
FILE: Set 02-01.Alternate sorting.c
================================================
/*  Alternate sorting: Given an array of integers, rearrange the array in such a way that the first element is first maximum and second element is first minimum.

    Eg.) Input  : {1, 2, 3, 4, 5, 6, 7}
         Output : {7, 1, 6, 2, 5, 3, 4} */
#include<stdio.h>
int main(void)
{
	int a[100],i,j,n,t;
	printf("Array size : ");
	scanf("%d",&n);
	printf("Enter array elements : ");
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	printf("Array elements : \n");
	for(i=0;i<n;i++)
		printf("%d ",a[i]);       
	printf("\n");
	/* Selection sort is used because the 1st element would be fixed after one iteration of outer loop*/ 
	for(i=0;i<n-1;i++)                     
		for(j=i+1;j<n;j++)
		{
			if(i%2)                   // if i value is odd then smallest value in remaining index values is goes to ith index
			{  if(a[i]>a[j])
				a[i]=a[i]+a[j]-(a[j]=a[i]);
			}
			else                   //  if i value is even then largest value in remaining index values is goes to ith index
			{
				if(a[i]<a[j])   
					a[i]=a[i]+a[j]-(a[j]=a[i]);
			}
		} 
	printf("Array elements : \n");
	for(i=0;i<n;i++)
		printf("%d ",a[i]);       
	printf("\n");
	return 0;
}


================================================
FILE: Set 02-01.Alternate sorting.py
================================================
#!/usr/bin/python
''' Alternate sorting: Given an array of integers, rearrange the array in such a way that the first element is first maximum and second element is first minimum.
    Eg.) Input  : {1, 2, 3, 4, 5, 6, 7}
         Output : {7, 1, 6, 2, 5, 3, 4}'''
arr=[] 
def main():
     arr_size=input("array size : ")
     print "elements : "
     for i in range(arr_size):
         arr.append(input())
     for i in range(len(arr)-1):
         if i%2==0:
             for j in range(i,len(arr)):
                 if arr[i]<arr[j]:
                     arr[i],arr[j]=arr[j],arr[i]
         else:
             for j in range(i,len(arr)):
                 if arr[i]>arr[j]:
                     arr[i],arr[j]=arr[j],arr[i]
     print arr  
     
if __name__=="__main__":
        main()


================================================
FILE: Set 02-02.Remove unbalanced parentheses in a given expression.c
================================================
/* Remove unbalanced parentheses in a given expression.

    Eg.) Input  : ((abc)((de))
         Output : ((abc)(de)) 
 
         Input  : (a(b)))(cd)  
         Output : (a(b))(cd)

	 Input  : (a(b)))(c(d)
         Output : (a(b))(cd)

         Input  : (ab))(c(d))))
         Output : (ab)(c(d))

         Input  : (((ab)
         Output : (ab) 

*/
#include<stdio.h>
int main(void)
{
	char str[100];
	int i,j,end=0;
	printf("enter the string : ");
	scanf("%s",str);
	for(i=0;str[i];i++)
	{
		if(str[i]=='(')
		{ 
			for(end+=1;str[end]!=')'&&str[end]!='\0';end++);
			if(str[end]=='\0')                         //remove unbalanced '(' at any position
			{
				for(j=i;str[j]=str[j+1];j++);    
				i--;
			}
			if(end<i)
			{
				for(j=end;str[j]=str[j+1];j++);    //remove unbalanced ')' at middle position 
				i-=1;
			}
		}
		if(str[i]==')')                                     //remove unbalanced ')' at last positions
		        if(i>end || i==0)
			{
				for(j=i;str[j]=str[j+1];j++);
				i--;}

	}
	printf("New string is : %s\n",str);
	return 0;
}



================================================
FILE: Set 02-02.Remove unbalanced parentheses in a given expression.py
================================================
#!/usr/bin/python

#Remove unbalanced parentheses in a given expression
def remove(s,index):
    s=s[:index]+s[index+1:]
    return s
    
def main():
         s=raw_input("string : ")
         start,stop=0,0
         while s[start:].find('(') != -1:
             
             index=s[start:].find('(')+start
            
             
             while s[stop:index].find(')')!=-1:
                 s=remove(s,s[stop:].find(')')+stop)
                 index-=1
              
             if s[stop:].find(')') == -1:
                 s=remove(s,index)
              
                 
             else:
                 stop=s[stop:].find(')')+stop+1
                 start=index+1
                
         while s[stop:].find(')')!= -1:
             s=remove(s,s[stop:].find(')')+stop)
             
         print "formatted string : ",s
if __name__=="__main__":
        main()


================================================
FILE: Set 02-03.Form a number system with only 3 and 4.c
================================================
/* C) Form a number system with only 3 and 4. Find the nth number of the number system.
Eg.) The numbers are: 3, 4, 33, 34, 43, 44, 333, 334, 343, 344, 433, 434, 443, 444, 3333, 3334, 3343, 3344, 3433, 3434, 3443, 3444 ….
*/
#include<stdio.h>
int main(void)
{
	int n,i,m,pos,tmp=1,num_dgs;
	printf("Enter the value n  : ");
	scanf("%d",&n);
	m=n;

	for(i=-1;m;m/=2,i++);  //find number of digits
	num_dgs=i;

	for(;i;i--)           //find nearest value which is power of two
		tmp*=2;

	pos=n-tmp;           
	pos++;               //find position of nth  number in the class of num_digits 
                             //eg: 11 is 4th number in 3 digits numbers

	if(!num_dgs)         //if  n=1 when pos = 1 next step becomes  number of digits  1 and position 0
		pos=1;

	if(pos==tmp){       //In cases for example n=7 we have to make number of digits 3 instead of 2 and pos 0
		pos=0;
		num_dgs++;
	}

	printf("The %dth number in sequence is : ",n);
	for(i=num_dgs-1;i>=0;i--)                      //loop in which where 1 is present in bits of pos prints 4 and where 0 print 3
		if((pos>>i)&1)
			printf("4");
		else
			printf("3");

	printf("\n");

	return 0;
}


================================================
FILE: Set 02-qns
================================================
Set 2

1) First Round : Written

40 C output questions. 2 Hours.
30 1Mark and 10 2Mark questions. IT WAS NOT MCQ. The questions were challenging and covered all C concepts.

2) Second Round : Coding

Around 150 students shortlisted for this round. It was a local machine coding round. A staff will be assigned to a group of 5 students. He made note of the time took for solving each question. There was totally 7 questions and I solved 4 questions and did not complete the 5th question.

A) Alternate sorting: Given an array of integers, rearrange the array in such a way that the first element is first maximum and second element is first minimum.

    Eg.) Input  : {1, 2, 3, 4, 5, 6, 7}
         Output : {7, 1, 6, 2, 5, 3, 4} 

B) Remove unbalanced parentheses in a given expression.

    Eg.) Input  : ((abc)((de))
         Output : ((abc)(de))  

         Input  : (((ab)
         Output : (ab) 

C) Form a number system with only 3 and 4. Find the nth number of the number system.
Eg.) The numbers are: 3, 4, 33, 34, 43, 44, 333, 334, 343, 344, 433, 434, 443, 444, 3333, 3334, 3343, 3344, 3433, 3434, 3443, 3444 ….

D) Check whether a given mathematical expression is valid.
Z
    Eg.) Input  : (a+b)(a*b)
         Output : Valid

         Input  : (ab)(ab+)
         Output : Invalid

         Input  : ((a+b)
         Output : Invalid 

I don’t remember the 5th question.

3) Third Round : Advanced Coding
A matrix game was given with 5 rules. We were asked to implement each of the rules separately.


  R3 | -   -   - |
  R2 | -   -   - |
  R1 | -   -   - |
       C1  C2  C3  

Each of the 9 cells can either be empty or filled with an atom. R3, R2, R1 are the rays that originate from the left. C1, C2, C3 are the rays that originate from the bottom of the box.

Input : Position of the atoms and the rays that gets originated from the outside of the box.

  Eg.) 3
       3 1
       2 2
       1 3
       3
       R3 C1 C3

Output  : Print the box. 

Rule 1:
A ray that has an atom in its path should print ‘H’ (Hit) If it does not have any atoms in its path, the ray should pass to the other side.

       C1      C3
  R3 | -   -   - | R3
  H  | -   X   - |
  R1 | -   -   - | R1
       C1  H   C3 

Rule 2 & 3:
A ray that has an atom in its diagonal adjacent position should refract.

  H  | -   -   - |
  H  | X   -   - |
  R  | -   X   - |
       R   H   R  

Input rays: R1, R2, C3

  H  | -   X   - |
  R2 | -   -   - | C3
     | -   -   - |
       R2      C3  

Rule 4:
A ray that has atoms in both of the diagonal adjacent positions should reflect back.


Input ray: C2
   | -   -   - |
   | X   -   X |
   | -   -   - |
         R   

Input ray: R2
     | -   X   - |
  R  | -   -   - |
     | -   X   - | 

Rule 5:
The deflection of rays should happen in the order of the input rays.

Input Rays: R3, R2, C1, C3
   H | -   X   - |
  R2 | -   -   - | C3
     | -   -   - |
       R2      C3 

The final task was to implement these rules for dynamic matrix size.


Input : no of rows, no of columns
  Eg.) 4 4 (row & column)
       2 (No of atoms)
       4 4 (Position of atom)
       2 2 (Position of atom)
       2 (No of rays)
       R4 C2 (Ray number)

  H  | -   -   -   X |
     | -   -   -   - |
     | -   X   -   - |
     | -   -   -   - |
           H  

The final task was very confusing and it had to handle all the cases. There are chances for a ray to end at the starting position if the number of rows and columns are more than 5.

4) Fourth Round : Technical Interview
Basic questions from hashing, searching, sorting, JVM, OS, Threads. In-depth questions from the projects that I mentioned in my resume. So don’t just add projects that you are not thorough enough to answer all questions.

And a simple puzzle : (x-a)(x-b)(x-c)….(x-z) = ? 😀

5) Fifth Round : HR
General HR questions like why zoho, how do you see yourself after 5 years, why did you choose CS/IT stream, tell me about your leadership skills etc.


================================================
FILE: Set 03-01.program to give the following output.c
================================================
/* 1. Write a program to give the following output for the given input

Eg 1: Input: a1b10
       Output: abbbbbbbbbb
Eg: 2: Input: b3c6d15
          Output: bbbccccccddddddddddddddd
The number varies from 1 to 99.*/
#include<stdlib.h>
#include<stdio.h>
int main(void)
{
char *str,last;
int i,n=0;
str=malloc(100);
printf("Enter the string  : ");
scanf("%s",str);

for(i=0;str[i];i++)
{ 
  if(str[i]<48||str[i]>57)
  {
     printf("%c",str[i]);                           //print characters other than integer value and continue the loop
     continue;
  }
  for(last=i;(str[i]>=48&&str[i]<=57)&&str[i];i++)  //Loop to find integer value store it in n
     n=n*10+(str[i]-48);
  i--;
  if(last)                                          //if first value is integer that is last = 0 do nothing simply put n=0 in else part
  for(n-=1;n;n--)                                   //Loop to print n times the character
    printf("%c",str[last-1]);            
  else n=0;
}
printf("\n");
free(str);
return 0;
}
 


================================================
FILE: Set 03-02.sort the elements in odd positions in descending order and elements in ascending order.c
================================================
/* 2. Write a program to sort the elements in odd positions in descending order and elements in ascending order

Eg 1: Input : 13,2 4,15,12,10,5
      Output: 13,2,12,10,5,15,4
Eg 2: Input : 1,2,3,4,5,6,7,8,9
      Output: 9,2,7,4,5,6,3,8,1 
*/
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
	int *a,n,i,j;
	printf("Array size : ");
	scanf("%d",&n);
	a=malloc(sizeof(int)*n);
	printf("Enter Elements : ");
	for(i=0;i<n;i++)
		scanf("%d",a+i);
	for(i=0;i<n-1;i++)
		for(j=i+1;j<n;j++)
		{
			if(i%2)
			{
				if(a[i]>a[j])
					a[i]=a[i]+a[j]-(a[j]=a[i]);
			}
			else
			{
				if(a[i]<a[j])
					a[i]=a[i]+a[j]-(a[j]=a[i]);
			}
		}
	printf("Array elements  : ");
	for(i=0;i<n;i++)
		printf("%d ",a[i]);
        printf("\n");
	free(a);
	return 0;
}    



================================================
FILE: Set 03-03.program to print the following output for the given input.c
================================================
/*3. Write a program to print the following output for the given input. You can assume the string is of odd length

Eg 1: Input: 12345
       Output:
1       5
  2   4
    3
  2  4
1      5
Eg 2: Input: geeksforgeeks
         Output:
g                         s
  e                     k
    e                 e
      k             e
        s         g
          f      r
             o
          f     r
        s         g
      k             e
    e                 e
  e                      k
g                          s 
*/
#include<stdio.h>
int main(void)
{
	char str[50];
	int i,j,n;
	printf("Enter the string : ");
	scanf("%s",str);
	for(n=0;str[n];n++);
	n=n/2+1;
	for(i=1;i<=n;i++)
	{
		for(j=1;j<i;j++)
			printf(" ");
		for(j=0;j<2*(n-i)+1;j++)
			if(j==0 || j==2*(n-i))
				printf("%c",str[i-1+j]);
			else
				printf(" ");
		printf("\n");
	}

	for(i=2;i<=n;i++)
	{
		for(j=1;j<=n-i;j++)
			printf(" ");
		for(j=1;j<=2*i-1;j++)
			if(j==1 || j==2*i-1)
				printf("%c",str[n-i-1+j]);
			else
				printf(" ");
		printf("\n");
	}

	return 0;
}


================================================
FILE: Set 03-05-01.two sorted arrays, merge them such that the elements are not repeated.c
================================================
/* 5. Given two sorted arrays, merge them such that the elements are not repeated

Eg 1: Input:
        Array 1: 2,4,5,6,7,9,10,13
        Array 2: 2,3,4,5,6,7,8,9,11,15
       Output:
       Merged array: 2,3,4,5,6,7,8,9,10,11,13,15 */

/* Procedure 1 : Remove repeated terms and saving into third array(lengthy)*/
#include<stdio.h>
int main(void)
{
	int a[100],b[100],c[100],i,j,k,m,n;
	printf("\n---------------------------------------------------------------\n");
	printf("Array  size 1: ");
	scanf("%d",&m);
	printf("Elements to array 1 : \n");
	for(i=0;i<m;i++)
		scanf("%d",&a[i]);
	printf("Array  size 2: ");
	scanf("%d",&n);
	printf("Elements to array 2 : \n");
	for(i=0;i<n;i++)
		scanf("%d",&b[i]);
	printf("\n---------------------------------------------------------------\n");
	printf("\nArray 1 elements :");
	for(i=0;i<m;i++)
		printf("%d ",a[i]);
	printf("\nArray 2 elements :");
	for(i=0;i<n;i++)
		printf("%d ",b[i]);
	for(i=0,j=0,k=0;i<m && j<n;k++)
	{
		if(b[j]<a[i])               //element of array b is smaller then true 
		{
			if(c[k-1]==b[i])    //if previous element in 3rd array is current element then discard it otherwise save it into 3rd array  
				i++;
			else{
				c[k]=b[j];
				j++;
			}
		}
		else if(a[i]<b[j])          //element of array a is smaller then true
		{ 
			if(c[k-1]==a[i])    //if previous element in 3rd array is current element then discard it otherwise save it into 3rd array
				i++;
			else
			{   
				c[k]=a[i];
				i++;
			}
		}
		else if(a[i]==b[j])        // if both elements in array a and b are  equal then true
		{  
			if(c[k-1]==a[i]){  //if previous element in 3rd array is current element then discard it otherwise save it into 3rd array
				i++;j++;k--;
			}
			else{
				c[k]=a[i];
				i++;
				j++;
			}
		}

	}

	while(i<m || j<n)            // if m and n are different values the remaing values must store into 3rd array
	{
		if(i<m)              //if i<m true only 1st array elements remaining
		{
			if(c[k-1]==a[i]) //if previous element in 3rd array is current element then discard it otherwise save it into 3rd array
				i++;
			else 
			{  
				c[k]=a[i];
				i++;
				k++;
			}
		}
		if(j<n)                //if i<m true only 1st array elements remaining
		{
			if(c[k-1]==b[j]) //if previous element in 3rd array is current element then discard it otherwise save it into 3rd array
				j++;
			else
			{
				c[k]=b[j];
				j++;
				k++;
			}
		}
	}
	printf("\nArray 3 elements :");
	for(i=0;i<k;i++)
		printf("%d ",c[i]);
	printf("\n");
	printf("\n---------------------------------------------------------------\n");
	return 0;
}


================================================
FILE: Set 03-05-02.two sorted arrays, merge them such that the elements are not repeated.c
================================================
/*5. Given two sorted arrays, merge them such that the elements are not repeated

Eg 1: Input:
        Array 1: 2,4,5,6,7,9,10,13
        Array 2: 2,3,4,5,6,7,8,9,11,15
       Output:
       Merged array: 2,3,4,5,6,7,8,9,10,11,13,15 */
/*Procedure 2 : Saving both array into 3rd array and removing repeated terms*/
#include<stdio.h>
int main(void)
{
	int a[100],b[100],c[100],i,j,k,l,m,n;
	printf("\n---------------------------------------------------------------\n");
	printf("Array  size 1: ");
	scanf("%d",&m);
	printf("Elements to array 1 : \n");
	for(i=0;i<m;i++)
		scanf("%d",&a[i]);
	printf("Array  size 2: ");
	scanf("%d",&n);
	printf("Elements to array 2 : \n");
	for(i=0;i<n;i++)
		scanf("%d",&b[i]);
	printf("\n---------------------------------------------------------------\n");
	printf("\nArray 1 elements :");
	for(i=0;i<m;i++)
		printf("%d ",a[i]);
	printf("\nArray 2 elements :");
	for(i=0;i<n;i++)
		printf("%d ",b[i]);
	for(i=0;i<m;c[i]=a[i],i++);    //save array 1 elements to array 3 
	for(j=0;j<n;c[i]=b[j],i++,j++);//save array 2 elements to array 3
	l=m+n;                         //l is length of array 3
	for(i=0;i<l;i++)
		for(j=i+1;j<l;j++)
			if(c[i]==c[j])   // if repeating terms found in array 3 
			{
				for(k=j;k<l-1;c[k]=c[k+1],k++);   //delete repeating terms 
				l--;                              //reduce length of array 3 by one
				j--;                              //j reduces by one to continue on same jth iteration
			}         


	printf("\nArray 3 elements :");
	for(i=0;i<l;i++)
		printf("%d ",c[i]);
        printf("\n");
        printf("\n---------------------------------------------------------------\n");
        return 0;
}


================================================
FILE: Set 03-Qns
================================================
Set 3

ROUND 1: WRITTEN
APTITUDE(1 hr and 20 minutes-20 questions): Problems on average, probability, time & distance, alligation&mixture,ratio, HCF & LCM and few a puzzles.

TECHNICAL(45 minutes-10 questions): Output for C questions. Practice questions in geekquiz.com and C output questions in geeksforgeeks.org. Questions in pointers, strings, matrix etc.

Nearly 60 students were selected out of 600 candidates. They didn’t select the top 60. They had a cutoff and those who cleared the cutoff were called for the next round

ROUND 2: SIMPLE CODING(3 hours)

1. Write a program to give the following output for the given input

Eg 1: Input: a1b10
       Output: abbbbbbbbbb
Eg: 2: Input: b3c6d15
          Output: bbbccccccddddddddddddddd
The number varies from 1 to 99.

2. Write a program to sort the elements in odd positions in descending order and elements in ascending order

Eg 1: Input: 13,2 4,15,12,10,5
        Output: 13,2,12,10,5,15,4
Eg 2: Input: 1,2,3,4,5,6,7,8,9
        Output: 9,2,7,4,5,6,3,8,1 

3. Write a program to print the following output for the given input. You can assume the string is of odd length

Eg 1: Input: 12345
       Output:
1       5
  2   4
    3
  2  4
1      5
Eg 2: Input: geeksforgeeks
         Output:
g                         s
  e                     k
    e                 e
      k             e
        s         g
          f      r
             o
          f     r
        s         g
      k             e
    e                 e
  e                      k
g                          s 

4. Find if a String2 is substring of String1. If it is, return the index of the first occurrence. else return -1.

Eg 1:Input:
        String 1: test123string
         String 2: 123
        Output: 4
Eg 2: Input:
        String 1: testing12
        String 2: 1234 
        Output: -1

5. Given two sorted arrays, merge them such that the elements are not repeated

Eg 1: Input:
        Array 1: 2,4,5,6,7,9,10,13
        Array 2: 2,3,4,5,6,7,8,9,11,15
       Output:
       Merged array: 2,3,4,5,6,7,8,9,10,11,13,15 

6. Using Recursion reverse the string such as

Eg 1: Input: one two three
      Output: three two one
Eg 2: Input: I love india
      Output: india love I 

19 cleared this round and they were called for the next round. The next round took place on the next day

ROUND 3: COMPLEX CODING(3 hours)

1) Design a Call taxi booking application
-There are n number of taxi’s. For simplicity, assume 4. But it should work for any number of taxi’s.
-The are 6 points(A,B,C,D,E,F)
-All the points are in a straight line, and each point is 15kms away from the adjacent points.
-It takes 60 mins to travel from one point to another
-Each taxi charges Rs.100 minimum for the first 5 kilometers and Rs.10 for the subsequent kilometers.
-For simplicity, time can be entered as absolute time. Eg: 9hrs, 15hrs etc.
-All taxi’s are initially stationed at A.
-When a customer books a Taxi, a free taxi at that point is allocated
-If no free taxi is available at that point, a free taxi at the nearest point is allocated.
-If two taxi’s are free at the same point, one with lower earning is allocated
-Note that the taxi only charges the customer from the pickup point to the drop point. Not the distance it travels from an adjacent point to pickup the customer.
-If no taxi is free at that time, booking is rejected

Design modules for

1)    Call taxi booking 
Input 1:
Customer ID: 1
Pickup Point: A
Drop Point: B
Pickup Time: 9

Output 1:
Taxi can be allotted.
Taxi-1 is allotted

Input 2:
Customer ID: 2
Pickup Point: B
Drop Point: D
Pickup Time: 9

Output 1:
Taxi can be allotted.
Taxi-2 is allotted 

(Note: Since Taxi-1 would have completed its journey when second booking is done, so Taxi-2 from nearest point A which is free is allocated)


Input 3:
Customer ID: 3
Pickup Point: B
Drop Point: C
Pickup Time: 12

Output 1:
Taxi can be allotted.
Taxi-1 is allotted 

2) Display the Taxi details


Taxi No:    Total Earnings:
BookingID    CustomerID    From    To    PickupTime    DropTime    Amount
   
Output:
Taxi-1    Total Earnings: Rs. 400

1    1    A    B     9    10    200
3    3    B    C    12    13    200

Taxi-2 Total Earnings: Rs. 350
2    2    B    D    9    11    350 

These were just sample inputs. It should work for any input that they give.
Those who finished both the modules within 3 hours and if it worked for all the inputs they give, those candidates were given extra modules to work with.

Only 9 candidates made it to the next round

ROUND 4 : FIRST FACE-TO-FACE(TECHNICAL)
Questions were on project, c, oops concepts, DBMS and a few puzzles. They might ask you more on new scenarios relating to your project.

ROUND 5: SECOND FACE-TO-FACE(TECHNICAL)
Question were on c, c++, java(like threads, synchronization etc.), Discussion about questions from first, second and third round. He even asked me to solve a few questions from the first round. He gave me a few puzzles to solve

ROUND 6: FIRST GENERAL HR
General questions about my pros and cons and discussion on my resume(be thorough with your resume). She finally asked me if I had any queries.

ROUND 7: SECOND GENERAL HR
She asked me some family details and gave some scenarios and asked me to what I will do in such situations(like if I am given the power to change 3 things in india, what all will I change) and a few general questions.

I didn’t get direct placement in ZOHO but I got an internship offer. If I perform well in my internship, I will get an offer. Round 3 was the toughest and if you perform exceptionally well and as they expect in that round, you will definitely make it through. Many thanks to geeksforgeeks.org for helping me out in my preparation.


================================================
FILE: Set 08 Qns
================================================

Zoho Interview | Set 8 (Off-Campus Drive for Project Trainee)

First Round:
Written, pen paper based. The candidate has to write the output for C programs and basic aptitude questions. Total 30 questions. Test duration was of 3 hours.

Description:
There were altogether 20 questions from C programs and 10 questions from logical aptitude. Questions from C programming basically focus on pointers (single pointer and pointer-to-pointer) manipulation, 75% of questions from pointers and rest from arrays and strings manipulation. The questions from logical aptitude was of moderate level difficulty ranging from probability to speed distance time calculations. Both section same marks weightage. I solved 13 from C and 7 from apti.

Second Round:
They shortlisted approx 40 students for the second round. The mail came after 15 days from first round. It was coding round, programming questions on their laptops in groups of 10 students in each room. Test duration was of 3 hours. The test was on 1 Feb 2016.
Description:
There were 5 questions. The instructor will check the code after solving each question, they may ask for reducing time/ space complexity, be ready for it.

1. Spiral printing.
O/P
4444444
4333334
4322234
4321234
4322234
4333334
4444444

2. Sort the array alternately i.e first element should be max value, second min value, third second max, third second min. Eg: arr[] = {1,2,3,4,5,6,7} O/P: {7,1,6,2,5,3,4} Note: no extra space and time complexity should be less;

3. Print all the substring of the given string.

4. Print the numbers which are mismatched from two array. Arr1 = {a b c d e f g h i}
arr2 ={ a b d e e g g i i}, O/P- cd, de, f, g, h, i.

5. Print all possible combinations from the given string.

The candidate who solved at least four out five are selected for next advance coding round.

Third Round:
Third round was followed immediately after completion of second round. 50% candidates were selected for this round which consists of advance programming question. One full fledge project consist of 7 modules which has to be done on their laptops. Test duration was of 3 hours. Test was on 1 Feb 2016.

Description:
There was one question for each candidate.

1. Develop a railway project which consist of 7 requirements modules. The modules includes booking of railway tickets, cancellation, route option, fare calculations, allotting/dealloting berth, coach position.
Some other questions given to students were online billing and shopping. The instructor may ask to change the requirements run time, you should be ready for it.

Fourth Round:
Fourth round was followed immediately after completion of third round. It was face to face interview round in which technical and HR questions were asked. Interview duration was of 20 mins for each student. It was on same day.
Description:
This round consist of face to face interview, they asked questions from Java collection framework and core java. Questions related to course project was also asked. Finally, all the round were finished at 8 pm.







================================================
FILE: Set 08 Qns2
================================================

Zoho Interview | Set 8 (On-Campus)

ROUND 1: Aptitude questions – both Quantitative aptitude and in programming. they were NOT MCQs

ROUND 2:
1. Arrange the numbers in descending order depending on the no. of factors available for each number.
I/P: {6,8,9}
O/P: {8,6,9} or {6,8,9}
Reason: factors of 8 (1,2,4,8), factors of 6 (1,2,3,6), factors of 9 (1,3,9).

2. Two strings of equal length are given print the mismatched ones.
I/P: a b c d e f g h i
      a b d e e g g i i
O/P: cd , de //when two char are mismatched they should be printed together.
      f , g
      h , i

3. Get a number and check whether its palindrome do not use arrays and string manipulations
I/P: 5
O/P: 101-Palindrome
Reason: binary representation of 5 is 101 & it is a palindrome.
I/P: 10
O/P: Binary representation of 10 is 1010 –Not a palindrome

4. For any given matrix find the path from the start to the end which gives the maximum sum. Traverse only right or down.
Example: starting index is 15 (left top) and ending index is 10 (bottom right)
15 25 30
45 25 60
70 75 10
O/P:15->45->70->75->10 sum is 215

5. [ [‘Lava’ , ‘kusha] ,
[‘Rama’ , ‘Lava’] ,
[‘Lava ‘,’Ravanan’] ,
[‘Abi’ , ‘Lava’] ]
First string is the child & the second string is the parent. Print the no. of grand children available for the
given I/P.
I/P: Ravanan
O/P: 2


================================================
FILE: Set 08-01.Spiral printing.c
================================================
#include<stdio.h>
int main(void)
{
	int i,j,n;
	printf("Limit   : ");
	scanf("%d",&n);
	for(i=n;i>=1;i--)
	{
		for(j=n;j>=i;j--)
			printf("%d ",j);
		for(j=1;j<(2*i)-1;j++)
			printf("%d ",i);
		for(j=i+1;j<=n;j++)
			printf("%d ",j);
		printf("\n");
	}
        for(i=2;i<=n;i++)
	{
		for(j=n;j>=i;j--)
			printf("%d ",j);
		for(j=1;j<(2*i)-1;j++)
			printf("%d ",i);
		for(j=i+1;j<=n;j++)
			printf("%d ",j);
		printf("\n");
	}
}



================================================
FILE: Set 08-02.Two strings of equal length are given print the mismatched ones..c
================================================
#include<stdio.h>
int main(void)
{
	char a[50],b[50];
	int i,j,n,st=0;
	printf("Array  size : ");
	scanf("%d",&n);
	printf("Elements to array :");
	for(i=0;i<n;i++)
		scanf(" %c",&a[i]);
	printf("Elements to array :");
	for(i=0;i<n;i++)
		scanf(" %c",&b[i]);
        printf("----Output----\n");
	for(i=0;i<n;i++)
	{
		if(a[i]!=b[i])
		{
			for(j=i;a[j]!=b[j] && j<n;j++)
				printf("%c",a[j]);
			printf(" , ");
			for(;i<j;i++)
				printf("%c",b[i]);
			printf("\n");
		}
	}     
	return 0;
}



================================================
FILE: Set 08-03.Get a number and check whether its palindrome do not use arrays and string manipulations.c
================================================
#include<stdio.h>
int main(void)
{
	int n,i,j=0,temp;
	printf("Enter a Number : ");
	scanf("%d",&n);

	for(i=sizeof(int)*8-1;!(n>>i&1);i--);
	for(;j<i;i--,j++)
		if((n>>i&1)!=(n>>j&1))
			break;
        temp=i;
	for(i+=j;i>=0;printf("%d",n>>i&1),i--);
	if(temp<=j)
		printf(" - Palindrome\n");
	else
		printf(" - Not Palindrome\n");
	return 0;
}


================================================
FILE: Set 12-01.Given two numbers a and b both < 200 we have to find the square numbers which lie between a and b.c
================================================
#include<stdio.h>
int main(void)
{
int a,b,i;
printf("Lower NUmber : ");
scanf("%d",&a);
printf("Upper NUmber : ");
scanf("%d",&b);
printf("Perfect Square number between %d and %d is : ",a,b);
for(i=0;i*i<=a;i++);
for(;i*i<b;i++)
printf("%d ",i*i);
printf("\n");
return 0;
}



================================================
FILE: Set 12-03.Given an array and a threshold value find the output.c
================================================
#include<stdio.h>
int main(void)
{
int a[100],i,th,n,count=0,sum,temp;
printf("Array size : ");
scanf("%d",&n);
printf("Elements to Array : ");
for(i=0;i<n;i++)
scanf("%d",&a[i]);
printf("Array   elements  : ");
for(i=0;i<n;i++)
printf("%d ",a[i]);
printf("\nThreshold value   : ");
scanf("%d",&th);

for(i=0;i<n;i++)
{
  temp=th;
  sum=0;
  while(sum!=a[i])
  {
    sum+=temp;
    count++;
    if(sum>a[i])
    {
     sum-=temp;
     temp--;
     count--;
    }
  }
}  
printf("count = %d\n",count);
return 0;
}  


================================================
FILE: Set 12-05.Write a program to print the below pattern.c
================================================
#include<stdio.h>
int main(void)
{
	int n,i,j,k;
	printf("Limit : ");
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		k=i+1;
		for(j=0;j<n-i;k+=n-j,j++)
			printf("%2d ",k);
		printf("\n");
	}
	return 0;
}


================================================
FILE: Set 12-06.Given bigger NxN matrix and a smaller MxM matrix print TRUE if the smaller matrix can be found in the bigger matrix else print FALSE.c
================================================

#include<stdio.h>
int main(void)
{
int a[50][50],b[50][50],r1,c1,r2,c2,i,j,k,l;
printf("Array 1 size : ");
scanf("%d%d",&r1,&c1);
printf("Elements to Array : ");
for(i=0;i<r1;i++)
for(j=0;j<c1;j++)
scanf("%d",&a[i][j]);

printf("Array   elements  : \n");
for(i=0;i<r1;i++)
{
for(j=0;j<c1;j++)
printf("%d ",a[i][j]);
printf("\n");
}
printf("Array 2 size : ");
scanf("%d%d",&r2,&c2);

printf("Elements to Array : ");
for(i=0;i<r2;i++)
for(j=0;j<c2;j++)
scanf("%d",&b[i][j]);

printf("Array   elements  : \n");
for(i=0;i<r2;i++)
{
for(j=0;j<c2;j++)
printf("%d ",b[i][j]);
printf("\n");
}

for(i=0;i<r1;i++)
for(j=0;j<c1;j++)
{
 if(a[i][j]==b[0][0])
 { 
   for(k=0;k<r2;k++)
    for(l=0;l<c2;l++)
      if(a[i+k][j+l]!=b[k][l])
        goto EXIT;
    EXIT:
    if(k==r2 && l==c2)
    {  
       printf("\nTRUE : <%d,%d> to <%d,%d>\n",i,j,i+k-1,j+l-1);
       return;
    }
 }
}
 printf("\n False\n");
 return 0;
}
 



================================================
FILE: Set 12-07.Given two matrices a and b both of size NxN find if matrix a can be transformed to matrix b by rotating it 90deg , 180deg , 270deg if so print TRUE else print FALSE.c
================================================
#include<stdio.h>
int main(void)
{
int a[20][20],b[20][20],i,j,r1,c1,r2,c2;
printf("Row  and  coloumn : ");
scanf("%d %d",&r1,&c1);
printf("Elements to array : ");
for(i=0;i<r1;i++)
for(j=0;j<c1;j++)
scanf("%d",&a[i][j]);

printf("Row  and  coloumn : ");
scanf("%d %d",&r2,&c2);

printf("Elements to array : ");
for(i=0;i<r2;i++)
for(j=0;j<c2;j++)
scanf("%d",&b[i][j]);


printf("Array A   Elements  : \n");
for(i=0;i<r1;i++)
{
for(j=0;j<c1;j++)
printf("%d ",a[i][j]);
printf("\n");
}

printf("Array B  Elements  : \n");
for(i=0;i<r2;i++)
{
for(j=0;j<c2;j++)
printf("%d ",b[i][j]);
printf("\n");
}

if(r2==c1 && c2==r1)
{
for(i=c1-1;i>=0;i--)
for(j=0;j<r1;j++)
if(a[j][i]!=b[c1-1-i][j])
    goto NEXT1;
printf("\nTRUE  (90 Deg)\n");
return;
}

if(r2==r1&&c2==c1)
{
for(i=r1-1;i>=0;i--)
for(j=c1-1;j>=0;j--)
if(a[i][j]!=b[r1-1-i][c1-1-j])
  goto NEXT2;
printf("\nTRUE  (180 Deg)\n");
return;
}

NEXT1:
if(r2==c1 &&c2==r1)
{
for(i=0;i<c1;i++)
for(j=r1-1;j>=0;j--)
if(a[j][i]!=b[i][r1-1-j])
   goto NEXT2;
printf("\nTRUE (270 Deg)\n");
return;
}
NEXT2:
printf("\nFALSE\n");
return 0;
}


================================================
FILE: Set 12-08.In addition to the above question you have to check if matrix a can be transformed by mirroring vertically or horizontally to matrix b..c
================================================

#include<stdio.h>
int main(void)
{
int a[20][20],b[20][20],i,j,r1,c1,r2,c2;
printf("Row  and  coloumn : ");
scanf("%d %d",&r1,&c1);
printf("Elements to array : ");
for(i=0;i<r1;i++)
for(j=0;j<c1;j++)
scanf("%d",&a[i][j]);

printf("Row  and  coloumn : ");
scanf("%d %d",&r2,&c2);

printf("Elements to array : ");
for(i=0;i<r2;i++)
for(j=0;j<c2;j++)
scanf("%d",&b[i][j]);


printf("Array A   Elements  : \n");
for(i=0;i<r1;i++)
{
for(j=0;j<c1;j++)
printf("%d ",a[i][j]);
printf("\n");
}

printf("Array B  Elements  : \n");
for(i=0;i<r2;i++)
{
for(j=0;j<c2;j++)
printf("%d ",b[i][j]);
printf("\n");
}

if(r2==c1 && c2==r1)
{
for(i=c1-1;i>=0;i--)
for(j=0;j<r1;j++)
if(a[j][i]!=b[c1-1-i][j])
    goto NEXT1;
printf("\nTRUE  (90 Deg)\n");
return;
}

if(r2==r1&&c2==c1)
{
for(i=r1-1;i>=0;i--)
for(j=c1-1;j>=0;j--)
if(a[i][j]!=b[r1-1-i][c1-1-j])
  goto NEXT2;
printf("\nTRUE  (180 Deg)\n");
return;
}

NEXT1:
if(r2==c1 &&c2==r1)
{
for(i=0;i<c1;i++)
for(j=r1-1;j>=0;j--)
if(a[j][i]!=b[i][r1-1-j])
   goto NEXT4;
printf("\nTRUE (270 Deg)\n");
return;
}
NEXT2:

if(r2==r1&&c2==c1)
{
for(i=0;i<r1;i++)
for(j=c1-1;j>=0;j--)
if(a[i][j]!=b[i][c1-1-j])
  goto NEXT3;
printf("\nTRUE  (Horizontal Mirror)\n");
return;
}
NEXT3:

if(r2==r1&&c2==c1)
{
for(i=r1-1;i>=0;i--)
for(j=0;j<c1;j++)
if(a[i][j]!=b[r1-1-i][j])
  goto NEXT4;
printf("\nTRUE  (Vertical Mirror)\n");
return;
}

NEXT4:
printf("\nFALSE\n");
return 0;
}


================================================
FILE: Set 12-Qns
================================================
Zoho Interview Experience | Set 12 (On-Campus)
Recently ZOHO visited our campus for recruitment and i would like to share my experience.
Thanks to geeksforgeeks which contributed to most of my preparations..

Round 1 : TIME : 2hrs
I was expecting an aptitude written round .But they gave us 30 flowchart and asked us to go through each flowchart and the questions were based on the flowchart..Questions included finding the o/p of the flowchart , find the missing statement which when added produces the given o/p..If you concentrate and go through the flowchart it should be easy to crack the first round..

Round 2: TIME : 3hrs
They shortlisted 150 candidates from the first round..This was a programming round and consisted of straightforward questions..

1.Given two numbers a and b both < 200 we have to find the square numbers which lie between a and b(inclusive)

eg) i/p a = 20;b = 100;
      o/p 25,36,49,64,81,100 
2.Alternately sort an unsorted array..

eg) i/p {5,2,8,7,4,3,9}
      o/p {9,2,8,3,7,4,5}
3. Given an array and a threshold value find the o/p

eg) i/p {5,8,10,13,6,2};threshold = 3;
      o/p  count = 17
      explanation:
Number	parts	            counts
5	            {3,2}                 2
8                      {3,3,2}              3
10                    {3,3,3,1}           4
13                    {3,3,3,3,1}        5
6                      {3,3}                 2
2                      {2}                    1 
4.a. Given two binary numbers add the two numbers in binary form without converting them to decimal value.

eg) a = 1010 b = 11001
      o/p  100011	            
  b.The two numbers were given in base n 
	eg) a = 123  b = 13  n = 4
	      o/p  202
5.Write a program to print the below pattern

for n = 6
1	7	12	16	19	21
2	8	13	17	20
3	9	14	18	
4	10	15
5	11	
6 
6.Given bigger NxN matrix and a smaller MxM matrix print TRUE if the smaller matrix can be found in the bigger matrix else print FALSE

7.Given two matrices a and b both of size NxN find if matrix a can be transformed to matrix b by rotating it 90deg , 180deg , 270deg if so print TRUE else print FALSE

8 In addition to the above question you have to check if matrix a can be transformed by mirroring vertically or horizontally to matrix b.

I solved 7 questions .. Those who solved more than 5 were selected for the next round.


Round 3 : TIME : 3hrs
About 50 – 60 were shortlisted .. This round was also a programming round..
Questions were based of matrix transformation.Each question was an extension of the previous question in some way..There were 5 questions .. I solved only 2 🙁 But got selected for the next round , I think it was based on my performance on all previous rounds..


Round 4:
We had both HR and technical HR.
In technical HR if they found out that a candidate was not sure on some topic the candidate was asked questions on that topic for the rest of the round even after the candidate said he does not know that concept . In my case it was DBMS 🙁 The round also consisted of 3 puzzles ..they were easy to solve , i solved all of them..

In HR round we had a friendly chat ..They didn’t want candidates who were willing to quit the job after a few years and go for higher studies( obviously )..I was asked about my family and my hobbies..

After round 4 we had to wait for almost 5 hrs before the results were announced..There were 2 packages x and x+y.. I was offered the x package mostly because i didn’t do round 3 well but they said that if we prove ourselves during the internship they would change the package to x+y so looking forward to that 😉

Overall it was a good experience and i really appreciate ZOHO team for the amount of effort they invested in the interview process each round was both challenging and enjoyable in its own way
Download .txt
gitextract_5u_4w79b/

├── .gitignore
├── LICENSE
├── README.md
├── Set 01 Qns.txt
├── Set 01-01.print the following pattern.c
├── Set 01-02.find sum of weights based on the following conditions.c
├── Set 01-03.Save the string in a two dimensional array and search for substring.c
├── Set 01-05.find no of grandchildren.c
├── Set 02-01.Alternate sorting.c
├── Set 02-01.Alternate sorting.py
├── Set 02-02.Remove unbalanced parentheses in a given expression.c
├── Set 02-02.Remove unbalanced parentheses in a given expression.py
├── Set 02-03.Form a number system with only 3 and 4.c
├── Set 02-qns
├── Set 03-01.program to give the following output.c
├── Set 03-02.sort the elements in odd positions in descending order and elements in ascending order.c
├── Set 03-03.program to print the following output for the given input.c
├── Set 03-05-01.two sorted arrays, merge them such that the elements are not repeated.c
├── Set 03-05-02.two sorted arrays, merge them such that the elements are not repeated.c
├── Set 03-Qns
├── Set 08 Qns
├── Set 08 Qns2
├── Set 08-01.Spiral printing.c
├── Set 08-02.Two strings of equal length are given print the mismatched ones..c
├── Set 08-03.Get a number and check whether its palindrome do not use arrays and string manipulations.c
├── Set 12-01.Given two numbers a and b both < 200 we have to find the square numbers which lie between a and b.c
├── Set 12-03.Given an array and a threshold value find the output.c
├── Set 12-05.Write a program to print the below pattern.c
├── Set 12-06.Given bigger NxN matrix and a smaller MxM matrix print TRUE if the smaller matrix can be found in the bigger matrix else print FALSE.c
├── Set 12-07.Given two matrices a and b both of size NxN find if matrix a can be transformed to matrix b by rotating it 90deg , 180deg , 270deg if so print TRUE else print FALSE.c
├── Set 12-08.In addition to the above question you have to check if matrix a can be transformed by mirroring vertically or horizontally to matrix b..c
└── Set 12-Qns
Download .txt
SYMBOL INDEX (26 symbols across 23 files)

FILE: Set 01-01.print the following pattern.c
  function main (line 11) | int main(void)

FILE: Set 01-02.find sum of weights based on the following conditions.c
  function main (line 14) | int main(void)
  function check (line 37) | int check(int n)

FILE: Set 01-03.Save the string in a two dimensional array and search for substring.c
  function main (line 16) | int main(void)
  function sqt (line 70) | int sqt(float n)

FILE: Set 01-05.find no of grandchildren.c
  function main (line 13) | int main(void)

FILE: Set 02-01.Alternate sorting.c
  function main (line 6) | int main(void)

FILE: Set 02-01.Alternate sorting.py
  function main (line 6) | def main():

FILE: Set 02-02.Remove unbalanced parentheses in a given expression.c
  function main (line 20) | int main(void)

FILE: Set 02-02.Remove unbalanced parentheses in a given expression.py
  function remove (line 4) | def remove(s,index):
  function main (line 8) | def main():

FILE: Set 02-03.Form a number system with only 3 and 4.c
  function main (line 5) | int main(void)

FILE: Set 03-01.program to give the following output.c
  function main (line 10) | int main(void)

FILE: Set 03-02.sort the elements in odd positions in descending order and elements in ascending order.c
  function main (line 10) | int main(void)

FILE: Set 03-03.program to print the following output for the given input.c
  function main (line 27) | int main(void)

FILE: Set 03-05-01.two sorted arrays, merge them such that the elements are not repeated.c
  function main (line 11) | int main(void)

FILE: Set 03-05-02.two sorted arrays, merge them such that the elements are not repeated.c
  function main (line 10) | int main(void)

FILE: Set 08-01.Spiral printing.c
  function main (line 2) | int main(void)

FILE: Set 08-02.Two strings of equal length are given print the mismatched ones..c
  function main (line 2) | int main(void)

FILE: Set 08-03.Get a number and check whether its palindrome do not use arrays and string manipulations.c
  function main (line 2) | int main(void)

FILE: Set 12-01.Given two numbers a and b both < 200 we have to find the square numbers which lie between a and b.c
  function main (line 2) | int main(void)

FILE: Set 12-03.Given an array and a threshold value find the output.c
  function main (line 2) | int main(void)

FILE: Set 12-05.Write a program to print the below pattern.c
  function main (line 2) | int main(void)

FILE: Set 12-06.Given bigger NxN matrix and a smaller MxM matrix print TRUE if the smaller matrix can be found in the bigger matrix else print FALSE.c
  function main (line 3) | int main(void)

FILE: Set 12-07.Given two matrices a and b both of size NxN find if matrix a can be transformed to matrix b by rotating it 90deg , 180deg , 270deg if so print TRUE else print FALSE.c
  function main (line 2) | int main(void)

FILE: Set 12-08.In addition to the above question you have to check if matrix a can be transformed by mirroring vertically or horizontally to matrix b..c
  function main (line 3) | int main(void)
Condensed preview — 32 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (85K chars).
[
  {
    "path": ".gitignore",
    "chars": 430,
    "preview": "# Prerequisites\n*.d\n\n# Object files\n*.o\n*.ko\n*.obj\n*.elf\n\n# Linker output\n*.ilk\n*.map\n*.exp\n\n# Precompiled Headers\n*.gch"
  },
  {
    "path": "LICENSE",
    "chars": 35141,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "README.md",
    "chars": 61,
    "preview": "# Zoho-Interview-questions\nprevious zoho interview questions\n"
  },
  {
    "path": "Set 01 Qns.txt",
    "chars": 1687,
    "preview": "SET 1\n\nSecond Round: (Normal Programming round)\n1. Print the word with odd letters as\n\nP         M\n R      A\n   O  R\n   "
  },
  {
    "path": "Set 01-01.print the following pattern.c",
    "chars": 877,
    "preview": "  /*  To print the following pattern\n        \tP     M\n                 R   A\n                  O R\n                   G\n"
  },
  {
    "path": "Set 01-02.find sum of weights based on the following conditions.c",
    "chars": 1195,
    "preview": "/* Given a set of numbers like <10,36,54,89,12> we want to find sum of weights based on the following conditions\n    1. "
  },
  {
    "path": "Set 01-03.Save the string in a two dimensional array and search for substring.c",
    "chars": 1880,
    "preview": "/* Save the string “WELCOMETOZOHOCORPORATION” in a two dimensional array and search for substring like “too” in the two "
  },
  {
    "path": "Set 01-05.find no of grandchildren.c",
    "chars": 1768,
    "preview": "/*  Given a two dimensional array of string like\n\n  <”luke”, “shaw”>\n  <”wayne”, “rooney”>\n  <”rooney”, “ronaldo”>\n  <”s"
  },
  {
    "path": "Set 02-01.Alternate sorting.c",
    "chars": 1148,
    "preview": "/*  Alternate sorting: Given an array of integers, rearrange the array in such a way that the first element is first max"
  },
  {
    "path": "Set 02-01.Alternate sorting.py",
    "chars": 786,
    "preview": "#!/usr/bin/python\n''' Alternate sorting: Given an array of integers, rearrange the array in such a way that the first el"
  },
  {
    "path": "Set 02-02.Remove unbalanced parentheses in a given expression.c",
    "chars": 1059,
    "preview": "/* Remove unbalanced parentheses in a given expression.\n\n    Eg.) Input  : ((abc)((de))\n         Output : ((abc)(de)) \n "
  },
  {
    "path": "Set 02-02.Remove unbalanced parentheses in a given expression.py",
    "chars": 886,
    "preview": "#!/usr/bin/python\n\n#Remove unbalanced parentheses in a given expression\ndef remove(s,index):\n    s=s[:index]+s[index+1:]"
  },
  {
    "path": "Set 02-03.Form a number system with only 3 and 4.c",
    "chars": 1165,
    "preview": "/* C) Form a number system with only 3 and 4. Find the nth number of the number system.\nEg.) The numbers are: 3, 4, 33, "
  },
  {
    "path": "Set 02-qns",
    "chars": 3951,
    "preview": "Set 2\n\n1) First Round : Written\n\n40 C output questions. 2 Hours.\n30 1Mark and 10 2Mark questions. IT WAS NOT MCQ. The qu"
  },
  {
    "path": "Set 03-01.program to give the following output.c",
    "chars": 1004,
    "preview": "/* 1. Write a program to give the following output for the given input\n\nEg 1: Input: a1b10\n       Output: abbbbbbbbbb\nEg"
  },
  {
    "path": "Set 03-02.sort the elements in odd positions in descending order and elements in ascending order.c",
    "chars": 761,
    "preview": "/* 2. Write a program to sort the elements in odd positions in descending order and elements in ascending order\n\nEg 1: I"
  },
  {
    "path": "Set 03-03.program to print the following output for the given input.c",
    "chars": 1057,
    "preview": "/*3. Write a program to print the following output for the given input. You can assume the string is of odd length\n\nEg 1"
  },
  {
    "path": "Set 03-05-01.two sorted arrays, merge them such that the elements are not repeated.c",
    "chars": 2611,
    "preview": "/* 5. Given two sorted arrays, merge them such that the elements are not repeated\n\nEg 1: Input:\n        Array 1: 2,4,5,6"
  },
  {
    "path": "Set 03-05-02.two sorted arrays, merge them such that the elements are not repeated.c",
    "chars": 1678,
    "preview": "/*5. Given two sorted arrays, merge them such that the elements are not repeated\n\nEg 1: Input:\n        Array 1: 2,4,5,6,"
  },
  {
    "path": "Set 03-Qns",
    "chars": 5709,
    "preview": "Set 3\n\nROUND 1: WRITTEN\nAPTITUDE(1 hr and 20 minutes-20 questions): Problems on average, probability, time & distance, a"
  },
  {
    "path": "Set 08 Qns",
    "chars": 3042,
    "preview": "\nZoho Interview | Set 8 (Off-Campus Drive for Project Trainee)\n\nFirst Round:\nWritten, pen paper based. The candidate has"
  },
  {
    "path": "Set 08 Qns2",
    "chars": 1320,
    "preview": "\nZoho Interview | Set 8 (On-Campus)\n\nROUND 1: Aptitude questions – both Quantitative aptitude and in programming. they w"
  },
  {
    "path": "Set 08-01.Spiral printing.c",
    "chars": 433,
    "preview": "#include<stdio.h>\nint main(void)\n{\n\tint i,j,n;\n\tprintf(\"Limit   : \");\n\tscanf(\"%d\",&n);\n\tfor(i=n;i>=1;i--)\n\t{\n\t\tfor(j=n;j"
  },
  {
    "path": "Set 08-02.Two strings of equal length are given print the mismatched ones..c",
    "chars": 495,
    "preview": "#include<stdio.h>\nint main(void)\n{\n\tchar a[50],b[50];\n\tint i,j,n,st=0;\n\tprintf(\"Array  size : \");\n\tscanf(\"%d\",&n);\n\tprin"
  },
  {
    "path": "Set 08-03.Get a number and check whether its palindrome do not use arrays and string manipulations.c",
    "chars": 346,
    "preview": "#include<stdio.h>\nint main(void)\n{\n\tint n,i,j=0,temp;\n\tprintf(\"Enter a Number : \");\n\tscanf(\"%d\",&n);\n\n\tfor(i=sizeof(int)"
  },
  {
    "path": "Set 12-01.Given two numbers a and b both < 200 we have to find the square numbers which lie between a and b.c",
    "chars": 276,
    "preview": "#include<stdio.h>\nint main(void)\n{\nint a,b,i;\nprintf(\"Lower NUmber : \");\nscanf(\"%d\",&a);\nprintf(\"Upper NUmber : \");\nscan"
  },
  {
    "path": "Set 12-03.Given an array and a threshold value find the output.c",
    "chars": 515,
    "preview": "#include<stdio.h>\nint main(void)\n{\nint a[100],i,th,n,count=0,sum,temp;\nprintf(\"Array size : \");\nscanf(\"%d\",&n);\nprintf(\""
  },
  {
    "path": "Set 12-05.Write a program to print the below pattern.c",
    "chars": 198,
    "preview": "#include<stdio.h>\nint main(void)\n{\n\tint n,i,j,k;\n\tprintf(\"Limit : \");\n\tscanf(\"%d\",&n);\n\tfor(i=0;i<n;i++)\n\t{\n\t\tk=i+1;\n\t\tf"
  },
  {
    "path": "Set 12-06.Given bigger NxN matrix and a smaller MxM matrix print TRUE if the smaller matrix can be found in the bigger matrix else print FALSE.c",
    "chars": 914,
    "preview": "\n#include<stdio.h>\nint main(void)\n{\nint a[50][50],b[50][50],r1,c1,r2,c2,i,j,k,l;\nprintf(\"Array 1 size : \");\nscanf(\"%d%d\""
  },
  {
    "path": "Set 12-07.Given two matrices a and b both of size NxN find if matrix a can be transformed to matrix b by rotating it 90deg , 180deg , 270deg if so print TRUE else print FALSE.c",
    "chars": 1083,
    "preview": "#include<stdio.h>\nint main(void)\n{\nint a[20][20],b[20][20],i,j,r1,c1,r2,c2;\nprintf(\"Row  and  coloumn : \");\nscanf(\"%d %d"
  },
  {
    "path": "Set 12-08.In addition to the above question you have to check if matrix a can be transformed by mirroring vertically or horizontally to matrix b..c",
    "chars": 1401,
    "preview": "\n#include<stdio.h>\nint main(void)\n{\nint a[20][20],b[20][20],i,j,r1,c1,r2,c2;\nprintf(\"Row  and  coloumn : \");\nscanf(\"%d %"
  },
  {
    "path": "Set 12-Qns",
    "chars": 3780,
    "preview": "Zoho Interview Experience | Set 12 (On-Campus)\nRecently ZOHO visited our campus for recruitment and i would like to shar"
  }
]

About this extraction

This page contains the full source code of the amalpoulose/Zoho-Interview-questions GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 32 files (76.8 KB), approximately 22.3k tokens, and a symbol index with 26 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!