text:
Given a table, place in the chairs
Challenge
You will be given a table as input, drawn with ASCII | and _. Your task is to set the chairs around it.
Example
Input:
 ____
|    |
|    |
|    |
|    |
|____|

Output:
 _^_^_
<     >
|     |
<     >
|     |
<_ _ _>
  v v

Those chairs are made of <> and v^.
Another example:
The line must have as many chairs as possible in it.
  _____
 |     |_____
 |           |
 |           |
 |           |
 |      _____|
 |_____|

  _^_^_
 <     |_^_^_
 |           >
 <           |
 |           |
 <      _ _ _>
 |_ _ _| v v
   v v

There must be spaces between every chair. And >_^_^_< is invalid, it should be |_^_^_|.
  _____       _____
 |     |_____|     |
 |                 |
 |                 |
 |                 |
 |      ___________|
 |_____|

  _^_^_       _^_^_
 <     |_^_^_|     >
 |                 |
 <                 >
 |                 |
 <      _ _ _ _ _ _>
 |_ _ _| v v v v v
   v v

No chairs may be on the inside of a "donut".
  _________________
 |      _____      |
 |     |     |     |
 |     |     |     |
 |     |_____|     |
 |_________________|

  _^_^_^_^_^_^_^_^_
 <      _____      >
 |     |     |     |
 <     |     |     >
 |     |_____|     |
 <_ _ _ _ _ _ _ _ _>
   v v v v v v v v

^ and v prioritise < and >. No chair on it's own (it has to have at least one | or _ in the row).
  _________________
 |      _____      |
 |     |     |     |
 |     |     |_____|
 |     |_____
 |___________|

  _^_^_^_^_^_^_^_^_
 <      _ _ _      >
 |     | v v |     |
 <     >     <_ _ _>
 |     |_^_^_  v v
 <_ _ _ _ _ _|
   v v v v v

This is code golf, so shortest code wins.

I am confused, why are the chairs embedded into the table from sides ?

If I recall correctly, your original sandbox post had a space between the vertical table line and the chair line. Just like there is a little space between the horizontal table lines and the chairs.

@Optimizer only the base ones have a space - the top ones _^_ are one line. When I changed from [] I changed it to being in the edge.

Why is there no > on the last line of last example ?

@Optimizer edited

it looks like that chairs are placed with 1 distance with each other , but any input's surrounding is not dividable by 2 . how the program should start puting chairs . clockwise or anti-clock wise ? from top right corner , top left corner etc ?

also i think there is a problem in third sample - there is an extra space between second and third "top" chairs - and also in last example , bottom-right corner

The chairs make it look spiky.

The first test case seems to be broken.  The input is only 4 wide and the output is 5.

Am I safe in assuming, from the examples, that a chair cannot be placed on either side of a concave corner? The examples have some on the side of a convex corner.

@gnovice correct

Python 2, 1033 1007 924 879 829 787 713 699 692 691 688 687 672 670 664 659 654 648 643 642 630 625 623 620 570 560 554 545 518 514 513 510 505 492 476 454 451 443 bytes
6 bytes saved thanks to Riley
6 bytes saved thanks to Adnan
Since this question is over a year old and still has no answers I thought I'd give it a try.
n,i,o,u="\nI _";R=lambda x:range(1,x-1)
b=open(i).read()
s=b.split(n)
z=max(map(len,s))+3
a=[list(i+x.ljust(z,i))for x in[i]+s+[i]]
for x in R(len(a))*len(b):
 A=a[x];B=a[x+1];C=a[x-1]
 for y in R(z):
    D=A[y-1:y+2];k=B[y];j=A[y+1]
    if(i in[C[y],k]+D+(k==u)*B[y-1:y+2]or"V"==j)&(A[y]==o):A[y]=i
    if"|"==A[y]==C[y]:A[y]={i:"|",j:">",A[y-1]:"<"}[i]
    if[u]*3==D:A[y],B[y]={i:u+k,C[y]:"^"+k,k:" V"}[i]
print n.join(`y`[2::5]for y in a).replace(i,o)

Try it online!
The program reads the table a file named I and prints the table with its chairs to std::out.  I was not sure about a bunch of the edge cases so I took my best judgement (whatever took the least effort) but it seems to pass all the test cases.  Some of the outputs don't match exactly but they all have the same number of chairs.
Explanation
The first line pretty simply sets up some definitions that will save us bytes in the future:
(I will unpack these macros for readability in future lines)
n,i,o="\nI ";R=lambda x:range(1,x-1)

Then we will open a file named I because we already have a variable that is short for that so it saves a few bytes.
b=open("I").read().split("\n")

We split along newlines to create a list of strings (The rows of the image)
s=b.split(n)

I then find the length of the longest line so that I can pad all lines to that length.  (I also add 3 because we need a bit of additional padding)
 z=max(map(len,s))+3

Then we perform the actual padding and create a border of I characters around the edge.  This is because we will need to tell the difference between the inside and the outside of the shape later on.  We will also change the data type from a list of strings to a list of list of characters (length 1 strings).
a=[list("I"+x.ljust(z,"I"))for x in["I"]+s+["I"]]

The next line is just another byte saving definition.
(I will also unpack this one)
B=R(len(a))

Now we want to spread I characters to everywhere outside of the shape.  We can do this with a pseudo-cellular automaton.  Each I will spread to any adjacent   characters.  We could loop until the automaton stabilizes however this cannot take more iterations than there are characters so we just loop through every character in b (the original input)
for _ in b:

For each iteration we want to pass over every character in the 2D list (excluding the outermost padding)
 for x in range(1,len(a)-1):
    A=a[x]  #<--Another definition I will fill in for clarity
    for y in range(1,z-1):

For each position we run the following code:
if("I" in[a[x+1][y],a[x-1][y]]+a[x][y-1:y+2])&(a[x][y]==" "):a[x][y]=" "

Lets break this down.
We have an if with two conditions separated by a & (bitwise and)
The first one simply checks if there is an I in any of the adjacent cells and the second one just checks if the current cell is a " ".  If we pass those conditions we set the current cell to be an I.

Now that we have determined the outside and inside of the shape we can start to place the chairs around the table.
Once again we loop through all of the cells (and set some more shorthands)
for x in range(1,len(a)-1):
 A=a[x]
 for y in range(1,z-1):
        k=a[x+1][y]

Now here's my favorite part.  If you have trudged through my boring, mostly definition based, golfing so far I am going to reward you with a nice tidbit of clever golfing (if I do say so myself).
A little background in python:
In Python if you attempt to assign an dictionary key twice it asigns the latter one.  For example
>>> {1:"a",1:"b"}[1]
'b'

We will abuse this property to assign the current cell to a particular character.
The first condition is
if["_"]*3==a[x][y-1:y+2]:a[x][y],a[x+1][y]={"I":"_"+a[x+1][y],a[x-1][y]:"^ ",a[x+1][y]:" V"}["I"]

If the cell is in the middle of an edge of 3 _ characters we will reassign the current cell and the cell below it.  We will assign it to the result of indexing an overloaded dictionary by I.  We first set our default with the pair "I":"_"+a[x+1][y] this means if there is no change we will assign the two cells back to their original values.  Next we add the pair a[x-1][y]:"^ ".  This wont do anything (important) unless the cell above the current one (a[x-1][y]) is filled with an I.  If it has an I in it it will override the default telling us to place a chair at the current cell.  Next we move on to the cell below the current cell if that cell is I we again override to place an upwards facing chair below the current spot.
The next condition is a tad simpler
if"|"==a[x][y]==a[x-1][y]:a[x][y]={"I":"|",A[y+1]:">",A[y-1]:"<"}["I"]

We check if the current cell and the cell above it are both |.  If so we set up a dictionary.
The first pair in the dictionary "I":"|" sets the default.  Since we are going to access the key I if I does not get reassigned it will default back to | (the character it already is) and do nothing.
We the add the two keys A[y+1]:">",A[y-1]:"<" If either of the two cells to the left and right are I then it will reassign the current cell to a chair pointing in the direction of the outside.

Now we just have to output.  However we can't just print,  there are a couple of housekeeping things we have to do first.  We have to convert back to a string and remove all of the Is we created.  This is done in one line.
print "\n".join(`y`[2::5]for y in a).replace("I"," ")

Can't you use a space for the first level of indent, tab for two, a tab and a space for three? That'll save a few bytes.

This may be the most re-golfed answer.

Does i,o="I " instead of i="I";o=" " work?

@Adnan Yes! Thank you I will add that shortly

You do not seem to re-use n.

@ErikGolferエリックゴルファー Making n costs 4 bytes and saves me 6.  Although I don't use it often it does save 2 bytes.

@WheatWizard Oh, I didn't see the split(n) lol I searched for a second n like 5 times or so.

This doesn't seem to add chairs to the inside of the last test case (the "C" shape).

@Pietu1998 Thanks for pointing that out.  I fixed the problem

Let's go over 3 lines folks!


text:
Remove the mininum sum seam from an array
The seam carving algorithm, or a more complex version of it, is used for content-aware image resizing in various graphics programs and libraries. Let's golf it!
Your input will be a rectangular two dimensional array of integers.
Your output will be the same array, one column narrower, with one entry removed from each row, those entries representing a path from top to bottom with the lowest sum of all such paths.

https://en.wikipedia.org/wiki/Seam_carving
In the above illustration, each cell's value is shown in red. The black numbers are the sum of a cell's value and the lowest black number in one of the three cells above it (pointed to by the green arrows). The white highlighted paths are the two lowest sum paths, both with a sum of 5 (1+2+2 and 2+2+1).
In a case where there are two paths tied for the lowest sum, it does not matter which you remove.
Input should be taken from stdin or as a function parameter. It can be formatted in a manner convenient to your language of choice, including brackets and/or delimiters. Please specify in your answer how the input is expected.
Output should be to stdout in an unambiguously delimited format, or as a function return value in your language's equivalent to a 2d array (which might include nested lists, etc).
Examples:
Input:
1 4 3 5 2
3 2 5 2 3
5 2 4 2 1
Output:
4 3 5 2      1 4 3 5
3 5 2 3  or  3 2 5 3
5 4 2 1      5 2 4 2

Input:
1 2 3 4 5
Output:
2 3 4 5

Input:
1
2
3
Output:
(empty, null, a sentinel non-array value, a 0x3 array, or similar)

EDIT: The numbers will all be non-negative, and every possible seam will have a sum that fits in a signed 32 bit integer.

In the examples, all cell values are single digit numbers. Is that guaranteed? If not, are there other assumptions that can be made about the size/range of the values? For example that the sum fits in a 16/32-bit value? Or at least that all the values are positive?

@RetoKoradi edited with details on range

CJam, 51 44 bytes
{_z,1$,m*{_1>.-W<2f/0-!},{1$.=:+}$0=.{WtW-}}

This is an anonymous function that pops a 2D array from the stack and pushes one in return.
Try the test cases online in the CJam interpreter.1
Idea
This approach iterates over all possible combinations of row elements, filters out those that do not correspond to seams, sorts by the corresponding sum, select the minimum and removes the corresponding elements from the array.2
Code
_z,   e# Get the length of the transposed array. Pushes the number of columns (m).
1$,   e# Get the length of the array itself. Pushes the number of rows (n).
m*    e# Cartesian power. Pushes the array of all n-tuples with elements in [0 ... m-1].
{     e# Filter:
  _1> e#     Push a copy of the tuple with first element removed.
  .-  e#     Vectorized difference.
  W<  e#     Discard last element.
  2f/ e#     Divide all by 2.
  0-  e#     Remove 0 from the results.
  !   e#     Push 1 if the remainder is empty and 0 otherwise.
},    e#     Keep only tuples which pushed a 1.

      e# The filtered array now contains only tuples that encode valid paths of indexes.

{     e# Sort by:
  1$  e#     Copy the input array.
  .=  e#     Retrieve the element of each row that corresponds to the index in the tuple.
  :+  e#     Add all elements.
}$    e#
0=    e# Retrieve the tuple of indexes with minimum sum.
.{    e# For each row in the array and the corresponding index in the tuple:
  Wt  e#     Replace the element at that index with -1.
  W-  e#     Remove -1 from the row.
}

1 Note that CJam cannot distinguish between empty arrays and empty strings, since strings are just arrays whose elements are characters. Thus, the string representation of both empty arrays and empty strings is "".
2 While the time complexity of the algorithm shown on the Wikipedia page should be of O(nm) for an n×m matrix, this one's is at least of O(mn).

{2ew::m2f/0-!},

Sadly, that won't work for the second test case. I've filed a bug report about this two weeks ago.

Haskell, 187 bytes
l=length
f a@(b:c)=snd$maximum$(zip=<<map(sum.concat))$map(zipWith((uncurry((.drop 1).(++)).).flip splitAt)a)$iterate((\e@(f:_)->[f-1:e,f:e,min(f+1)(l b-1):e])=<<)[[y]|y<-[0..l b-1]]!!l c

Usage example:
*Main> f [[1,4,3,5,2],[3,2,5,2,3],[5,2,4,2,1]]
[[4,3,5,2],[3,5,2,3],[5,4,2,1]]

*Main> f [[1],[2],[3]]
[[],[],[]]

*Main> f [[1,2,3,4,5]]
[[2,3,4,5]]

How it works, short version: build a list of all paths (1), per path: remove corresponding elements (2) and sum all remaining elements (3). Take the rectangle with the largest sum (4).
Longer version:
Input parameters, assigned via pattern matching:
a = whole input, e.g. [[1,2,4],[2,5,6],[3,1,6]]
b = first line, e.g. [1,2,4]
c = all lines, except first, e.g. [[2,5,6],[3,1,6]]

Step (1), build all paths:

iterate((\e@(f:_)->[f-1:e,f:e,min(f+1)(l b-1):e])=<<)[[y]|y<-[0..l b-1]]!!l c

     [[y]|y<-[0..l b-1]]           # build a list of single element lists
                                   # for all numbers from 0 to length b - 1
                                   # e.g. [[0],[1],[2]] for a 3 column input.
                                   # These are all possible start points

     \e@(f:_)->[f-1:e,f:e,min(f+1)(l b-1):e]
                                   # expand a list of paths by replacing each
                                   # path with 3 new paths (up-left, up, up-right)

     (...)=<<                      # flatten the list of 3-new-path lists into
                                   # a single list

     iterate (...) [...] !! l c    # repeatedly apply the expand function to
                                   # the start list, all in all (length c) times.

Step (2), remove elements

map(zipWith((uncurry((.drop 1).(++)).).flip splitAt)a)

     (uncurry((.drop 1).(++)).).flip splitAt
                                   # point-free version of a function that removes
                                   # an element at index i from a list by
                                   # splitting it at index i, and joining the
                                   # first part with the tail of the second part

      map (zipWith (...) a) $ ...  # per path: zip the input list and the path with
                                   # the remove-at-index function. Now we have a list
                                   # of rectangles, each with a path removed

Step (3), sum remaining elements

zip=<<map(sum.concat)             # per rectangle: build a pair (s, rectangle)
                                  # where s is the sum of all elements

Step (4), take maximum

snd$maximum                      # find maximum and remove the sum part from the
                                 # pair, again.

IDL 8.3, 307 bytes
Meh, I'm sure this won't win because it's long, but here's a straightforward solution:
pro s,a
z=size(a,/d)
if z[0]lt 2then return
e=a
d=a*0
u=max(a)+1
for i=0,z[1]-2 do begin
e[*,i+1]+=min([[u,e[0:-2,i]],[e[*,i]],[e[1:*,i],u]],l,d=2)
d[*,i]=l/z[0]-1
endfor
v=min(e[*,-1],l)
r=intarr(z[1])+l
for i=z[1]-2,0,-1 do r[0:i]+=d[r[i+1],i]
r+=[0:z[1]-1]*z[0]
remove,r,a
print,reform(a,z[0]-1,z[1])
end

Ungolfed:
pro seam, array
  z=size(array, /dimensions)
  if z[0] lt 2 then return
  energy = array
  ind = array * 0
  null = max(array) + 1
  for i=0, z[1]-2 do begin
    energy[*, i+1] += min([[null, energy[0:-2,i]], [energy[*,i]], [energy[1:*,i], null]], loc ,dimension=2)
    ind[*, i] = loc / z[0] - 1
  endfor
  void = min(energy[*,-1], loc)
  rem = intarr(z[1]) + loc
  for i=z[1]-2, 0, -1 do rem[0:i] += ind[rem[i+1], i]
  rem += [0:z[1]-1]*z[0]
  remove, rem, array
  print, reform(array, z[0]-1, z[1])
end

We iteratively create the energy array and track which direction the seam goes, then construct a removal list once we know the final position. Remove the seam via 1D indexing, then reform back into the array with the new dimensions.

Oh god...I think I just threw up a little seeing IDL (again). I thought I was done seeing that after graduation...

That said, I suspect this also works for GDL, so that the people not willing to pay $1 billion for the single-user license can test it?

I've never used GDL, so I can't say (honestly I forgot it existed). The only thing which might cause a problem is if GDL can't handle array creation of the syntax [0:n]; if that's true, then it's easy to replace r+=[0:z[1]-1]*z[0] with r+=indgen(z[1]-1)*z[0].

Also, while I would rather use python for my golfs, no one else does IDL so I feel obliged to contribute XD. Plus, it does some things very well.

I does make me cringe/cry very well ;)

I know what you mean, hahahahaha

JavaScript (ES6) 197 209 215
Step by step implementation of the wikipedia algorithm.
Probably can be shortened more.
Test running the snippet in Firefox.

// Golfed

F=a=>(u=>{for(r=[i=p.indexOf(Math.min(...p))];l--;i=u[l][i])(r[l]=[...a[l]]).splice(i,1)})
(a.map(r=>[r.map((v,i)=>(q[i]=v+~~p[j=p[i+1] { // in u the elaboration result, row by row
      q=[];
      t = r.map((v,i) => { // build a row for u from a row in a
        j = p[i-1] < p[i] ? i-1 : i; // find position of min in previous row
        j = p[i+1] < p[j] ? i+1 : j;
        q[i] = v + ~~p[j]; // values for current row
        // ~~ convert to number, as at first row all element in p are 'undefined'
        return j;//  position in u, row by row
      });
      p = q; // current row becomes previous row
      return t;
  });
  n = Math.min(...p) // minimum value in the last row
  i = p.indexOf(n); // position of minimum (first if there are more than one present)
  r = []; // result
  // scan u bottom to up to find the element to remove in the output row
  for(j = u.length; j--;)
  {
    r[j] = a[j].slice(); // copy row to output
    r[j].splice(i,1); // remove element
    i = u[j][i]; // position for next row
  }
  return r;
}

// TEST
out=x=>O.innerHTML += x + '\n';

test=[
  [[1,4,3,5,2],[3,2,5,2,3],[5,2,4,2,1]],
  [[1,2,3,4,5]],
  [[1],[2],[3],[4]]
];

test.forEach(t=>{
  out('Test data:\n' + t.map(v=>'['+v+']').join('\n'));
  r=F(t);
  out('Golfed version:\n' + r.map(v=>'['+v+']').join('\n'))
  r=U(t);
  out('Ungolfed version:\n' + r.map(v=>'['+v+']').join('\n'))
})

Pip, 91 bytes
This won't win any prizes, but I had fun working on it. Whitespace is for cosmetic reasons only and is not included in the byte count.
{
 p:{(zaj-1+,3RMv)}
 z:a
 w:,#(a0)
 Fi,#a
  Fjw
   Ii
    z@i@j+:MN(pi-1)
 s:z@i
 Ti<0{
  j:s@?MNs
  a@i@:wRMj
  s:(p--i)
 }
 a
}

This code defines an anonymous function whose argument and return value are nested lists. It implements the algorithm from the Wikipedia page: a (the argument) is the red numbers, and z is the black numbers.
Here's a version with test harness:
f:{p:{(zaj-1+,3RMv)}z:aw:,#(a0)Fi,#aFjwIiz@i@j+:MN(pi-1)s:z@iTi<0{j:s@?MNsa@i@:wRMjs:(p--i)}a}
d:[
 [[1 4 3 5 2]
  [3 2 5 2 3]
  [5 2 4 2 1]]
 [[1 2 3 4 5]]
 [[1]
  [2]
  [3]]
 ]
Fld
 P(fl)

Results:
C:\> pip.py minSumSeam.pip -p
[[4;3;5;2];[3;5;2;3];[5;4;2;1]]
[[2;3;4;5]]
[[];[];[]]

And here's the rough equivalent in Python 3. If anyone wants a better explanation of the Pip code, just ask in the comments.
def f(a):
    z = [row.copy() for row in a]
    w = range(len(a[0]))

    for i in range(len(a)):
        for j in w:
            if i:
                z[i][j] += min(z[i-1][max(j-1,0):j+2])
    s = z[i]
    while i >= 0:
        j = s.index(min(s))
        del a[i][j]
        i -= 1
        s = z[i][max(j-1,0):j+2]
    return a

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
HappyCube Puzzle Solver
This challenge is inspired by a puzzle I played, consisting of foam pieces like these:

which have to be assembled into 3D cubes, like these:

The puzzle pieces can be viewed as grids of 5 * 5 squares, whose middle 3 * 3 squares are always solid, while the 16 squares on the edges can be solid or empty.
A piece will be described using a string of 16 characters (0s and 1s), representing the configuration of its edges (0=empty, 1=solid), in clockwise order, starting from the top left corner.
For example, the string:
0101001000101101

represents this piece:
 # #
####
 ####
####
# #

In order to fit the pieces together to form the cube, every piece can be rotated in any direction. For example, these are the valid rotations of the piece shown above:
 # #    # #     #    ## #
 ####  ####    ####   ####
####    ####  ####   ####
 ####  ####    ####   ####
  # #  # #    ## #     #

# #      # #   # ##    #
####    ####  ####   ####
 ####  ####    ####   ####
####    ####  ####   ####
 # #    # #     #     # ##

Challenge
Write a program or function that takes as input 6 puzzle pieces and prints or returns a 2D representation of the solved cube.
Input
The input will be a string of 6 rows, where each row consists of 16 0 or 1 characters, representing a piece's edges (in the format described above).
It can be assumed that there is a solution for the input.
The trailing newline is optional.
Output
The result will be an ASCII representation of the solved cube, unfolded in 2D, like this (the diagram uses Rubik's Cube notation for side names):
    +---+
    |BA |
    |CK |
    |   |
+---+---+---+---+
|LE |DO |RI |UP |
|FT |WN |GHT|   |
|   |   |   |   |
+---+---+---+---+
    |FR |
    |ONT|
    |   |
    +---+

To avoid the possibility of presenting the solution in multiple ways, the piece placed DOWN will always be the first piece present in the input, in the same rotation as it is specified there.
Every piece will be represented graphically as a 5 * 5 matrix, using spaces to denote empty squares.
For solid squares you can use whatever non-space character you wish, as long as:

any piece of the puzzle will have its solid squares represented using the same character
any two adjacent pieces use different characters

Space padding to the right and the trailing newline are optional.
Test Cases
1.
Input:
0010010101010101
0010001011011010
0101001001010010
0010110100101101
0010110110101101
0010001011010101

Output:
     @ @
     @@@
    @@@@@
     @@@
** **@#@** *# #
 ***#####***#####
*****###*****###
 ***#####***#####
  * @#@#** ** # #
    @@@@
     @@@@
    @@@@
     @ @

2.
Input:
0001110110101101
1010010111011101
0101010101010010
1010001000100011
1010001001010001
0110010100100010

Output:
      @
     @@@@
    @@@@
     @@@@
** **@@## * *# #
****#####****###
 ****###*****####
****#####***####
** *#@#@# * # #
     @@@@
    @@@@
     @@@@
     @ @

3.
Input:
0101001011011010
0010001000100010
0101001011010010
0101010101011010
0101101001011101
1010001001011101

Output:
     @ @@
    @@@@@
     @@@
    @@@@@
* * @#@#* *   #
*****###*****###
 ***#####***#####
*****###*****###
  * ##@##* *  #
    @@@@
     @@@@
    @@@@
    @@ @@

This is codegolf, so the shortest program in bytes wins.

Yes, at least on my display, "back", "down" and "front" look like the same color/character.

"To avoid the possibility of presenting the solution in multiple ways the piece placed DOWN will always be the first piece present in the input, in the same rotation as it is specified there." Even if you hold the first puzzle piece constant, I don't think that the remaining five pieces are guaranteed to have unique locations.

@Rainbolt For the inputs I use, that holds true - there's only one way of arranging the output. Generally speaking though, you are right; there are obviously inputs for which multiple valid arrangements are possible,

Haskell, 1007 One Thousand and One Bytes 923 900 830 bytes
I happened to have already made a happycube solver, now I just need to golf it. Taking a ten byte penalty for using fancy block elements:
import Data.List
r=reverse;z=zipWith;f=foldl1;t=take;g=t 4;d=drop;m=map
n x=t 5x:n(d 4x)
u v a b=init a++v max(last a)(b!!0):d 1b
a!b|k<- \x y->last$' ':[a|b!!x!!y>0]=(k 0<$>[0..4]):((\i->k 3(4-i):[a,a,a]++[k 1i])<$>[1..3])++[k 2<$>[4,3..0]]
p y|(e:v)<-m(g.n.cycle.m(read.pure))$"0":(lines$y),[j,k,l,x,y,r]<-x v=mapM putStrLn$f(u z)$f(z(u id))<$>z(z(!))[a,"▒█▒█",a][[e,k,e,e],[l,j,x,r],[e,y,e,e]];a=" ░  "
x(p:q)=[p:u|x<-permutations q,u@[e,g,y,k,l]<-sequence$(\c->nub$[c,r.m r$c]>>=g.m g.tails.cycle)<$>x,and$zipWith4(\a n b m->all(==1).init.d 1$z(+)(a!!n)$r$b!!m)([l,e,p,p,p,p,e]++u)[3,3,0,3,1,2,0,1,2,2,2,1](y:g:u++[y,k,k,l,g])[1,0,2,1,3,0,0,0,3,1,2,3]++z((((==1).sum.m(!!0)).).z(!!))[[p,e,g],[y,p,e],[k,p,g],[k,p,y],[l,y,e],[l,y,k],[l,g,e],[l,g,k]][[0,3,1],[0..2],[0,3,2],[1..3],[0,1,1],[3,2,2],[1,0,0],[2,3,3]]]!!0

That's a mouthful. Usage:
*Main> mapM_ (\s->p s>>putStrLn"")["0010010101010101\n0010001011011010\n0101001001010010\n0010110100101101\n0010110110101101\n0010001011010101","0001110110101101\n1010010111011101\n0101010101010010\n1010001000100011\n1010001001010001\n0110010100100010","0101001011011010\n0010001000100010\n0101001011010010\n0101010101011010\n0101101001011101\n1010001001011101"]
     ░ ░
     ░░░
    ░░░░░
     ░░░
▒▒ ▒▒░█░▒▒ ▒█ █
 ▒▒▒█████▒▒▒█████
▒▒▒▒▒███▒▒▒▒▒███
 ▒▒▒█████▒▒▒█████
  ▒ ░█░█▒▒ ▒▒ █ █
    ░░░░
     ░░░░
    ░░░░
     ░ ░

      ░
     ░░░░
    ░░░░
     ░░░░
▒▒ ▒▒░░██ ▒ ▒█ █
▒▒▒▒█████▒▒▒▒███
 ▒▒▒▒███▒▒▒▒▒████
▒▒▒▒█████▒▒▒████
▒▒ ▒█░█░█ ▒ █ █
     ░░░░
    ░░░░
     ░░░░
     ░ ░

    ░░ ░
    ░░░░░
     ░░░
    ░░░░░
  ▒ ▒█░█░ ▒ ▒ █
▒▒▒▒▒███▒▒▒▒▒███
 ▒▒▒█████▒▒▒█████
▒▒▒▒▒███▒▒▒▒▒███
 ▒ ▒██░██ ▒   █
     ░░░░
    ░░░░
     ░░░░
    ░░ ░░

Some of the examples have more than one solutions, that's why some of the outputs look different. Ungolfed:
import Data.List (nub, transpose, (\\))
import Control.Monad (guard)

newtype CubePiece = CubePiece [[Int]] deriving Eq
newtype Solution = Solution [CubePiece]

side :: Int -> CubePiece -> [Int]
side n (CubePiece c) = c!!n

corner :: Int -> CubePiece -> Int
corner n (CubePiece c) = head $ c!!n

strToCube str = CubePiece $ hs' . (\x@(a:_)->x++[a]) $ l
  where
    l = map (read.pure) str
    hs' [a] = []
    hs' x = take 5 x : hs' (drop 4 x)

orientations :: CubePiece -> [CubePiece]
orientations (CubePiece cube) = map CubePiece $ nub $ (take 4 . iterate rotate $ cube) ++
  (take 4 . iterate rotate . reverse . map reverse $ cube)
  where
  rotate (a:as) = as++[a]

sideFits ::  (CubePiece, Int) -> (CubePiece, Int) -> Bool
sideFits (c1,n1) (c2,n2) = case (zipWith (+) a b) of
  [_,1,1,1,_] -> True
  _ -> False
  where
  a = side n1 c1
  b = reverse $ side n2 c2

cornerFits :: (CubePiece, Int) -> (CubePiece, Int) -> (CubePiece, Int) -> Bool
cornerFits (c1,n1) (c2,n2) (c3,n3) = a + b + c == 1
  where
  a = corner n1 c1
  b = corner n2 c2
  c = corner n3 c3

printSolution str = putStrLn . specialUnlines . map rivi $
  [[empty,gshow '░' c2,empty,empty],[gshow '▒' c3,gshow '█'c1,gshow '▒'c4,gshow '█'c6],[empty,gshow '░'c5,empty,empty]]
  where
  Solution [c1,c2,c3,c4,c5,c6] = solve . map strToCube . lines $ str
  empty = replicate 5 "     "
  rivi = map (foldl1 specialConcat) . transpose
  specialUnlines = unlines . foldl1(\a b->init a++[zipWith max(last a)(head b)]++tail b)
  specialConcat a b
    | last a==' '=init a++b
    | otherwise = a++tail b

gshow char (CubePiece c) =
  [ map (k 0) [0..4]
  , (k 3 3) : m ++ [(k 1 1)]
  , (k 3 2) : m ++ [(k 1 2)]
  , (k 3 1) : m ++ [(k 1 3)]
  , map (k 2)[4,3..0]
  ]
  where
  k n1 n2 = if (c!!n1)!!n2 == 1 then char else ' '
  m=replicate 3 char

solve :: [CubePiece] -> Solution
solve pieces = Solution $ head $ do
  let c1' = pieces!!0
  let c1 = c1'

  c2'  <- pieces \\ [c1']
  c2   <- orientations c2'
  guard $ sideFits (c1,0) (c2,2)

  c3'  <- pieces \\ [c1',c2']
  c3   <- orientations c3'
  guard $ sideFits (c1,3) (c3,1)
  guard $ sideFits (c2,3) (c3,0)
  guard $ cornerFits (c1,0) (c2,3) (c3,1)

  c4'  <- pieces \\ [c1',c2',c3']
  c4   <- orientations c4'
  guard $ sideFits (c1,1) (c4,3)
  guard $ sideFits (c2,1) (c4,0)
  guard $ cornerFits (c1,1) (c2,2) (c4,0)
  c5' <- pieces \\ [c1',c2',c3',c4']
  c5 <- orientations c5'
  guard $ sideFits (c1,2) (c5,0)
  guard $ sideFits (c4,2) (c5,1)
  guard $ sideFits (c3,2) (c5,3)
  guard $ cornerFits (c5,0) (c1,3) (c3,2)
  guard $ cornerFits (c5,1) (c1,2) (c4,3)

  c6' <- pieces \\ [c1',c2',c3',c4',c5']
  c6 <- orientations c6'
  guard $ sideFits (c6,0) (c2,0)
  guard $ sideFits (c6,1) (c3,3)
  guard $ sideFits (c6,2) (c5,2)
  guard $ sideFits (c6,3) (c4,1)
  guard $ cornerFits (c6,0) (c4,1) (c2,1)
  guard $ cornerFits (c6,3) (c4,2) (c5,2)
  guard $ cornerFits (c6,1) (c3,0) (c2,0)
  guard $ cornerFits (c6,2) (c3,3) (c5,3)
  return $ [c1,c2,c3,c4,c5,c6]

main = mapM_ printSolution ["0010010101010101\n0010001011011010\n0101001001010010\n0010110100101101\n0010110110101101\n0010001011010101","0001110110101101\n1010010111011101\n0101010101010010\n1010001000100011\n1010001001010001\n0110010100100010","0101001011011010\n0010001000100010\n0101001011010010\n0101010101011010\n0101101001011101\n1010001001011101"]

Python3, 1098 bytes:
E=enumerate
H=range
R=lambda x,n=4:set()if n==0 else{str(x),*R([i[::-1]for i in zip(*x)],n-1)}
def B(i):k=[[[' ','#'][int(j)]for j in i[t:t+4]]for t in H(0,16,4)];return[k[0]+[k[1][0]],*[[a,*('#'*3),b]for a,b in zip(k[3][::-1][:-1],k[1][1:])],[k[3][::-1][-1]]+k[2][::-1]]
V=lambda U,x,y,r,i,R,I:all((0<I<4 and A!=B)or(I in[0,4]and(A!=B or(A==' 'and B==' ')))for I,(A,B)in E(zip([U[x],[*zip(*U[x])]][r][i],[U[y],[*zip(*U[y])]][R][I])))
def L(M):
 b=[[' 'for _ in H(17)]for _ in H(13)]
 for P,(x,y),C in zip(M,[(4,4),(4,0),(0,4),(4,8),(8,4),(4,12)],'#@*&$%'):
  for X in H(5):
   for Y in H(5):b[x+X][y+Y]=[C,b[x+X][y+Y]][P[X][Y]==' ']
 return b
def f(p):
 s,*p=[B(i)for i in p.split('\n')]
 q=[([s],p)]
 while q:
  M,p=q.pop(0)
  if len(M)==6:
   for i in M:return L(M)
  for i,a in E(p):
   for P in{*R(a),*R([j[::-1]for j in a])}:
    U=M+[eval(P)]
    if all(V(U,*j)for j in[(1,0,1,4,1,0),(2,0,0,4,0,0),(3,0,1,0,1,4),(4,0,0,0,0,4),(5,3,1,0,1,4),(1,2,0,0,1,0),(2,3,1,4,0,0),(3,4,0,4,1,4),(1,4,0,4,1,0),(1,5,1,0,1,4),(2,5,0,0,0,0),(4,5,0,4,0,4)]if j[0]<len(U)and j[1]<len(U)):q+=[(U,p[:i]+p[i+1:])]

Try it online!

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Check if words are isomorphs
Two words are isomorphs if they have the same pattern of letter repetitions. For example, both ESTATE and DUELED have pattern abcdca
ESTATE
DUELED

abcdca

because letters 1 and 6 are the same, letters 3 and 5 are the same, and nothing further. This also means the words are related by a substitution cipher, here with the matching E <-> D, S <-> U, T <-> E, A <-> L.
Write code that takes two words and checks whether they are isomorphs. Fewest bytes wins.
Input: Two non-empty strings of capital letters A..Z. If you wish, you can take these as a collection of two strings or as a single string with a separator.
Output: A consistent Truthy value for pairs that are isomorphs, and a consistent Falsey value if they are not. Strings of different lengths are valid inputs that are never isomorphs.
Test cases:
True:
ESTATE DUELED
DUELED ESTATE
XXX YYY
CBAABC DEFFED
RAMBUNCTIOUSLY THERMODYNAMICS
DISCRIMINATIVE SIMPLIFICATION

False:
SEE SAW
ANTS PANTS
BANANA SERENE
BANANA SENSES
AB CC
XXY XYY
ABCBACCBA ABCBACCAB
ABAB CD

Feel free to add more test cases you find useful.
Leaderboard
Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
# Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:
# Ruby, <s>104</s> <s>101</s> 96 bytes

var QUESTION_ID=50472;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),e.has_more?getAnswers():process()}})}function shouldHaveHeading(e){var a=!1,r=e.body_markdown.split("\n");try{a|=/^#/.test(e.body_markdown),a|=["-","="].indexOf(r[1][0])>-1,a&=LANGUAGE_REG.test(e.body_markdown)}catch(n){}return a}function shouldHaveScore(e){var a=!1;try{a|=SIZE_REG.test(e.body_markdown.split("\n")[0])}catch(r){}return a}function getAuthorName(e){return e.owner.display_name}function process(){answers=answers.filter(shouldHaveScore).filter(shouldHaveHeading),answers.sort(function(e,a){var r=+(e.body_markdown.split("\n")[0].match(SIZE_REG)||[1/0])[0],n=+(a.body_markdown.split("\n")[0].match(SIZE_REG)||[1/0])[0];return r-n});var e={},a=1,r=null,n=1;answers.forEach(function(s){var t=s.body_markdown.split("\n")[0],o=jQuery("#answer-template").html(),l=(t.match(NUMBER_REG)[0],(t.match(SIZE_REG)||[0])[0]),c=t.match(LANGUAGE_REG)[1],i=getAuthorName(s);l!=r&&(n=a),r=l,++a,o=o.replace("{{PLACE}}",n+".").replace("{{NAME}}",i).replace("{{LANGUAGE}}",c).replace("{{SIZE}}",l).replace("{{LINK}}",s.share_link),o=jQuery(o),jQuery("#answers").append(o),e[c]=e[c]||{lang:c,user:i,size:l,link:s.share_link}});var s=[];for(var t in e)e.hasOwnProperty(t)&&s.push(e[t]);s.sort(function(e,a){return e.lang>a.lang?1:e.lang<a.lang?-1:0});for(var o=0;o<s.length;++o){var l=jQuery("#language-template").html(),t=s[o];l=l.replace("{{LANGUAGE}}",t.lang).replace("{{NAME}}",t.user).replace("{{SIZE}}",t.size).replace("{{LINK}}",t.link),l=jQuery(l),jQuery("#languages").append(l)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",answers=[],page=1;getAnswers();var SIZE_REG=/\d+(?=[^\d&]*(?:<(?:s>[^&]*<\/s>|[^&]+>)[^\d&]*)*$)/,NUMBER_REG=/\d+/,LANGUAGE_REG=/^#*\s*([^,]+)/;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

Are the lengths of the two inputs guaranteed to be same ?

@Optimizer No, the lengths can be different.

@Jakube No, your code should in theory work with inputs of any length. It's OK though if huge inputs fail on hardware due to issues like memory overflow or stack depth.

O.k. Then I'll delete my answer.

Important test case: ABAB CD (for zip-like approaches)

@Sp3000 Thanks, added it.

It seems the code snippet in the question isn't working?

@kamoroso94 I changed to link to https so it should work now.

J, 4 bytes
-:&=

Usage
   'THERMODYNAMICS' (-:&=) 'RAMBUNCTIOUSLY'  NB. parens are optional
1

Explanation

= with 1 argument creates an equality-table comparing the elements of the input and its nub.
='ESTATE' gives the binary matrix

= | E S T A T E
--+------------
E | 1 0 0 0 0 1
S | 0 1 0 0 0 0
T | 0 0 1 0 1 0
A | 0 0 0 1 0 0

-: with 2 arguments checks their equality (like == generally does). This works for different size matrices (or even different types) too.
f&g applies g to both input separately and then applies f to the two results together so x f&g y == f(g(x), g(y)).
So in our case we compare the two equality-tables.

Try it online here.

An interesting and elegant approach. Without an equivalent to that &, the closest thing you could do in K would probably be ~/{x=/:x}', which is a good bit longer.

Jesus. This has to be a contender for the codegolf hall of fame.

Wow, did not expect classify = to have any other use than for counting occurrences.

K, 5 bytes
This has a delightfully elegant solution in K!
~/=:'

The "group" operator (monadic =) creates precisely the signature we want for word isomorphism; gathering vectors of the indices of each element of a vector, with the groups ordered by appearance:
  ="ABBAC"
(0 3
 1 2
 ,4)

  ="DCCDF"
(0 3
 1 2
 ,4)

Taking a pair of strings as a vector, we just need to apply group to each element (=:') and then reduce with "match" (~), the deep-equality operator:
  ~/=:'("RAMBUNCTIOUSLY";"THERMODYNAMICS")
1
  ~/=:'("BANANA";"SERENE")
0

Python 2, 41 bytes
f=lambda a,b:map(a.find,a)==map(b.find,b)

This was the solution that inspired me to create this challenge!

CJam, 9 bytes
r_f#r_f#=

Prints 1 if the words are isomorphs and 0 if they're not.
Try it online in the CJam interpreter.
How it works
r    e# Read a whitespace separated token from STDIN.
_    e# Push a copy.
f#   e# Get the indexes of all characters from the first copy in the second.
r_f# e# Repeat for the second word.
=    e# Check for equality.

JavaScript, ES7, 62 55 54 52 51 bytes
f=(x,y,g=z=>[for(i of z)z.search(i)]+0)=>g(x)==g(y)

The logic is simple. I simply convert both the inputs into their corresponding character index values, convert that array into string and compare.
f=(x, y,                  // Create a function named f which takes two arguments x and y
   g=                     // There is a third default argument to f which equals to
     z=>                  // and arrow function which takes argument z
     [                    // Return this array which is created using array comprehension
      for(i of z)         // For each character of z
      z.search(i)         // Use the index of that character in z in place of the character
     ]+0                  // And finally type cast that array to a string
                          // Here, the array elements are automatically joined by a ','
                          // and appended by a 0.
                          // Its funny how JS type casts Array + Number to a string
   )=>                    // Now the body of function f starts
      g(x)==g(y)          // It simply returns if index map of x equals index map of y

Try the above code using the snippet below.

f=(x,y,g=z=>[for(i of z)z.search(i)]+0)=>g(x)==g(y)

// for cross browser testing, here is a slightly modified ES5 version of above function

if (!f) {
  function f(x, y) {
    function g(z) {
      var Z = [];
      for (var i = 0; i < z.length; i++) {
        Z[i] = z.search(z[i])
      }
      return Z + 0;
    }
    return g(x) == g(y);
  }
}

B.onclick=function() {
  O.innerHTML = f(D.value, E.value);

};

f(<input id=D />,<input id=E />)
<button id=B >Run</button>

<output id=O />

2 bytes saved thanks to @edc65

+1, Tried it, works well. +0 instead of +""?

@edc65 wow, typecasting WTF

I realized just now that the strings are 'A-Z', so you can safely use search instead of indexOf and cut 1 more byte.

array comprehensions havent been cut of es7 eventually? where does this code works? i think only in mozilla

Bash + coreutils, 38
[ `tr $@<<<$1``tr $2 $1<<<$2` = $2$1 ]

Note we are using the usual shell idea of truthy/falsy here - zero means SUCCESS or TRUE and non-zero means error or FALSE:
$ for t in "ESTATE DUELED" "DUELED ESTATE" "XXX YYY" "CBAABC DEFFED" "RAMBUNCTIOUSLY THERMODYNAMICS" "DISCRIMINATIVE SIMPLIFICATION" "SEE SAW" "ANTS PANTS" "BANANA SERENE" "BANANA SENSES" "AB CC" "XXY XYY" "ABCBACCBA ABCBACCAB"; do
> ./isomorph.sh $t
> echo $t $?
> done
ESTATE DUELED 0
DUELED ESTATE 0
XXX YYY 0
CBAABC DEFFED 0
RAMBUNCTIOUSLY THERMODYNAMICS 0
DISCRIMINATIVE SIMPLIFICATION 0
SEE SAW 1
ANTS PANTS 1
BANANA SERENE 1
BANANA SENSES 1
AB CC 1
XXY XYY 1
ABCBACCBA ABCBACCAB 1
$

-4 bytes (link is to Zsh, but it works the same in Bash)

Haskell, 33 29
EDIT:
this is way too late, but i found this improvement using applicatives, that were added to prelude only in march 2015.
s%k=g s==g k
g s=(==)<$>s<*>s

Old version:
s%k=g s==g k
g s=[a==b|a<-s,b<-s]

the checking function is (%)
this works by generating for each string its "equality record": for each two indices i j, it records whether they have equal characters. the record is ordered so that the record for two indices i, j is always in the same place*
and therefore checking the equality of the records would return whether or not the strings have the same pattern.
for example, the equality record of "ABC" is [1,0,0,0,1,0,0,0,1] (1 for true, 0 for false) - there is True where any index is compared with itself. anywhere else is a false. (skipping these checks might be more efficient, but is harder in terms of golfng)
*if the strings are of the same length. otherwise it returns false just because the records are of different lengths

Haskell, 45 41 bytes
h l=map(`lookup`zip l[1..])l
x!y=h x==h y

Returns True or False, e.g "ESTATE" ! "DUELED" -> True.
Uses the map-char-to-first-index method as seen in many other answers. Association lists come in handy, because earlier entries trump. "aba" becomes [(a,1),(b,2),(a,3)] where lookup always fetches a -> 1.
Edit: @Mauris found 4 bytes to save.

You can replace (flip lookup$zip l[1..]) by (`lookup`zip l[1..]).

R, 78
function(x,y)identical((g=function(z)match(a<-strsplit(z,"")[[1]],a))(x),g(y))

De-golfed:
word_to_num <- function(word) {
   chars <- strsplit(word,"")[[1]]
   match(chars, chars)
}
are_isomorph <- function(word1, word2) identical(word_to_num(word1),
                                                 word_to_num(word2))

beat me to it! (+1)

I think all( (g=...)(x)==g(y)) is shorter than identical...

Brainfuck, 169 168 162 144 140 131 130
Compatible with Alex Pankratov's bff (brainfuck interpreter used on SPOJ and ideone) and Thomas Cort's BFI (used on Anarchy Golf).
The expected input is two strings separated by a tab, with no newline after the second string. The output is 1 for isomorphs and 0 for non-isomorphs, which is convenient for checking results visually, although not the shortest option. (Update: shorter version with \x01 and \x00 as output and \x00 as separator at the bottom of the answer.)
Demonstration on ideone.
,+
[
  -
  ---------
  >+<
  [
    >>-<
    [
      <
      [
        >+<
        <<<<-<+>>>>>-
      ]
      ++[->+]
      ->+[+<-]
      >[<<<<]
      <
    ]
    <[>+<-]
    +[->+]
    <->
    >>>
  ]
  >
  [
    [[-]<<<<<]
    >>>>
  ]
  <,+
]
>>>+>+
[
  [<->-]
  <[>>>>>]
  <<<<
]
-<[>]
+++++++[<+++++++>-]
<.

This problem turns out to be very nice for brainfuck.
The basic idea with indexing is to go backwards from the end of the current string prefix. If the character has not previously occurred, we can take the length of the string prefix. For example:
STATES
123255

The indexing in the code is actually slightly different but uses the same principle.
The memory layout is in blocks of 5:
0 0 0 0 0 0 c 0 i p 0 c 0 i p 0 c 0 i p 0 0 0 0

c stands for character, i for index, and p for previous (index). When the first string is being processed, all the p slots are zero. The cell to the left of c is used to hold a copy of the current character that we are trying to find the index of. The cell to the left of the current i is used to hold a -1 for easy pointer navigation.
There are many conditions that need to be considered carefully. At the end, we check for isomorphs by comparing the (i,p) pairs, and we reach the cluster of zero cells to the left of the leftmost (i,p) pair if and only if the strings are isomorphs. Here is a commented version of the code to make it easier to follow:
,+
[                       while there is input
  -
  ---------
  >+<                   increment char (adjust later)
  [                     if not tab
    >>-<                set navigation flag
    [                   loop to find index
      <                 travel to copy
      [
        >+<             restore char
        <<<<-<+>>>>>-   compare chars and create copy
      ]
      ++[->+]           travel between navigation flags
      ->+[+<-]          increment index by 2 and go back
      >[<<<<]           proceed if not fallen off string
      <                 compare chars
    ]
    <[>+<-]             restore char (or no op)
    +[->+]              go back to navigation flag
    <->                 adjust char
    >>>                 alignment
  ]
  >
  [                     if tab
    [[-]<<<<<]          erase chars and go to beginning
    >>>>                alignment
  ]
  <,+
]
>>>+>+                  check string lengths and start loop
[
  [<->-]                compare indices
  <[>>>>>]              realign if not equal
  <<<<                  proceed
]
-<[>]                   cell to left is zero iff isomorphs
+++++++[<+++++++>-]
<.

Update:
Here is a version that prints \x01 for isomorphs and \x00 for non-isomorphs. This is arguably a more accurate interpretation of Truthy and Falsey for brainfuck, because of the way [ and ] work. The only difference is at the very end.
Additional: Now using \x00 as a separator to save 10 bytes.
+
[
  -
  >+<
  [
    >>-<
    [
      <
      [
        >+<
        <<<<-<+>>>>>-
      ]
      ++[->+]
      ->+[+<-]
      >[<<<<]
      <
    ]
    <[>+<-]
    +[->+]
    <->
    >>>
  ]
  >
  [
    [[-]<<<<<]
    >>>>
  ]
  <,+
]
>>>+>+
[
  [<->-]
  <[>>>>>]
  <<<<
]
-<[>]
<+.

Ruby, 83 bytes
t=->x{y=0;z=?`;x.gsub!(y[0],z.succ!)while y=x.match(/[A-Z]/);x};f=->a,b{t[a]==t[b]}

It's a function f that takes two arguments and returns true or false.
Explanation:
test = -> str {
    y = nil  # we're just initializing this; it doesn't matter to what
             # this is the variable we use to store the `match' result
    z = '`'  # backtick is the ASCII character before `a'
    while y = str.match(/[A-Z]/) do  # while there is an uppercase letter in str
        str.gsub!(y[0], z.succ!)  # replace all instances of the uppercase letter
                                  # with the next unused lowercase letter
    end
    str  # return the new string
}
# self-explanatory
f=->a,b{test[a]==test[b]}

This should save 4 bytes: t=->x{z=?\;x.chars.to_a.uniq.map{|c|x.gsub!(c,z.succ!)};x};f=->a,b{t[a]==t[b]}, and you could get it down to 68 if you use a hash for getting the replacement: t=->x{h={};i=9;x.gsub!(/./){|c|h[c]||h[c]=i+=1}};f=->a,b{t[a]==t[b]}`

JavaScript (ES6), 62
Using an aux function h that maps each word to an array containing the position of each letter in the word, for instance: PASS -> [1,2,3,3]. Return true if the function h applied the two words gives the same result.

f=(a,b,h=w=>0+[for(c of(n=k=[],w))k[c]=k[c]||++n])=>h(b)==h(a)

// TEST

;[
// True
 ['ESTATE','DUELED']
,['DUELED','ESTATE']
,['XXX','YYY']
,['CBAABC','DEFFED']
,['RAMBUNCTIOUSLY','THERMODYNAMICS']
,['DISCRIMINATIVE','SIMPLIFICATION']

// False:

,['SEE','SAW']
,['ANTS','PANTS']
,['BANANA','SERENE']
,['BANANA','SENSES']
,['XXY','XYY']
,['ABCBACCBA','ABCBACCAB']
]
.forEach(t=>(f(t[0],t[1])?OK:KO).innerHTML+=t+'\n')
Ok

KO

Sometimes, simple is shorter ;)

Java, 107
(s,t)->java.util.Arrays.equals(s.chars().map(s::indexOf).toArray(),t.chars().map(t::indexOf).toArray())

Maps each character of s and t to its location, and checks for equality.
Expanded:
class Isomorphs {
    public static void main(String[] args) {
        java.util.function.BiFunction<String, String, Boolean> f =
            (s, t) -> java.util.Arrays.equals(
                                              s.chars().map(s::indexOf).toArray(),
                                              t.chars().map(t::indexOf).toArray()
                                             )
           ;
        System.out.println(f.apply("XXY", "XYY"));
    }
}

I don't think this will work correctly if the strings have different lengths.

@JohnE Yes, it does.

Ah, ok- I think the "expanded" version is misleading.

Pyth, 9 bytes
qFmmxdkdQ

Takes input in the following form:
"ESTATE", "DUELED"

If that is not acceptable, the following code is 10 bytes:
qFmmxdkd.z

and uses this input form:
ESTATE
DUELED

Uses the index of char in string representation.

The first input format is fine. I'm interested in how you're reducing to check equality but I'm unclear on how F works as fold. What's <binary>F?

@xnor <binary>F<seq> is <binary> folded over <seq>. It's equivalent to interspersing <binary> between every pair of elements of <seq>. Thus, <binary>F on a 2 element sequence simply applies the function to the sequence, equivalent to .* in Pyth or * in Python.

I thought the trailing Q was implicit in Pyth?

@Cyoce Not back then - that feature was added in April 2016, almost a year later.

Matlab, 50 bytes
f=@(s,t)isequal(bsxfun(@eq,s,s'),bsxfun(@eq,t,t'))

The function is defined as anonymous to save some space.
Example:
>> f=@(s,t)isequal(bsxfun(@eq,s,s'),bsxfun(@eq,t,t'));
>> f('ESTATE','DUELED')
ans =
     1
>> f('ANTS','PANTS')
ans =
     0

Octave, 26 bytes
@(s,t)isequal(s==s',t==t')

Looks interesting. explanation?

== is matrix element-wise equality, and since s and s' are different sizes, octave's "broadcasting" automatically tries to get matrices of the same size to operate on -- which in this case means repeating the row s and column s'

It's the same approach as @LuisMendo's Matlab solution, but there the expansion is explicit.

Python 3, 85 bytes
f=lambda a,b:''.join(map(lambda g:dict(zip(a,b))[g],a))==b
g=lambda a,b:f(a,b)&f(b,a)

Where is the input/output on this one?

@DJMcMayhem g is the main function, f is helper. There's a confusing choice of variable g inside f, but it's an unrelated bound variable.. The g= is optional as per the ruling allowing anon functions, which saves two chars.'

Ruby, 31 bytes
->a{!!a.uniq!{|s|s.tr s,'a-z'}}

A Proc that takes an array of strings and checks whether any are isomorphic to each other. tr s,'a-z' with these arguments normalizes a string s by replacing each letter with the nth letter in the alphabet, where n is the greatest index with which that letter appears in the string. For example, estate becomes fbedef, as does dueled.

APL (Dyalog), 5 4 bytes
-1 thanks to ngn's hint.
Anonymous tacit prefix function which takes a list of two strings as argument.
≡.⍳⍨

Try it Online!
This is an inner product, but instead of the usual + and × it uses
≡ identicalness
. and
⍳ the ɩndex (the first occurrence of each element)
⍨ with the entire two-element list of words used as both arguments
If we call the words A and B, then we can derive the previous solution as follows:
≡.⍳⍨ A B
A B ≡.⍳ A B
(A⍳A) ≡ (B⍳B)
(⍳⍨A) ≡ (⍳⍨B)
≡/ ⍳⍨¨ A B
Previous solution
Anonymous tacit prefix function which takes a list of two strings as argument.
≡/⍳⍨¨

Try it online!
≡ identicalness
/ across
⍳ the ɩndex (the first occurrence of each element…)
⍨ selfie (…in itself)
¨ of each

can you see the inner product? :)

@ngn Yes of course. SIlly me.

Is the top link supposed to link to the old solution?

Too bad this doesn't work on higher rank arrays though :P

@Zacharý Obviously there is a way… (Not going to tell you yet, though!)

Yeah, I know it already.

Did you or @ngn ever FIND the 12-byte solution to Isomporphin?

I did. I'm hoping to golf it even further.

@ngn Oooh, you're leading again! I was getting disappointed ;-)

Was it because of that not-so-subtle- hint, or did you actually manage to find (no pun intended) it yourself?

Also, I have no idea how you people did GoL in so few bytes

@Zacharý YOu meant that @ ngn?

@Zacharý Some of the solutions are indeed incredibly clever. I'll be presenting some of the simpler ones (!) on dyalog.tv, Thursday next week.

The finding the solution was @ngn, but the GoL comment was directed at both of you.

@Zacharý Well, I can't tell you until next week. I do expect that we will publish the shortest solutions.

@Zachary How do you know I was able to find your solution? Mine could be totally different or I could be bluffing :) Anyway, I promise you full disclosure after the tournament.

@Adám When is the deadline? 23:59 BST on 22 Oct?

@ngn I suppose. Also, you should hang out in https://chat.stackexchange.com/rooms/52405/apl.

@Zacharý as promised: https://ngn.github.io/apl-codegolf-2017/readme.txt

@ngn Thank you, you just did my work for today for me. (I'll present some of these on Thursday's dyalog.tv)

Wow, nice job. Now we just need Michele's MonadicKey.

05AB1E, 6 bytes
εæδË}Ë

Try it online!
Takes input as a list: ['ESTATE', 'DUELED']
Explanations:
    εæδË}Ë   Full program
    ε        Apply on each
     æ         Powerset
      δË       For each generated substring: 1 if all equal, 0 otherwise
        }    End for each
         Ë   1 if all equal, 0 otherwise

Ruby, 50 bytes
30 bytes shorter ruby code. Written before I took a look at the solutions, checks for each character of both strings whether the index of that character's first occurence matches; ie. transforms a string to its normalized form 01121 etc and compares those.
->x,y{g=->z{z.chars.map{|c|z=~/#{c}/}};g[x]==g[y]}

Test cases on ideone As an additional bonus, this breaks ideone's code highlighting.

Mathematica, 46 bytes
Equal@@Values@*PositionIndex/@Characters@{##}&

PCRE, 84 bytes
^((.)(?=.+ (\3.|)(.))(?=((?=(\2|)?+.* \3\4(\7?(?(?=.*+\6)(?!\4).|\4))).)+ ))+. \3..$

Subject should be two space-separated words, as in the OP. Here's a cursory explanation:

For each letter X in the first word:

Look ahead to the second word and establish back references to recall how far along we are as well as the letter Y in the second word corresponding to X.
For each letter Z past the current position in the first word:

Establish similar back references as above.
Look ahead to the corresponding letter in the second word and check if Z = X then match a Y, otherwise match a letter that isn't Y.

This iteration can end once we've matched up until the penultimate letter in the first word. At this point, since no further validation is necessary, all that remains is to test that the words are of equal length (the back reference containing accumulating substrings of the second word is always behind by 1 letter).

Jelly, 4 bytes
ĠṢ)E

Try it online!
Another 4 byte version
How they work
ĠṢ)E - Main link. Takes [A, B] on the left
  )  - Over each string S in the input:
Ġ    -   Group the indices of S by it's values
 Ṣ   -   Sort the lists of indices
   E - Are both equal?

ẹⱮ)E - Main link. Takes [A, B] on the left
  )  - Over each string S in the input:
 Ɱ   -   For each character C in S:
ẹ    -     Get the indices of C in S
   E - Are both equal?

Vyxal, 7 bytes
ƛUẊv≈;≈

Try it Online!
ƛ    ;≈ # Same upon...
  Ẋ     # Cartesian product of...
 U      # Uniquified value
        # And (implicit) value
   v≈   # For each, same?

BQN, 3 bytesSBCS
≡○⊐

Run online!
The builtin Classify ⊐ gets the pattern of letter repetitions for a given string as a vector of non-negative integers. All that's left to do is to compare the two results for equality.
⊐ "ESTATE"
# ⟨ 0 1 2 3 2 0 ⟩
⊐ "DUELED"
# ⟨ 0 1 2 3 2 0 ⟩
(⊐ "ESTATE") ≡ (⊐ "DUELED")
# 1
"ESTATE" ≡○⊐ "DUELED"
# 1

Husk, 5 bytes
¤=´×=

Try it online!
Explanation
       -- implicit input A, B (strings aka character lists)       | "ab" "12"
¤=     -- apply the following function to A & B, then compare:    | [1,0,0,1] == [1,0,0,1] -> 1
  ´×   --   Cartesian product with itself under                   | ["aa","ba","ab","bb"] ["11","21","12","22"]
    =  --   equality                                              | [ 1  , 0  , 0  , 1  ] [ 1  , 0  , 0  , 1  ]

Husk, 5 4 bytes
Ë´Ṫ=

Try it online!
-1 byte from Leo using ბიმო's answer.
Explanation
Ë´Ṫ=
Ë    check if all the elements are equal by the following predicate:
 ´Ṫ  cartesian product with self
   = by equality

I'd love to see an explanation of this, especially so I can try to understand the ηk bit...

@DominicvanEssen added an explanation.

You can get to 4 bytes in a couple of ways ;) (hint: other predicates can be implemented in 3 bytes without needing a bracket)

sounds confusing

Basically, you can combine this other Husk solution with yours and save a byte

Thunno 2, 6 bytes
ıʠ€ạ;ạ

Try it online!
Explanation
ıʠ€ạ;ạ  # Implicit input
ı   ;   # Map:
 ʠ      #  Powerset of the string
  €     #  For each one:
   ạ    #   Check if all equal
     ạ  # Check if all equal
        # Implicit output

I seem to get 1 no matter what inputs I put in your TIO

@xnor sorry, the inputs weren't formatted correctly (the code was correct). I have fixed the link.

Julia 1.0, 67 bytes
^,~=Set∘zip,length
!x=allunique(first.(x))
a\b=!a^b&&!b^a&&~a==~b

Try it online!
Checks that characters map uniquely in both directions, and that both strings are the same length.
-10 bytes thanks to MarcMush: no need to use splat operator inside zip

zip(a, b) works

Nekomata + -e, 5 bytes
ŤuŤᵐů

Attempt This Online!
Takes input as a list of two strings.
ŤuŤᵐů
Ť       Transpose; ["ESTATE","DUELED"] -> ["ED","SU","TE","AL","TE","ED"]
 u      Uniquify; ["ED","SU","TE","AL","TE","ED"] -> ["ED","SU","TE","AL"]
  Ť     Transpose; ["ED","SU","TE","AL"] -> ["ESTA","DUEL"]
   ᵐů   Check that neither string contains duplicate characters

Vyxal, 4 bytes
¨£β≈

Try it Online!
¨£   # Zipwith...
  β  # Convert <str> from custom base <str>
   ≈ # All equal?

Cobra, 72 bytes
do(a='',b='')=(for i in a get a.indexOf(i))==for i in b get b.indexOf(i)

Are you sure this marks the AB CC test case False?

@xnor fixed now

Python 3, 75 bytes
def C():s=input();return' '.join(str(s.index(c))for c in s)
print(C()==C())

Try it online!

JavaScript (ES5), 142 98
Quite a big one, but I didn't saw an ES5 version yet.
for(l=j=2;j--;){c=prompt();for(i=c.length;i--;)c=c.replace(RegExp(c[i],"g"),i);b=l==c;l=c}alert(b)
Simply replaces every occurence of the first letter with it's reverse index value. Repeats this for every character.
It does the same for both inputs and compares the generated pattern.
The comparison is quite ugly, but i din't wan't to use an array to store and compare it.

Could you not move ;l=c to for(l=j=2;j--; and save a byte?

Perl, 38 bytes
($_,$a)=@ARGV;eval"y/$_/$a/";say$_~~$a

Run as perl -E '($_,$a)=@ARGV;eval"y/$_/$a/";say$_~~$a' RAMBUNCTIOUSLY THERMODYNAMICS
Prints 1 if true, nothing if false.

Common Lisp, 76 bytes
(lambda(a b)(equal #1=(map'list(lambda(x)(position x a))a)(setf a b a #1#)))

Try it online!

C++, 213 196 162 bytes
-51 bytes thanks to Zacharý
#include<map>
#define F(X,x)for(auto&e:X){if(x.end()==x.find(e))x[e]=65+x.size();e=x[e];}
auto i=[](auto a,auto b){std::map<int,int>c,d;F(a,c)F(b,d)return a==b;};

To call the lambda, you need to pass 2 arguments that are std::string data type
Code to test :
std::initializer_list<std::pair<std::string, std::string>> test{
    {"ESTATE","DUELED"},
    {"DUELED","ESTATE"},
    {"XXX","YYY"},
    {"CBAABC","DEFFED"},
    {"RAMBUNCTIOUSLY","THERMODYNAMICS"},
    {"DISCRIMINATIVE","SIMPLIFICATION"},
    {"SEE","SAW"},
    {"ANTS","PANTS"},
    {"BANANA","SERENE"},
    {"BANAnA","SENSES"},
    {"AB","CC"},
    {"XXY","XYY"},
    {"ABCBACCBA","ABCBACCAB"},
    {"ABAB","AC"}
};

for (const auto& a : test) {
    std::cout << "Test with " << a.first << " and " << a.second <<
        " outputs : " << (i(a.first, a.second)?"TRUE":"FALSE") << '\n';
}

for the code that tests, including iostream and string header file is required

It doesn't look like you use anything from the string header, so can you remove it and have the user include it themselves?

Does this work for 161 bytes?

@Zacharý If you add the e as argument of find, yes, it works

That moment when you get beat by Brainfuck though >_<

JavaScript (ES6), 52 51 50 bytes
This version doesn't use array comprehension, and takes input using currying syntax.
a=>b=>(f=x=>0+[...x].map(c=>x.search(c)))(a)==f(b)

const isomorph = a=>b=>(f=x=>0+[...x].map(c=>x.search(c)))(a)==f(b);
const tests = [
  {input: ["ESTATE", "DUELED"], expected: true},
  {input: ["DUELED", "ESTATE"], expected: true},
  {input: ["XXX", "YYY"], expected: true},
  {input: ["CBAABC", "DEFFED"], expected: true},
  {input: ["RAMBUNCTIOUSLY", "THERMODYNAMICS"], expected: true},
  {input: ["DISCRIMINATIVE", "SIMPLIFICATION"], expected: true},
  {input: ["SEE", "SAW"], expected: false},
  {input: ["ANTS", "PANTS"], expected: false},
  {input: ["BANANA", "SERENE"], expected: false},
  {input: ["BANANA", "SENSES"], expected: false},
  {input: ["AB", "CC"], expected: false},
  {input: ["XXY", "XYY"], expected: false},
  {input: ["ABCBACCBA", "ABCBACCAB"], expected: false},
  {input: ["ABAB", "CD"], expected: false}
];

for(const { input: [str1, str2], expected } of tests) {
  console.log(`isomorph("${str1}")("${str2}") = ${isomorph(str1)(str2)}, expected = ${expected}`);
}

Japt, 9 bytes
®¬m!âZÃre

Try it online!
Takes an array of two strings.
Unpacked & How it works
UmZ{Zq m!âZ} re

UmZ{     Map with...
Zq m       Split into chars and map...
!âZ          X=>Z.â(X)
             char=>str.search(char); First index of the char
}
re       Reduce with Array equality

8 bytes

C (gcc), 93 92 bytes

Saved a byte thanks to ceilingcat; performing an index shift.

m,o;r(char*p,char*h){for(o=0;*p;p++,++h)for(m=0;p[m];)o|=(p[m]==*p)^(h[m++]==*h);o|=*p!=*h;}

Try it online!

R, 62 bytes
function(x,y,`[`=chartr)x[z<-Reduce(paste0,LETTERS),x]==y[z,y]

Try it online!
Translates (chartr) the characters or each string in order of occurrence into ABC...XYZ.
After this, isomorphic strings are identical.
To save bytes (at the expense of readability), we redefine the R index operator [ as an alias of the chartr function, and we define z as a string containing the uppercase alphabet.
Without these golfs, the (readable) function would be:
function(x,y) chartr(x,"ABCDEFGHIJKLMNOPQRSTUVWXYZ",x)==chartr(y,"ABCDEFGHIJKLMNOPQRSTUVWXYZ",y)

Factor + math.extras, 32 bytes
[ [ unique-indices nip ] same? ]

Try it online!
unique-indices is a word that produces output like this:
                ! "ESTATE"
unique-indices  ! "ESTA" { 0 1 2 3 2 0 }

We don't need the elements, only the indices, so we nip them to get rid of them.

Raku, 39 bytes
{[eq] map {map {.index($^a)},.comb},@_}

Try it online!

Ruby, 49 bytes
a.map{|s|s.chars.map{|c|s.index(c)}}.uniq.size==1

This is a function which takes in variable arguments which are stored into the 'a' variable. The algorithm is to map the characters in each word to the index of their first occurrence in the word. Once this is done, if there is only 1 unique element (aka both mappings are the same) then they are isomorphs.

Except it isn't actually a function, it's just a code snippet. Snippets are not allowed by default. The shortest way to fix it is probably with an unnamed proc: ->a{...}

C#, 265 bytes
using System;using System.Linq;class I{static void Main(string[]a){var x=a[0].ToCharArray();var y=a[1].ToCharArray();Func<char[],char[],bool> l=(s,t)=>s.Select(i=>Array.IndexOf(s,i)).SequenceEqual(t.Select(i=>Array.IndexOf(t,i)));Console.WriteLine(l.Invoke(x,y));}}

PHP, 99 Bytes
for(;$ß=$argv[1][$±++];)$×.=$$ß?"\\".$$ß:"(.)".!$$ß=++$µ;echo preg_match("#^$×$#",$argv[2]);

old but no PHP solution and I have solve together with @Christoph and @Titus a similar task

Clojure, 49 bytes
#(apply =(for[s %&](for[a s b s](= a b))))

Hey it works on any number of arguments!

Japt, 6 bytes
Takes input as an array of 2 strings.
®ï¥Ãre

Try it
®          :Map input array
 ï         :  Cartesian product of each string with itself
  ¥        :  Reduce each pair of characters by testing for equality
   Ã       :End map
    r      :Reduce by
     e     : Array equality

Powershell, 71 bytes
param($a,$b)filter i{($s=$_)|% t*y|%{$s|% i*f $_}}"$($a|i)"-eq"$($b|i)"

Less golfed test script:
$f = {

param($a,$b)
filter i{
    ($s=$_)|% toCharArray|%{$s|% indexOf $_}  # returns an array of first position of each char
}
"$($a|i)"-eq"$($b|i)"                         # returns equality of two array.toString()

}

@(
    ,("ESTATE", "DUELED", $true)
    ,("DUELED", "ESTATE", $true)
    ,("XXX", "YYY", $true)
    ,("CBAABC", "DEFFED", $true)
    ,("RAMBUNCTIOUSLY", "THERMODYNAMICS", $true)
    ,("DISCRIMINATIVE", "SIMPLIFICATION", $true)
    ,("SEE", "SAW", $false)
    ,("ANTS", "PANTS", $false)
    ,("BANANA", "SERENE", $false)
    ,("BANANA", "SENSES", $false)
    ,("AB", "CC", $false)
    ,("XXY", "XYY", $false)
    ,("ABCBACCBA", "ABCBACCAB", $false)
    ,("ABAB", "CD", $false)
) | % {
    $a,$b,$expected = $_
    $result = &$f $a $b
    "$($result-eq$expected): $result"

}

Output:
True: True
True: True
True: True
True: True
True: True
True: True
True: False
True: False
True: False
True: False
True: False
True: False
True: False
True: False

C# (Visual C# Interactive Compiler), 72 bytes
a=>b=>a.Select(c=>a.IndexOf(c)).SequenceEqual(b.Select(c=>b.IndexOf(c)))

Try it online!
This is a port of @ygramul answer...
My original answer is below:
C# (Visual C# Interactive Compiler), 84 bytes
a=>b=>a.Length==b.Length&&!a.Where((x,i)=>b.IndexOf(b[i++],i)!=a.IndexOf(x,i)).Any()

Try it online!
Less golfed...
// a and b are strings to compare
a=>b=>
  // ensure equal lenghts
  a.Length==b.Length&&
  // iterate over characters in a
  !a.Where((x,i)=>
    // find next occurrence of current
    // char in b
    b.IndexOf(b[i++],i) !=
    // compare to next occurrence
    // of corresponding char in a
    a.IndexOf(x,i)
  // check for any mismatches
  // and negate the result
  ).Any()

Since you can use any consistent truth values, negation is not necessary -- ==b.Length&&! ~> !=b.Length||.

Japt, 8 bytes
®m!bZÃr¥

Try it online!

:p

@Shaggy Great minds...


text:
ASCII Art of the Day #1 - Double Knot
Write a full program or a function that takes a positive integer N as input via STDIN/command line/ARGV or function arguments and prints an ASCII double knot corresponding to the N to STDOUT.
The ASCII double knot looks like this:
  __  __  __  __  __  __
 /  \/  \/  \/  \/  \/  \
| /\/ /\/ /\/ /\/ /\/ /\ |
| \/ /\/ /\/ /\/ /\/ /\/ |
 \ \/\ \/\ \/\ \/\ \/\ \/
 /\ \/\ \/\ \/\ \/\ \/\ \
| /\/ /\/ /\/ /\/ /\/ /\ |
| \/ /\/ /\/ /\/ /\/ /\/ |
 \__/\__/\__/\__/\__/\__/

The above is for N = 6
Here are a few more double knots for other values of N:
If N = 1, the output double knot looks like:
  __
 /  \
| /\ |
| \/ |
 \ \/
 /\ \
| /\ |
| \/ |
 \__/

For N = 2, its
  __  __
 /  \/  \
| /\/ /\ |
| \/ /\/ |
 \ \/\ \/
 /\ \/\ \
| /\/ /\ |
| \/ /\/ |
 \__/\__/

For N = 3, its
  __  __  __
 /  \/  \/  \
| /\/ /\/ /\ |
| \/ /\/ /\/ |
 \ \/\ \/\ \/
 /\ \/\ \/\ \
| /\/ /\/ /\ |
| \/ /\/ /\/ |
 \__/\__/\__/

and similarly, the pattern continues and any larger value of N.
Details:

The input is always a positive integer greater than 0.
Trailing newline is optional
There should either be no trailing spaces in each line, or enough trailing spaces such that each row's length is 4*N + 2.
There should never be any leading space that aren't part of the specified pattern.

This is code-golf, so shortest code in bytes wins.

Series Leaderboard
I am converting this into a series of ASCII art challenges and thus adding a leader board for the series (snippet by Martin). To make sure that your answers show up, please start every answer with a headline, using the following Markdown template:
# Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:
# Ruby, <s>104</s> <s>101</s> 96 bytes

/* Configuration */

var QUESTION_IDs = [50484, 50521, 50625, 51123, 51222]; // Obtain this from the url
// It will be like http://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!.FjwQBrX2KXuFkv6p2lChi_RjzM19";

/* App */

var answers = [], page = 1, currentQ = -1;

function answersUrl(index) {
  return "http://api.stackexchange.com/2.2/questions/" +  QUESTION_IDs.join(";") + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function getAnswers() {
  $.ajax({
    url: answersUrl(page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      if (data.has_more) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SIZE_REG = /\d+(?=[^\d&]*(?:<(?:s>((?!>).)*<\/s>|((?!>).)+>)[^\d&]*)*$)/;
var NUMBER_REG = /\d+/;
var LANGUAGE_REG = /^#*\s*([^\n,]+)(?=,)/;//

function shouldHaveHeading(a) {
  var pass = false;
  var lines = a.body_markdown.split("\n");
  try {
    pass |= /^#/.test(a.body_markdown);
    pass |= ["-", "="]
              .indexOf(lines[1][0]) > -1;
    pass &= LANGUAGE_REG.test(a.body_markdown);
  } catch (ex) {}
  return pass;
}

function shouldHaveScore(a) {
  var pass = false;
  try {
    pass |= SIZE_REG.test(a.body_markdown.split("\n")[0]);
  } catch (ex) {}
  if (!pass) console.log(a);
  return pass;
}

function getAuthorName(a) {
  return a.owner.display_name;
}

function getAuthorId(a) {
  return a.owner.user_id;
}

function process() {
  answers = answers.filter(shouldHaveScore)
                   .filter(shouldHaveHeading);
  answers.sort(function (a, b) {
    var aB = +(a.body_markdown.split("\n")[0].match(SIZE_REG) || [Infinity])[0],
        bB = +(b.body_markdown.split("\n")[0].match(SIZE_REG) || [Infinity])[0];
    return aB - bB
  });

  var users = {};
  answers.forEach(function (a) {
    var headline = a.body_markdown.split("\n")[0];
    var question = QUESTION_IDs.indexOf(a.question_id);
    var size = parseInt((headline.match(SIZE_REG)||[0])[0]);
    var language = headline.match(LANGUAGE_REG)[1];
    var user = getAuthorName(a);
    var userId = getAuthorId(a);
    if (!users[userId]) users[userId] = {name: user, nAnswer: 0, answers: []};
    if (!users[userId].answers[question]) {
      users[userId].answers[question] = {size: Infinity};
      users[userId].nAnswer++;
    }
    if (users[userId].answers[question].size > size) {
      users[userId].answers[question] = {size: size, link: a.share_link}
    }
  });

  var sortedUsers = [];
  for (var userId in users)
    if (users.hasOwnProperty(userId)) {
      var user = users[userId];
      user.score = 0;
      user.completedAll = true;
      for (var i = 0; i < QUESTION_IDs.length; ++i) {
        if (user.answers[i])
          user.score += user.answers[i].size;
        else
          user.completedAll = false;
      }
      sortedUsers.push(user);
    }

  sortedUsers.sort(function (a, b) {
    if (a.nAnswer > b.nAnswer) return -1;
    if (b.nAnswer > a.nAnswer) return 1;
    return a.score - b.score;
  });

  var place = 1;
  for (var i = 0; i < sortedUsers.length; ++i) {
    var user = sortedUsers[i];
    var row = '
'+ place++ +'.	'+user.name+'	';
    for (var j = 0; j < QUESTION_IDs.length; ++j) {
      var answer = user.answers[j];
      if (answer)
        row += ''+answer.size+'	';
      else
        row += '	';
    }
    row += '	';
    if (user.completedAll)
      row += ''+user.score+'	';
    else
      row += ''+user.score+'	';
    row += '
';
    $("#users").append(row);
  }
}
body { text-align: left !important}

#leaderboard {
  width: 500px;
}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}

td.total {
  font-weight: bold;
  text-align: right;
}

td.missing {
  background: #bbbbbb;
}

<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

    Missing scores are shown as grey cells. A grey total indicates that the user has not participated in all challenges and is not eligible for the overall victory yet.

	User
        #1
        #2
        #3
        #4
        #5
        	Total

{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

Series so far
1. Double Knot
2. Flow Snakes
3. Chinese Shrines
4. Zodiac Signs
5. Random Diamond Tilings

Why is the right edge different for N=3?

@aditsu Haha. 4 days, 3K views, 11 answers and you are the first person to notice it :D . Fixed!

CJam, 55 bytes
I got nerd sniped pretty badly by this... anyway, I finally came up with 55 bytes of ISO 8859-1:
"²îå<63ÅhbØº¢dräOä[æTZ"246b5b"|_ \/"f=9/4/~2/\ri*2>*zN*

or this alternative:
"ô/Ht]õDz1M;í,D¯Tmä$:r"246b5b"_/\ |"f=9/2/~+ri*2>\++zN*

Initially I tried to do it in plain ASCII, but only got it down to 58 bytes:
"C]VA~`+-WIt*n_I?FanSEo*b"128b5b"_/|\ "f=9/4/~2/\ri*2>*zN*

and again, an alternative:
"1,*Ap7c?UvI$yQHqHqs~=}n"153b5b"_ /|\\"f=9/2/~+ri*2>\++zN*

Explanation:
The idea is to encode the unique parts (left edge, right edge and middle pattern) in a convenient way, repeat the middle part as needed, and put them together. The code ended up being similar in many ways to Dennis's answer; I didn't try to copy him, but I tried many different approaches (including exploiting more symmetries and repetitions) and this is what worked best.
I put the left and right edges together like this:

 /\
|  |
|  |
 \/
 /\
|  |
|  |
 \/

The middle pattern has 4 columns, but they are repeated N-0.5 times, i.e. one repetition is cut in half. For convenience, I used this pattern:
  __
\/
/ /\
 /\/
/\ \
\/\
/ /\
 /\/
/\__

and removed the first half of the first repetition.
So I joined the parts and encoded them in transposed form, as it's easier to work with them that way. The first and third program encode this string:
 \/ /\/ /
 / /\/ /\
_ /\ \/\_
_ \/\ \/_
  ||  ||
 /  \/  \
 \  /\  /
  ||  ||

(without newlines), which is the transposition of the middle + edges. The second and fourth program (the "alternatives") encode this string:
  ||  ||
 /  \/  \
 \  /\  /
  ||  ||
 \/ /\/ /
 / /\/ /\
_ /\ \/\_
_ \/\ \/_

again, without newlines, and this is the transposition of edges + middle.
Here's how this common part of the code works:
"…"        encoded string (constructed via the reverse process,
           using a suitable base that gives valid characters)
246b       convert the string to an integer, treating each character as a digit
           in base 246 (or other bases in the ASCII versions)
5b         convert the number to base 5, obtaining 72 digits from 0 to 4,
           representing the 5 different characters we have
"|_ \/"f=  convert the digits to their corresponding characters
           (each program uses a different assignment order)
9/         split the resulting strings into 8 strings of 9 characters
           if viewed as lines, they look exactly like the 2 patterns shown above

After this, the implementation differs slightly. In the first and third program we have:
4/     split the lines into groups of 4 - the middle part and the edges
~      dump the two 4-line parts onto the stack
2/     split the second part (the edges) into 2 groups of 2 lines
       (left edge and right edge)
\      swap the edges with the middle part
ri*    read the input, convert to integer (N) and repeat the middle part N times
2>     remove the first 2 lines (first half of first repetition)
*      join the 2 edges using the repeated middle part as a separator
z      transpose the result back to the desired form
N*     join with newlines

In the second and fourth (alternative) programs, we have:
2/     split the lines into groups of 2
       (left edge, right edge, middle first half, middle 2nd half)
~      dump all the groups onto the stack
+      join the two middle halves into a single middle group of 4 lines
ri*    read the input, convert to integer (N) and repeat the middle part N times
2>     remove the first 2 lines (first half of first repetition)
\      swap the repeated middle with the right edge
+      concatenate the middle with the right edge
+      concatenate the left edge with the rest
z      transpose the result back to the desired form
N*     join with newlines

I'm not sure how long I tried to make the 1>W< shorter. Turns out that I only had to rotate the array before encoding it and use 2>...

CJam, 103 92 83 69 66 57 bytes
"O5àäªÞáKZò,_÷%SJ«Ò"248b5b"/ \_|"f=9/4/~ri*1>W<+2m<zN*

Try it online in the CJam interpreter.
Idea
The pattern becomes a lot more obvious once we transpose rows with columns (padded to the right with spaces).
For input 3, for example, this gives:
  ||  ||
 /  \/  \
_ /\ \/\_
_ \/\ \/_
 \/ /\/ /
 / /\/ /\
_ /\ \/\_
_ \/\ \/_
 \/ /\/ /
 / /\/ /\
_ /\ \/\_
_ \/\ \/_
 \  /\  /
  ||  ||

The first two and last two rows are special, but the others repeat the same pattern over and over again.
Thus, for input N, all we have to do is repeat
 / /\/ /\
_ /\ \/\_
_ \/\ \/_
 \/ /\/ /

N times, replace the first row with
  ||  ||
 /  \/  \

the last row with
 \  /\  /
  ||  ||

and, finally, transpose rows with columns.
Code
"O5àäªÞáKZò,_÷%SJ«Ò"

248b  e# Convert the string (array of code points in base 248) to an integer.
5b    e# Convert the integer to the array of its digits in base 5.

      e# This pushes the following array:

      e# [ 1 2 1 1 0 2 1 1 0 1 1 4 4 1 1 4 4 1 1 1 4 4 1 1
      e#   4 4 1 1 0 1 1 2 0 1 1 2 1 0 1 0 2 0 1 0 2 3 1 0
      e#   2 1 2 0 2 3 3 1 2 0 2 1 2 0 3 1 2 0 1 0 2 0 1 0 ]

"/ \_"

f=    e# Retrieve the chars that correspond to the indexes in the array.

      e# This pushes the following string:

      e# " \  /\  /  ||  ||   ||  ||  /  \/  \ / /\/ /\_ /\ \/\__ \/\ \/_ \/ /\/ /"

9/4/~ e# Divide into groups of 4 strings of length 9.

      e# This pushes the following arrays:

      e# [ " \  /\  /"   "  ||  || "   "  ||  || "   " /  \/  \" ]
      e# [ " / /\/ /\"   "_ /\ \/\_"   "_ \/\ \/_"   " \/ /\/ /" ]

ri    e# Read an integer from STDIN.
*     e# Repeat the last array that many times.
1>W<  e# Remove the first and last string from the array.
+     e# Concatenate both arrays.
2m<   e# Rotate the concatenated arrays two elements to the left.
z     e# Zip the array of strings (transpose rows with columns).
N*    e# Join the strings of the array, separating by linefeeds.

Javascript (ES7 Draft), 169 163 160 158 bytes
Edit: -6 by using a template string to eliminate some repetition from the pattern string.
Edit: -3 by switching from slice(0,-2) to slice(2) by rearranging the pattern string.
Edit: -2 by looping through b instead of a and reducing the a string to 4 with a modulo.

F=N=>[(a='  ||'[i%4])+b[i]+`  __0\\/ ${c=' 0/ /\\0 /\\/0/\\'} \\0\\/\\${c}__`.split(0)[i].repeat(N).slice(2)+(b+b)[9-i]+a for(i in b=' /  \\/  \\')].join(`
`)
<input id="stdin" value="4" />
<button onclick="stdout.innerHTML=F(stdin.value)">Run</button>

Commented:
F=N=>[ // define function F, start array comprehension to generate each line
    (a = '  ||'[i % 4]) + // first character of the line, store copy in a
    b[i] + // second character of each line
        `  __0\\/ ${c=' 0/ /\\0 /\\/0/\\'} \\0\\/\\${c}__`.
        // list of patterns for each line delimited by 0's
        // results in string: '  __0\/  0/ /\0 /\/0/\ \0\/\ 0/ /\0 /\/0/\__'
        split(0)[i]. // split by 0, get index at i
        repeat(N). // repeat N times
        slice(2) + // chop off the first 2 characters
    (b + b)[9 - i] + // get opposite of second character, b+b to get a space at index 9
    a // repeat first character (a)
    for(i in b = ' /  \\/  \\') // runs for each index in character map b
].join(` // join resulting array with newlines
`)

I think you can replace the string before .split(0) with ('__  0  '+(r='\\/0/\\/ 0\\/ /0 ')+r+'0\\/ /0__/\\').

@flawr I was able to condense it down even further using a similar method :)

If you pass 0 on it, you will see an 8.

What do those \` and the${...}` exactly do?

@flawr The backtick syntax declares a [template string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/template_strings). Anything inside${}` is evaluated as a javascript expression.

Perl, 134 129
print s/...\K.{4}/$&x~-"@ARGV"/er=~y!iolp!| /\\!r,$/for
map/i/?$_.oi:"o$_$_".o,o__o,loop,@x=(iolplolp,ioplolpl),popl,lpop,@x,p__l

Takes a command line parameter:
$ perl ~/knot.pl 3
  __  __  __
 /  \/  \/  \
| /\/ /\/ /\ |
| \/ /\/ /\/ |
 \ \/\ \/\ \/
 /\ \/\ \/\ \
| /\/ /\/ /\ |
| \/ /\/ /\/ |
 \__/\__/\__/

JavaScript (ES6), 165 166
Knot elements:

2 top rows, based on '  __' and '/  \'  repeated
2 outer rows, based on '/\/ ' repeated and enclosed in '| ... |'
2 inner rows, based on '\/\ ' repeated and enclosed in '.../' and '/...\'
the same 2 outer rows above
1 bottom row based on '\__/' repeated

Ungolfed
K=r=>
{
  R = x => x.repeat(r);
  S = d => R(elem).slice(d,d-2); // use global 'elem' that must be assigned before the call
  elem = '/\\/ '
  outer = '\n| ' + S(0) + ' |\n| ' + S(1) + ' |\n '
  elem = '\\ \\/'
  inner = '\\' + S(1) + '/\n /' + S(0) + '\\'
  return R('  __') + '\n ' + R('/  \\') + outer
  + inner + outer + R('\\__/')
}

Golfed

K=r=>(S=d=>(R=e=>e.repeat(r))(e).slice(d,d-2),o=`
| ${S(0,e='/\\/ ')} |
| ${S(1)} |
 `,R('  __')+`
 ${R('/  \\')+o}\\${S(1,e='\\ \\/')}/
 /${S(0)}\\${o}`+R('\\__/'))

// TEST

function go() {
  O.innerHTML=K(I.value)
}

go()
<input id=I value=5><button onclick='go()'>-></button>

Try passing 0 to it and you will get a 4-legged spider.

C++ , 1530 639 479
This looked like a fun challenge I deviated from the brief a little.
#include "stdafx.h"
#include <iostream>
#include <sstream>
using namespace std;
string a=" __ ",b="/  \\",c=" /\\",d="/\\/ ",f="\\ \\/",g="/\\\ \\",r="\\__/",o="",e=o,j="|";
string q(int n,string r,string x="",string m=" ",string t=" "){string z=o;for(int i=0;i<n;i++){z+=r;if(i!=n-1)z+=x;}return m+z+t+"\n";}
int main(){int x,y;cin>>x;cin>>y;e+=q(x,a)+q(x,b);for(int i=0;i<y;i++){e+=q(x,c,"/",j," |")+q(x-1,d,o,"| \\/ ",j);if(i!=y-1){e+=q(x,f)+q(x,g);}}e+=q(x,r);cout<<e;}

Im not sure how to measure bytes of the size of my application but I will try figure it out and update my answer.
My app could be smaller but it loops in both the x and y, and I kinda like that :D

Welcome to PPCG! Your score is the size of your source code, which is 1530 bytes as it is. You can start saving bytes by removing comments and whitespace, and shorten variable and function names.

Wowzor thats bigger then the rest haha i will work on getting it down :D

Python 2, 156 151 147 141 139
edit 1: edited to use input() instead of a function.
edit 2: used str.join and added to var c to remove some redundant characters.
edit 3: removed some unnecessary string escape sequences.
edit 4: used ~-n instead of a=n-1
This was good fun to program, my first code golf!
n=input()
a='/\/ '*~-n
b='\ '+'\/\ '*~-n+'\\'
c='\n| '+a+'/\ |\n| \/ '+a+'|'
print'\n '.join(('  __'*n,'/  \\'*n+c,b+'/','/'+b+c,'\__/'*n))

save it in an external text editor as n.py in order to remove last newline character in order to reduce file size by 1 byte, run the module, and input your number.

If you allow for entering the number right after the programs execution statement, then I can further strip it down to 151 bytes

Usually input () is considered okay when reading from STDIN.

I see you've saved a=n-1 to save on writing *(n-1) twice, but you do *~-n.

still same amount of characters either way, because I use the value twice, but good tip.

You can save some bytes on the way python handles backslashes in strings, you don't always need to encode them. See http://stackoverflow.com/a/16973452/3351622

@micsthepick I think it does save chars: b='/\/ '*~-n;c='\ '+'\/\ '*~-n+'\\'

I see. I took the amount it would cost to implement your solution, 2*3 = 6 characters for each use of 'a', and I took that from the cost of the definition - 6, but I didn't take into account that it also takes two characters to use the variable.

Python 2, 139 133 129 bytes
n=input()
for i in range(9):w=' ?|'[i&2];s=' / /\/ /\_ /\ \/\__ \/\ \/_ \/ /\/ /'[i::9]*n;s=(s,' %s '%s[1:-1])[i%4>1];print w+s+w

This one just builds and prints line by line.
Here's the code in ungolfed form:
n=int(input())
# The list with all the knot pieces
l= [' __ ',
    '/  \\',
    ' /\/',
    '/\/ ',
    '\ \/',
    '/\ \\',
    ' /\/',
    '/\/ ',
    '\__/']
# The first and last columns
w = '  ||  || '
# Loop for each row
for i in range(9):
    # Exception for the first and last character in the knot (in some rows)
    s = l[i]*n
    if i % 4 > 1:
        s = ' ' + s[1:-1] + ' '
    # Print the knot for this row
    print(w[i] + s + w[i])

Edit: I changed the language to python 2, to be compatible with my answer for #3 (and it also saves 6 more bytes)

I believe w=(3*'  ||')[i]   ->   w='  |'[i&2] and ' '+s[1:-1]+' '   ->   ' %s '%s[1:-1] work (the first one is a string with two spaces then a pipe, but SE's acting up)

@Sp3000 Thanks! That first one is pretty smart. I should have thought of '  ||'[i%4], but this is even shorter (also with two spaces).

C, 159 bytes
j,k;f(n){char*t="7>771I;M6CMI93;IIB;;MI1M;M6CMI93;IIB;>MI";for(n*=4;t[j/2];++k,k%=n+3,j+=k-n?k%n<3||k%4-2?1:-3:3)putchar("\n _|/\\"[(t[j/2]-48)/(j%2?1:6)%6]);}

With whitespace, and some other readability improvements:
#include <stdio.h>

int j, k;

void f(int n) {
    char *t = "7>771I;M6CMI93;IIB;;MI1M;M6CMI93;IIB;>MI", *m = "\n _|/\\";
    for (n *= 4; t[j / 2];
         ++k,
         k %= n + 3,
         j += k - n ? k % n < 3 || k % 4 - 2 ? 1 : -3 : 3)
        putchar(m[(t[j / 2] - 48) / (j % 2 ? 1 : 6 ) % 6]);
}

This is primarily template based. The template t contains all 9 possible columns of the output, meaning that it encodes 9 * 9 = 81 characters, or 80 without the trailing newline.
Since there are only 6 different characters in the pattern (including newline characters), I packaged pairs of them into one template character, which means that the template can be stored in 40 characters. There are then 6 * 6 = 36 possible pairs of characters, which are encoded as ASCII characters 48 to 73. The translation back to the original character is given by the small lookup table m.
The rest of the logic is mainly to repeat the pattern n times, which means jumping back 4 characters in the template, while emitting the start and end parts of each row correctly.

PHP 5.5.3, 488, 466
<?php
function k($n){$r=array_fill(0,9,'');for($i=0;$i<$n;$i++){$r[0].=($i==0)?"  __ ":" __ ";$r[1].=($i==0)?" /  \\":"/  \\";$r[2].=($i==0)?"| /\\/":(($i==$n-1)?" /\\ |":" /\\/");$r[3].=($i==0)?"| \/ ":(($i==$n-1)?"/\/ |":"/\/ ");$r[4].=($i==0)?" \\ ":(($i==$n-1)?"\\/\\ \\/":"\\/\\ ");$r[5].=($i==0)?" /\\ ":(($i==$n-1)?"\\/\\ \\":"\\/\\ ");$r[6]=$r[2];$r[7]=$r[3];$r[8].=($i==0)? " \__/":"\__/";}foreach($r as $o){if(strlen($o)-2 !== 4*$n)$o.=" ";echo $o."\n";}}

You can save some chars by removing some unnecessary whitespace around operators, for example around the = and .= ones.

Thx I edited the answer

Prolog (SWI), 285 bytes
a(N):-b(N,"  ||  || "," /  \\/  \\","_ /\\ \\/\\_","_ \\/\\ \\/_"," \\/ /\\/ /"," / /\\/ /\\"," \\  /\\  /"). b(N,[A|G],[B|H],[C|I],[D|J],[E|K],[F|L],[Y|Z]):-c(N,[Y,A],[E,F,C,D],T),writef([A,B,C,D|T]),nl,b(N,G,H,I,J,K,L,Z). c(1,L,_,L):-!. c(N,L,X,O):-M is N-1,c(M,L,X,T),append(X,T,O).

(With whitespace):
a(N):-
    b(N,
    "  ||  || ",
    " /  \\/  \\",
    "_ /\\ \\/\\_",
    "_ \\/\\ \\/_",
    " \\/ /\\/ /",
    " / /\\/ /\\",
    " \\  /\\  /").

b(N,[A|G],[B|H],[C|I],[D|J],[E|K],[F|L],[Y|Z]):-
    c(N,[Y,A],[E,F,C,D],T),
    writef([A,B,C,D|T]),
    nl,
    b(N,G,H,I,J,K,L,Z).

c(1,L,_,L):-!.
c(N,L,X,O):-
    M is N - 1,
    c(M,L,X,T),
    append(X,T,O).

I tried a few ways of chopping the strings, but none seemed to beat this naive columns method.

JavaScript (ES6), 158 154 148 137 bytes
n=>`    __
 /\\/ - \\/
 /\\/\\-__/`.replace(/-/g,` \\
| / /\\ |
|  /\\/ |
 \\/\\`).replace(/(..)(....)/g,(_,l,m)=>l+m.repeat(n).slice(2))

Edit: Saved 11 bytes thanks to @Bálint.

@Bálint But /(..)(.{4})/g is 13 bytes, the same as /(..)(....)/g...

@Bálint I actually realised that my previous 4-byte saving allowed me to do that, but I was away from the computer at the time.

@Bálint Nice! I had looked into avoiding the repeated \/\ segment but I hadn't thought to check for a longer repeated substring.

PowerShell, 228 207 181 133 bytes
%{"  "+"__  "*$_;" "+"/  \"*$_;$b="|"+" /\/"*$_+"`b |";$b;$c="| "+"\/ /"*$_+"`b|";$c;" "+"\ \/"*$_;" "+"/\ \"*$_;$b;$c;" "+"\__/"*$_}

Reminder - PowerShell doesn't wait on stdin automatically. You have to pipe something in, e.g. 3|%{...}

Java, 339 330 bytes
class D{int n,i;public static void main(String[]a){new D(new Integer(a[0]));}D(int k){n=k;r("  __");p("\n ");r("/  \\");c();r("\\ \\/");p("\n ");r("/\\ \\");c();r("\\__/");}void c(){p("\n|");--n;r(" /\\/");p(" /\\ |\n| \\/");r(" /\\/");++n;p(" |\n ");}void p(String s){System.out.print(s);}void r(String s){for(i=n;i>0;--i)p(s);}}

My first solution had so many "static" keywords in it that it was shorter to make the methods and attributes non-static and run the code in the constructor.

SmileBASIC, 149 bytes
INPUT N?"  __"*N
A$="| / /\ |
B$="|  /\/ |
K" /\/  \
K A$K B$K" \/\ \/
K" /\/\ \
K A$K B$K" \/\__/
DEF K A?SUBST$(A,2,4,MID$(MID$(A,2,4)*N,2,N*9))END

Each string contains the pattern AACCBBDD which is expanded to form AABB(CCBB)*DD The CCBB part is repeated N times, then the first 2 characters are removed. (It was shorter to remove characters from the start than from the end)

Vyxal, 78 bytes
‛ _m*ðp,‛/ øṀ*ðp,` /\\`w$ẋf⁋¶\/V\|p‛ |+…Ṙ…£`\/\\`w$ẋfṄðpǔð₴…ð₴ǔ,¥Ḃ,,`\__/`*ðp,

Try it Online!
Builds it incrementally. Here's a cool version that makes it a square.